summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2011-10-16 05:36:39 +0000
committerdas <das@FreeBSD.org>2011-10-16 05:36:39 +0000
commit5bafe9f5deebb240191b7ed13ff9f18b044fb548 (patch)
tree37d058958b42c28cc1609982b78fabe24b4bfff9 /lib
parent8e252b8a5d00ca227cb9ae1dac9c82724ed9cc24 (diff)
downloadFreeBSD-src-5bafe9f5deebb240191b7ed13ff9f18b044fb548.zip
FreeBSD-src-5bafe9f5deebb240191b7ed13ff9f18b044fb548.tar.gz
Move the macros GET_LDBL_EXPSIGN() and SET_LDBL_EXPSIGN() into
math_private.h, so they can be used elsewhere in the math library.
Diffstat (limited to 'lib')
-rw-r--r--lib/msun/src/e_hypotl.c15
-rw-r--r--lib/msun/src/math_private.h19
2 files changed, 19 insertions, 15 deletions
diff --git a/lib/msun/src/e_hypotl.c b/lib/msun/src/e_hypotl.c
index 0c899bf..7b5ab89 100644
--- a/lib/msun/src/e_hypotl.c
+++ b/lib/msun/src/e_hypotl.c
@@ -21,13 +21,6 @@ __FBSDID("$FreeBSD$");
#include "math.h"
#include "math_private.h"
-#define GET_LDBL_EXPSIGN(i, v) do { \
- union IEEEl2bits uv; \
- \
- uv.e = v; \
- i = uv.xbits.expsign; \
-} while (0)
-
#define GET_LDBL_MAN(h, l, v) do { \
union IEEEl2bits uv; \
\
@@ -36,14 +29,6 @@ __FBSDID("$FreeBSD$");
l = uv.bits.manl; \
} while (0)
-#define SET_LDBL_EXPSIGN(v, i) do { \
- union IEEEl2bits uv; \
- \
- uv.e = v; \
- uv.xbits.expsign = i; \
- v = uv.e; \
-} while (0)
-
#undef GET_HIGH_WORD
#define GET_HIGH_WORD(i, v) GET_LDBL_EXPSIGN(i, v)
#undef SET_HIGH_WORD
diff --git a/lib/msun/src/math_private.h b/lib/msun/src/math_private.h
index fd6f141..2f8a9db 100644
--- a/lib/msun/src/math_private.h
+++ b/lib/msun/src/math_private.h
@@ -188,6 +188,25 @@ do { \
(d) = sf_u.value; \
} while (0)
+/* Get expsign as a 16 bit int from a long double. */
+
+#define GET_LDBL_EXPSIGN(i,d) \
+do { \
+ union IEEEl2bits ge_u; \
+ ge_u.e = (d); \
+ (i) = ge_u.xbits.expsign; \
+} while (0)
+
+/* Set expsign of a long double from a 16 bit int. */
+
+#define SET_LDBL_EXPSIGN(d,v) \
+do { \
+ union IEEEl2bits se_u; \
+ se_u.e = (d); \
+ se_u.xbits.expsign = (v); \
+ (d) = se_u.e; \
+} while (0)
+
#ifdef FLT_EVAL_METHOD
/*
* Attempt to get strict C99 semantics for assignment with non-C99 compilers.
OpenPOWER on IntegriCloud