* 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.
This commit is contained in:
Danny Smith
2003-07-03 11:24:18 +00:00
parent 78b8a13965
commit 235f653a53
6 changed files with 31 additions and 23 deletions

View File

@@ -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)