summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorMike Barcroft <mike@FreeBSD.org>2003-02-26 16:04:34 +0000
committerMike Barcroft <mike@FreeBSD.org>2003-02-26 16:04:34 +0000
commitef4a12d2d7d7930bfe5bf5282b4c85abedf495f6 (patch)
treecd87c888cf7fce15baf29bb4d3650c69a6f4be10 /lib/libc
parentb4f721685ee7fb17a7b1a337583d3be229206de9 (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/ia64/_fpmath.h21
-rw-r--r--lib/libc/ia64/gen/infinity.c9
2 files changed, 27 insertions, 3 deletions
diff --git a/lib/libc/ia64/_fpmath.h b/lib/libc/ia64/_fpmath.h
index 80ea88a6bb98..33e6a3209ab0 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
diff --git a/lib/libc/ia64/gen/infinity.c b/lib/libc/ia64/gen/infinity.c
index ac7fc38b65cb..1ae92a804d55 100644
--- a/lib/libc/ia64/gen/infinity.c
+++ b/lib/libc/ia64/gen/infinity.c
@@ -30,10 +30,19 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <sys/endian.h>
#include <math.h>
/* bytes for +Infinity on an ia64 (IEEE double format) */
+#if _BYTE_ORDER == _LITTLE_ENDIAN
const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };
+#else /* _BIG_ENDIAN */
+const union __infinity_un __infinity = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };
+#endif
/* bytes for NaN */
+#if _BYTE_ORDER == _LITTLE_ENDIAN
const union __nan_un __nan = { { 0, 0, 0xc0, 0xff } };
+#else /* _BIG_ENDIAN */
+const union __nan_un __nan = { { 0xff, 0xc0, 0, 0 } };
+#endif