|
@@ -1216,16 +1216,24 @@ const
|
|
|
|
|
|
{$define FPC_SYSTEM_HAS_SYSRESETFPU}
|
|
|
Procedure SysResetFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
|
|
|
+ var
|
|
|
+ { these locals are so we don't have to hack pic code in the assembler }
|
|
|
+ localmxcsr: dword;
|
|
|
+ localfpucw: word;
|
|
|
begin
|
|
|
+ localfpucw:=Default8087CW;
|
|
|
asm
|
|
|
fninit
|
|
|
- fldcw Default8087CW
|
|
|
+ fldcw localfpucw
|
|
|
fwait
|
|
|
end;
|
|
|
if has_sse_support then
|
|
|
- asm
|
|
|
- { setup sse exceptions }
|
|
|
- ldmxcsr mxcsr
|
|
|
+ begin
|
|
|
+ localmxcsr:=mxcsr;
|
|
|
+ asm
|
|
|
+ { setup sse exceptions }
|
|
|
+ ldmxcsr localmxcsr
|
|
|
+ end;
|
|
|
end;
|
|
|
softfloat_exception_flags:=0;
|
|
|
softfloat_exception_mask:=float_flag_underflow or float_flag_inexact or float_flag_denormal;
|