]> git.saurik.com Git - apple/libc.git/blobdiff - fbsdcompat/_fpmath.h
Libc-391.2.10.tar.gz
[apple/libc.git] / fbsdcompat / _fpmath.h
index cae427f2e471e0ae7ee0fb96d6a0ca48d30baf32..fff55b478ba92b554f4a8427ab2f9ec2b9a24bb0 100644 (file)
@@ -3,8 +3,6 @@
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: /repoman/r/ncvs/src/lib/libc/i386/_fpmath.h,v 1.2 2003/04/05 22:10:13 das Exp $
+ * $FreeBSD: src/lib/libc/i386/_fpmath.h,v 1.3 2004/01/18 07:57:01 das Exp $
  */
 
+#if defined(__ppc__) || defined(__ppc64__)
+
+union IEEEl2bits {
+       long double     e;
+       double          d[2];
+       struct {
+               unsigned long long      sign    :1;
+               unsigned long long      exp     :11;
+               unsigned long long      manh    :52;
+               unsigned long long      sign2   :1;
+               unsigned long long      exp2    :11;
+               unsigned long long      manl    :52;
+       } bits;
+};
+
+#define        mask_nbit_l(u)  ((void)0)
+#define LDBL_IMPLICIT_NBIT
+
+#define        LDBL_MANH_SIZE  52
+#define        LDBL_MANL_SIZE  53      // includes hidden bit
+
+#define LDBL_HEAD_TAIL_PAIR
+
+__private_extern__ void _ldbl2array32dd(union IEEEl2bits, uint32_t *);
+
+#define        LDBL_TO_ARRAY32(u, a) _ldbl2array32dd(u, a)
+
+#elif defined(__i386__)
+
 union IEEEl2bits {
        long double     e;
        struct {
@@ -63,7 +90,14 @@ union IEEEl2bits {
 
 #define        mask_nbit_l(u)  ((u).bits.manh &= 0x7fffffff)
 
+#define        LDBL_MANH_SIZE  32
+#define        LDBL_MANL_SIZE  32
+
 #define        LDBL_TO_ARRAY32(u, a) do {                      \
        (a)[0] = (uint32_t)(u).bits.manl;               \
        (a)[1] = (uint32_t)(u).bits.manh;               \
 } while(0)
+
+#else
+#error unsupported architecture
+#endif