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().
This commit is contained in:
Bruce Evans 2008-01-19 20:02:55 +00:00
parent 9440b9f7ea
commit fa7fdac725
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=175499
2 changed files with 10 additions and 7 deletions

View File

@ -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 @@ twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */
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];

View File

@ -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 @@ twon8 = 3.9062500000e-03; /* 0x3b800000 */
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];