mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 21:48:09 +02:00
* simplify SysResetFPU
This commit is contained in:
parent
4d67cd80fc
commit
73e96f8f1e
@ -90,7 +90,7 @@ begin
|
||||
softfloat_exception_mask:=[exPrecision,exUnderflow];
|
||||
{$ifdef FPUFD}
|
||||
cw:=GetNativeFPUControlWord;
|
||||
{ riscv does not support triggering exceptoins when FPU exceptions happen;
|
||||
{ riscv does not support triggering exceptions when FPU exceptions happen;
|
||||
it merely records which exceptions have happened until now -> clear }
|
||||
cw.cw:=0;
|
||||
{ round to nearest }
|
||||
|
@ -1621,20 +1621,19 @@ end;
|
||||
|
||||
|
||||
{$define FPC_SYSTEM_HAS_SYSRESETFPU}
|
||||
Procedure SysResetFPU;
|
||||
var
|
||||
{ these locals are so we don't have to hack pic code in the assembler }
|
||||
localmxcsr: dword;
|
||||
localfpucw: word;
|
||||
begin
|
||||
localfpucw:=Default8087CW;
|
||||
localmxcsr:=DefaultMXCSR;
|
||||
asm
|
||||
fninit
|
||||
fwait
|
||||
fldcw localfpucw
|
||||
ldmxcsr localmxcsr
|
||||
end;
|
||||
Procedure SysResetFPU;assembler;nostackframe;
|
||||
asm
|
||||
fninit
|
||||
fwait
|
||||
{$ifdef FPC_PIC}
|
||||
movq Default8087CW@GOTPCREL(%rip),%rax
|
||||
fldcw (%rax)
|
||||
movq DefaultMXCSR@GOTPCREL(%rip),%rax
|
||||
ldmxcsr (%rax)
|
||||
{$else FPC_PIC}
|
||||
fldcw Default8087CW(%rip)
|
||||
ldmxcsr DefaultMXCSR(%rip)
|
||||
{$endif FPC_PIC}
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user