summaryrefslogtreecommitdiffstats
path: root/lib/msun
diff options
context:
space:
mode:
authorkargl <kargl@FreeBSD.org>2012-09-29 16:40:12 +0000
committerkargl <kargl@FreeBSD.org>2012-09-29 16:40:12 +0000
commit37727490753b20f0100711ff71807b884abb5a6c (patch)
treea17dbe78cb67e9c4dae3ef08509483639813f792 /lib/msun
parent4a88b958f4702e9eb5fc9108c28562bec9d6bc71 (diff)
downloadFreeBSD-src-37727490753b20f0100711ff71807b884abb5a6c.zip
FreeBSD-src-37727490753b20f0100711ff71807b884abb5a6c.tar.gz
* src/math_private.h:
. Change the API for the LD80C by removing the explicit passing of the sign bit. The sign can be determined from the last parameter of the macro. . On i386, load long double by bit manipulations to work around at least a gcc compiler issue. On non-i386 ld80 architectures, use a simple assignment. * ld80/s_expl.c: . Update the only consumer of LD80C. Submitted by: bde Approved by: das (mentor)
Diffstat (limited to 'lib/msun')
-rw-r--r--lib/msun/ld80/s_expl.c4
-rw-r--r--lib/msun/src/math_private.h14
2 files changed, 11 insertions, 7 deletions
diff --git a/lib/msun/ld80/s_expl.c b/lib/msun/ld80/s_expl.c
index dfd49e5..2395abe 100644
--- a/lib/msun/ld80/s_expl.c
+++ b/lib/msun/ld80/s_expl.c
@@ -60,9 +60,9 @@ static volatile const long double tiny = 0x1p-10000L;
static const union IEEEl2bits
/* log(2**16384 - 0.5) rounded towards zero: */
-o_threshold = LD80C(0xb17217f7d1cf79ab, 13, 0, 11356.5234062941439488L),
+o_threshold = LD80C(0xb17217f7d1cf79ab, 13, 11356.5234062941439488L),
/* log(2**(-16381-64-1)) rounded towards zero: */
-u_threshold = LD80C(0xb21dfe7f09e2baa9, 13, 1, -11399.4985314888605581L);
+u_threshold = LD80C(0xb21dfe7f09e2baa9, 13, -11399.4985314888605581L);
static const double __aligned(64)
/*
diff --git a/lib/msun/src/math_private.h b/lib/msun/src/math_private.h
index fada0a7..5662df0 100644
--- a/lib/msun/src/math_private.h
+++ b/lib/msun/src/math_private.h
@@ -207,12 +207,16 @@ do { \
(d) = se_u.e; \
} while (0)
-/* Long double constants are broken on i386. This workaround is OK always. */
-#define LD80C(m, ex, s, v) { \
- /* .e = v, */ /* overwritten */ \
- .xbits.man = __CONCAT(m, ULL), \
- .xbits.expsign = (0x3fff + (ex)) | ((s) ? 0x8000 : 0), \
+#ifdef __i386__
+/* Long double constants are broken on i386. */
+#define LD80C(m, ex, v) { \
+ .xbits.man = __CONCAT(m, ULL), \
+ .xbits.expsign = (0x3fff + (ex)) | ((v) < 0 ? 0x8000 : 0), \
}
+#else
+/* The above works on non-i386 too, but we use this to check v. */
+#define LD80C(m, ex, v) { .e = (v), }
+#endif
#ifdef FLT_EVAL_METHOD
/*
OpenPOWER on IntegriCloud