diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2003-07-03 11:24:18 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2003-07-03 11:24:18 +0000 |
commit | 235f653a53a46cf225a4c0e7276436e2822b67d8 (patch) | |
tree | 60281dd899821cf91ed91e48c52b442b0d779d59 /winsup/mingw | |
parent | 78b8a13965e94dac60e4872f6fd6d10093322a2c (diff) | |
download | newlib-235f653a53a46cf225a4c0e7276436e2822b67d8.zip newlib-235f653a53a46cf225a4c0e7276436e2822b67d8.tar.gz newlib-235f653a53a46cf225a4c0e7276436e2822b67d8.tar.bz2 |
* mingwex/math/trunc.c (trunc): Provide lvalue for memory input constraint.
* mingwex/math/truncf.c (truncf): Likewise.
* mingwex/math/truncl.c (truncl): Likewise.
* mingwex/math/modff.c (modff): Likewise.
* mingwex/math/modfl.c (modfl): Likewise.
Diffstat (limited to 'winsup/mingw')
-rw-r--r-- | winsup/mingw/ChangeLog | 8 | ||||
-rw-r--r-- | winsup/mingw/mingwex/math/modff.c | 5 | ||||
-rw-r--r-- | winsup/mingw/mingwex/math/modfl.c | 5 | ||||
-rw-r--r-- | winsup/mingw/mingwex/math/trunc.c | 11 | ||||
-rw-r--r-- | winsup/mingw/mingwex/math/truncf.c | 14 | ||||
-rw-r--r-- | winsup/mingw/mingwex/math/truncl.c | 11 |
6 files changed, 31 insertions, 23 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index 77d86bf..c0abf4d 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,5 +1,13 @@ 2003-07-03 Danny Smith <dannysmith@users.sourceforge.net> + * mingwex/math/trunc.c (trunc): Provide lvalue for memory input constraint. + * mingwex/math/truncf.c (truncf): Likewise. + * mingwex/math/truncl.c (truncl): Likewise. + * mingwex/math/modff.c (modff): Likewise. + * mingwex/math/modfl.c (modfl): Likewise. + +2003-07-03 Danny Smith <dannysmith@users.sourceforge.net> + * include/search.h: New file. * include/stdlib.h: Add comment about qsort, bsearch in search.h. diff --git a/winsup/mingw/mingwex/math/modff.c b/winsup/mingw/mingwex/math/modff.c index 9e34c7c..072faac 100644 --- a/winsup/mingw/mingwex/math/modff.c +++ b/winsup/mingw/mingwex/math/modff.c @@ -9,10 +9,11 @@ modff (float value, float* iptr) { float int_part; unsigned short saved_cw; + unsigned short tmp_cw; /* truncate */ asm ("fnstcw %0;" : "=m" (saved_cw)); /* save control word */ - asm ("fldcw %0;" : : "m" ((saved_cw & ~FE_ROUNDING_MASK) - | FE_TOWARDZERO)); + tmp_cw = (saved_cw & ~FE_ROUNDING_MASK) | FE_TOWARDZERO; + asm ("fldcw %0;" : : "m" (tmp_cw)); asm ("frndint;" : "=t" (int_part) : "0" (value)); /* round */ asm ("fldcw %0;" : : "m" (saved_cw)); /* restore saved cw */ if (iptr) diff --git a/winsup/mingw/mingwex/math/modfl.c b/winsup/mingw/mingwex/math/modfl.c index 5663956..c7ea2cb 100644 --- a/winsup/mingw/mingwex/math/modfl.c +++ b/winsup/mingw/mingwex/math/modfl.c @@ -9,10 +9,11 @@ modfl (long double value, long double* iptr) { long double int_part; unsigned short saved_cw; + unsigned short tmp_cw; /* truncate */ asm ("fnstcw %0;" : "=m" (saved_cw)); /* save control word */ - asm ("fldcw %0;" : : "m" ((saved_cw & ~FE_ROUNDING_MASK) - | FE_TOWARDZERO)); + tmp_cw = (saved_cw & ~FE_ROUNDING_MASK) | FE_TOWARDZERO; + asm ("fldcw %0;" : : "m" (tmp_cw)); asm ("frndint;" : "=t" (int_part) : "0" (value)); /* round */ asm ("fldcw %0;" : : "m" (saved_cw)); /* restore saved cw */ if (iptr) diff --git a/winsup/mingw/mingwex/math/trunc.c b/winsup/mingw/mingwex/math/trunc.c index 2b99312..5c7dc68 100644 --- a/winsup/mingw/mingwex/math/trunc.c +++ b/winsup/mingw/mingwex/math/trunc.c @@ -5,12 +5,11 @@ double trunc (double _x){ double retval; unsigned short saved_cw; - __asm__ ("fnstcw %0;": "=m" (saved_cw)); /* save FPU control word */ - __asm__ ("fldcw %0;" - : - : "m" ((saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD - | FE_TOWARDZERO)) | FE_TOWARDZERO) - ); + unsigned short tmp_cw; + __asm__ ("fnstcw %0;" : "=m" (saved_cw)); /* save FPU control word */ + tmp_cw = (saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)) + | FE_TOWARDZERO; + __asm__ ("fldcw %0;" : : "m" (tmp_cw)); __asm__ ("frndint;" : "=t" (retval) : "0" (_x)); /* round towards zero */ __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */ return retval; diff --git a/winsup/mingw/mingwex/math/truncf.c b/winsup/mingw/mingwex/math/truncf.c index 53fccb1..8869e37 100644 --- a/winsup/mingw/mingwex/math/truncf.c +++ b/winsup/mingw/mingwex/math/truncf.c @@ -2,15 +2,15 @@ #include <math.h> float -truncf (float _x){ +truncf (float _x) +{ float retval; unsigned short saved_cw; - __asm__ ("fnstcw %0;": "=m" (saved_cw)); /* save FPU control word */ - __asm__ ("fldcw %0;" - : - : "m" ((saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD - | FE_TOWARDZERO)) | FE_TOWARDZERO) - ); + unsigned short tmp_cw; + __asm__ ("fnstcw %0;" : "=m" (saved_cw)); /* save FPU control word */ + tmp_cw = (saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)) + | FE_TOWARDZERO; + __asm__ ("fldcw %0;" : : "m" (tmp_cw)); __asm__ ("frndint;" : "=t" (retval) : "0" (_x)); /* round towards zero */ __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */ return retval; diff --git a/winsup/mingw/mingwex/math/truncl.c b/winsup/mingw/mingwex/math/truncl.c index 908197a..e34b21b 100644 --- a/winsup/mingw/mingwex/math/truncl.c +++ b/winsup/mingw/mingwex/math/truncl.c @@ -5,12 +5,11 @@ long double truncl (long double _x){ long double retval; unsigned short saved_cw; - __asm__ ("fnstcw %0;": "=m" (saved_cw)); /* save FPU control word */ - __asm__ ("fldcw %0;" - : - : "m" ((saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD - | FE_TOWARDZERO)) | FE_TOWARDZERO) - ); + unsigned short tmp_cw; + __asm__ ("fnstcw %0;" : "=m" (saved_cw)); /* save FPU control word */ + tmp_cw = (saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)) + | FE_TOWARDZERO; + __asm__ ("fldcw %0;" : : "m" (tmp_cw)); __asm__ ("frndint;" : "=t" (retval) : "0" (_x)); /* round towards zero */ __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */ return retval; |