ntdll: Fix the initial FPU control word on 64-bit.
This commit is contained in:
parent
2a26e954ec
commit
8b54390686
|
@ -1387,10 +1387,11 @@ static WORD get_thread_fpu_cw(void)
|
|||
|
||||
static void test_thread_fpu_cw(void)
|
||||
{
|
||||
WORD initial_cw, cw;
|
||||
WORD initial_cw, cw, expect;
|
||||
|
||||
initial_cw = get_fpu_cw();
|
||||
ok(initial_cw == 0x37f, "Expected FPU control word 0x37f, got %#x.\n", initial_cw);
|
||||
expect = sizeof(void *) > sizeof(int) ? 0x27f : 0x37f;
|
||||
ok(initial_cw == expect, "Expected FPU control word expect, got %#x.\n", initial_cw);
|
||||
|
||||
cw = get_thread_fpu_cw();
|
||||
ok(cw == 0x27f, "Expected FPU control word 0x27f, got %#x.\n", cw);
|
||||
|
|
|
@ -2330,6 +2330,7 @@ void signal_free_thread( TEB *teb )
|
|||
*/
|
||||
void signal_init_thread( TEB *teb )
|
||||
{
|
||||
const WORD fpu_cw = 0x27f;
|
||||
stack_t ss;
|
||||
|
||||
#if defined __linux__
|
||||
|
@ -2345,15 +2346,11 @@ void signal_init_thread( TEB *teb )
|
|||
ss.ss_flags = 0;
|
||||
if (sigaltstack(&ss, NULL) == -1) perror( "sigaltstack" );
|
||||
|
||||
if (teb->Peb->ProcessHeap) /* Not for the inital thread. */
|
||||
{
|
||||
const WORD fpu_cw = 0x27f;
|
||||
#ifdef __GNUC__
|
||||
__asm__ volatile ("fninit; fldcw %0" : : "m" (fpu_cw));
|
||||
__asm__ volatile ("fninit; fldcw %0" : : "m" (fpu_cw));
|
||||
#else
|
||||
FIXME("FPU setup not implemented for this platform.\n");
|
||||
FIXME("FPU setup not implemented for this platform.\n");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
|
Loading…
Reference in New Issue