+ applied a fix similar to 11820 to x86-64

git-svn-id: trunk@11821 -
This commit is contained in:
florian 2008-09-25 19:31:16 +00:00
parent 558cf3ef87
commit 50b63884cb
2 changed files with 18 additions and 12 deletions

View File

@ -61,12 +61,10 @@ FPC_ABSMASK_DOUBLE:
procedure SetSSECSR(w : dword);
var
_w : dword;
begin
_w:=w;
mxcsr:=w;
asm
ldmxcsr _w
ldmxcsr w
end;
end;

View File

@ -616,15 +616,23 @@ end;
{$define FPC_SYSTEM_HAS_SYSRESETFPU}
Procedure SysResetFPU;
begin
asm
{ initialize fpu }
fnclex
fwait
var
{ these locals are so we don't have to hack pic code in the assembler }
localmxcsr: dword;
localfpucw: word;
begin
localfpucw:=Default8087CW;
localmxcsr:=mxcsr;
asm
fninit
fwait
fldcw localfpucw
ldmxcsr localmxcsr
end;
{ x86-64 might use softfloat code }
softfloat_exception_flags:=0;
end;
{ x86-64 might use softfloat code }
softfloat_exception_flags:=0;
end;
{$ifndef FPC_SYSTEM_HAS_MEM_BARRIER}
{$define FPC_SYSTEM_HAS_MEM_BARRIER}