mirror of
https://github.com/reactos/reactos.git
synced 2025-05-17 16:27:00 +00:00
[CRT]
- Rewrite _fpreset based on Wine. Fixes the last kernel32:thread test failure svn path=/trunk/; revision=68898
This commit is contained in:
parent
59201c3063
commit
ee071ab752
1 changed files with 17 additions and 9 deletions
|
@ -1,11 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING.LIB in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
* FILE: lib/crt/??????
|
* PURPOSE: Resets FPU state to the default
|
||||||
* PURPOSE: Unknown
|
* PROGRAMER: Thomas Faber <thomas.faber@reactos.org>
|
||||||
* PROGRAMER: Unknown
|
|
||||||
* UPDATE HISTORY:
|
|
||||||
* 25/11/05: Added license header
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <precomp.h>
|
#include <precomp.h>
|
||||||
|
@ -15,9 +12,20 @@
|
||||||
*/
|
*/
|
||||||
void CDECL _fpreset(void)
|
void CDECL _fpreset(void)
|
||||||
{
|
{
|
||||||
#if defined(__GNUC__)
|
const unsigned int x86_cw = 0x27f;
|
||||||
__asm__ __volatile__( "fninit" );
|
#ifdef _MSC_VER
|
||||||
|
__asm { fninit }
|
||||||
|
__asm { fldcw [x86_cw] }
|
||||||
#else
|
#else
|
||||||
__asm fninit;
|
__asm__ __volatile__( "fninit; fldcw %0" : : "m" (x86_cw) );
|
||||||
#endif
|
#endif
|
||||||
|
if (IsProcessorFeaturePresent(PF_XMMI64_INSTRUCTIONS_AVAILABLE))
|
||||||
|
{
|
||||||
|
const unsigned long sse2_cw = 0x1f80;
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
__asm { ldmxcsr [sse2_cw] }
|
||||||
|
#else
|
||||||
|
__asm__ __volatile__( "ldmxcsr %0" : : "m" (sse2_cw) );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue