summaryrefslogtreecommitdiffstats
path: root/lib/libc/ia64/_fpmath.h
diff options
context:
space:
mode:
authormike <mike@FreeBSD.org>2003-02-26 16:04:34 +0000
committermike <mike@FreeBSD.org>2003-02-26 16:04:34 +0000
commit39b6d14ab492b391ff4eee3737dd03a2ddbb33fa (patch)
treecd87c888cf7fce15baf29bb4d3650c69a6f4be10 /lib/libc/ia64/_fpmath.h
parentc65b6d4325cbd6ac51155406331d8f9895f2f058 (diff)
downloadFreeBSD-src-39b6d14ab492b391ff4eee3737dd03a2ddbb33fa.zip
FreeBSD-src-39b6d14ab492b391ff4eee3737dd03a2ddbb33fa.tar.gz
ia64 actually uses 80-bit long doubles and must support big and little
endian at compile-time. Reviewed by: das
Diffstat (limited to 'lib/libc/ia64/_fpmath.h')
-rw-r--r--lib/libc/ia64/_fpmath.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/libc/ia64/_fpmath.h b/lib/libc/ia64/_fpmath.h
index 80ea88a..33e6a32 100644
--- a/lib/libc/ia64/_fpmath.h
+++ b/lib/libc/ia64/_fpmath.h
@@ -27,14 +27,29 @@
* $FreeBSD$
*/
+#include <sys/endian.h>
+
union IEEEl2bits {
long double e;
struct {
- unsigned long manl :64;
- unsigned long manh :48;
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ unsigned int manl :32;
+ unsigned int manh :32;
unsigned int exp :15;
unsigned int sign :1;
+ unsigned long junk :48;
+#else /* _BIG_ENDIAN */
+ unsigned long junk :48;
+ unsigned int sign :1;
+ unsigned int exp :15;
+ unsigned int manh :32;
+ unsigned int manl :32;
+#endif
} bits;
};
-#define mask_nbit_l(u) ((u).bits.manl &= 0x7fffffffffffffff)
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+#define mask_nbit_l(u) ((u).bits.manh &= 0x7fffffff)
+#else /* _BIG_ENDIAN */
+#define mask_nbit_l(u) ((u).bits.manh &= 0xffffff7f)
+#endif
OpenPOWER on IntegriCloud