summaryrefslogtreecommitdiffstats
path: root/lib/msun/src
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2008-01-19 20:02:55 +0000
committerbde <bde@FreeBSD.org>2008-01-19 20:02:55 +0000
commit3b6da800e829192b8e9fabd5f6f83c8e9763d517 (patch)
treec7a10698ba512efb04dbc4890eda527dc8915426 /lib/msun/src
parent829451090274f704d3316e70915df144d0021834 (diff)
downloadFreeBSD-src-3b6da800e829192b8e9fabd5f6f83c8e9763d517.zip
FreeBSD-src-3b6da800e829192b8e9fabd5f6f83c8e9763d517.tar.gz
Use STRICT_ASSIGN() for _kernel_rem_pio2f() and _kernel_rem_pio2f()
instead of a volatile cast hack for the float version only. The cast hack broke with gcc-4, but this was harmless since the float version hasn't been used for a few years. Merge from the float version so that the double version has a chance of working on i386 with extra precision. See k_rem_pio2f.c rev.1.8 for the original hack. Convert to _FBSDID().
Diffstat (limited to 'lib/msun/src')
-rw-r--r--lib/msun/src/k_rem_pio2.c8
-rw-r--r--lib/msun/src/k_rem_pio2f.c9
2 files changed, 10 insertions, 7 deletions
diff --git a/lib/msun/src/k_rem_pio2.c b/lib/msun/src/k_rem_pio2.c
index 61f7dce..8c99c34 100644
--- a/lib/msun/src/k_rem_pio2.c
+++ b/lib/msun/src/k_rem_pio2.c
@@ -11,9 +11,8 @@
* ====================================================
*/
-#ifndef lint
-static char rcsid[] = "$FreeBSD$";
-#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
/*
* __kernel_rem_pio2(x,y,e0,nx,prec,ipio2)
@@ -131,6 +130,8 @@ static char rcsid[] = "$FreeBSD$";
* to produce the hexadecimal values shown.
*/
+#include <float.h>
+
#include "math.h"
#include "math_private.h"
@@ -277,6 +278,7 @@ recompute:
case 2:
fw = 0.0;
for (i=jz;i>=0;i--) fw += fq[i];
+ STRICT_ASSIGN(float,fw,fw);
y[0] = (ih==0)? fw: -fw;
fw = fq[0]-fw;
for (i=1;i<=jz;i++) fw += fq[i];
diff --git a/lib/msun/src/k_rem_pio2f.c b/lib/msun/src/k_rem_pio2f.c
index 958c863..f1427e6 100644
--- a/lib/msun/src/k_rem_pio2f.c
+++ b/lib/msun/src/k_rem_pio2f.c
@@ -13,9 +13,10 @@
* ====================================================
*/
-#ifndef lint
-static char rcsid[] = "$FreeBSD$";
-#endif
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <float.h>
#include "math.h"
#include "math_private.h"
@@ -169,7 +170,7 @@ recompute:
case 2:
fw = 0.0;
for (i=jz;i>=0;i--) fw += fq[i];
- fw = *(volatile float *)&fw; /* clip any extra precision */
+ STRICT_ASSIGN(float,fw,fw);
y[0] = (ih==0)? fw: -fw;
fw = fq[0]-fw;
for (i=1;i<=jz;i++) fw += fq[i];
OpenPOWER on IntegriCloud