* mingwex/fesetround.c (fesetround): Use unsigned int as operand

to  stmxcsr.
	Thanks to Alexey Kuznetsov <ring0_mipt at users dot sf dot net>
This commit is contained in:
Danny Smith 2007-03-05 07:42:36 +00:00
parent 788e7da136
commit 5643b1ee86
2 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2007-03-05 Danny Smith <dannysmith@users.sourceforge.net>
* mingwex/fesetround.c (fesetround): Use unsigned int as operand
to stmxcsr.
Thanks to Alexey Kuznetsov <ring0_mipt at users dot sf dot net>
2007-02-27 Thorsten Dahlheimer <tdahlheim@gmx.net>
* include/stdio.h (_unlink, unlink): Add prototypes.

View File

@ -20,10 +20,11 @@ int fesetround (int mode)
if (__HAS_SSE)
{
__asm__ volatile ("stmxcsr %0" : "=m" (_cw));
_cw &= ~ 0x6000;
_cw |= (mode << __MXCSR_ROUND_FLAG_SHIFT);
__asm__ volatile ("ldmxcsr %0" : : "m" (_cw));
unsigned int _mxcsr;
__asm__ volatile ("stmxcsr %0" : "=m" (_mxcsr));
_mxcsr &= ~ 0x6000;
_mxcsr |= (mode << __MXCSR_ROUND_FLAG_SHIFT);
__asm__ volatile ("ldmxcsr %0" : : "m" (_mxcsr));
}
return 0;