aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNathan Whitehorn <nwhitehorn@FreeBSD.org>2016-02-26 20:38:23 +0000
committerNathan Whitehorn <nwhitehorn@FreeBSD.org>2016-02-26 20:38:23 +0000
commit97a5390e6ddbe408a6ec8320d9081277d6ec6960 (patch)
treef156c494d5b9165579ab97397af3b44bc43bb3ca /lib
parent81e802c14b03fb2405a5231a9f4a5be7f809f886 (diff)
downloadsrc-97a5390e6ddbe408a6ec8320d9081277d6ec6960.tar.gz
src-97a5390e6ddbe408a6ec8320d9081277d6ec6960.zip
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/powerpc/_fpmath.h7
-rw-r--r--lib/libc/powerpc/gen/infinity.c17
-rw-r--r--lib/libc/powerpc64/_fpmath.h7
-rw-r--r--lib/libc/powerpc64/gen/infinity.c17
4 files changed, 44 insertions, 4 deletions
diff --git a/lib/libc/powerpc/_fpmath.h b/lib/libc/powerpc/_fpmath.h
index 6d80eb4bdf4e..4b7971e4da8a 100644
--- a/lib/libc/powerpc/_fpmath.h
+++ b/lib/libc/powerpc/_fpmath.h
@@ -29,10 +29,17 @@
union IEEEl2bits {
long double e;
struct {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ unsigned int manl :32;
+ unsigned int manh :20;
+ unsigned int exp :11;
+ unsigned int sign :1;
+#else /* _BYTE_ORDER == _LITTLE_ENDIAN */
unsigned int sign :1;
unsigned int exp :11;
unsigned int manh :20;
unsigned int manl :32;
+#endif
} bits;
};
diff --git a/lib/libc/powerpc/gen/infinity.c b/lib/libc/powerpc/gen/infinity.c
index cf1695e68028..f5324389d5b6 100644
--- a/lib/libc/powerpc/gen/infinity.c
+++ b/lib/libc/powerpc/gen/infinity.c
@@ -11,7 +11,20 @@ __FBSDID("$FreeBSD$");
#include <math.h>
/* bytes for +Infinity on powerpc */
-const union __infinity_un __infinity = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };
+const union __infinity_un __infinity = {
+#if BYTE_ORDER == BIG_ENDIAN
+ { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
+#else
+ { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
+#endif
+};
/* bytes for NaN */
-const union __nan_un __nan = { { 0xff, 0xc0, 0, 0 } };
+const union __nan_un __nan = {
+#if BYTE_ORDER == BIG_ENDIAN
+ {0xff, 0xc0, 0, 0}
+#else
+ { 0, 0, 0xc0, 0xff }
+#endif
+};
+
diff --git a/lib/libc/powerpc64/_fpmath.h b/lib/libc/powerpc64/_fpmath.h
index 6d80eb4bdf4e..4b7971e4da8a 100644
--- a/lib/libc/powerpc64/_fpmath.h
+++ b/lib/libc/powerpc64/_fpmath.h
@@ -29,10 +29,17 @@
union IEEEl2bits {
long double e;
struct {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ unsigned int manl :32;
+ unsigned int manh :20;
+ unsigned int exp :11;
+ unsigned int sign :1;
+#else /* _BYTE_ORDER == _LITTLE_ENDIAN */
unsigned int sign :1;
unsigned int exp :11;
unsigned int manh :20;
unsigned int manl :32;
+#endif
} bits;
};
diff --git a/lib/libc/powerpc64/gen/infinity.c b/lib/libc/powerpc64/gen/infinity.c
index cf1695e68028..f5324389d5b6 100644
--- a/lib/libc/powerpc64/gen/infinity.c
+++ b/lib/libc/powerpc64/gen/infinity.c
@@ -11,7 +11,20 @@ __FBSDID("$FreeBSD$");
#include <math.h>
/* bytes for +Infinity on powerpc */
-const union __infinity_un __infinity = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };
+const union __infinity_un __infinity = {
+#if BYTE_ORDER == BIG_ENDIAN
+ { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
+#else
+ { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
+#endif
+};
/* bytes for NaN */
-const union __nan_un __nan = { { 0xff, 0xc0, 0, 0 } };
+const union __nan_un __nan = {
+#if BYTE_ORDER == BIG_ENDIAN
+ {0xff, 0xc0, 0, 0}
+#else
+ { 0, 0, 0xc0, 0xff }
+#endif
+};
+