mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-25 11:42:10 +02:00
* sparc uses softfloat routines so softfloat exception masking needs to be set properly
git-svn-id: trunk@6888 -
This commit is contained in:
parent
64c1da895f
commit
2d0c27e80d
@ -21,7 +21,6 @@ function GetRoundMode: TFPURoundingMode;
|
||||
result:=TFPURoundingMode(get_fsr shr 30);
|
||||
end;
|
||||
|
||||
|
||||
function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode;
|
||||
begin
|
||||
set_fsr((get_fsr and $3fffffff) or (dword(RoundMode) shl 30));
|
||||
@ -108,6 +107,8 @@ function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask;
|
||||
|
||||
{ update control register contents }
|
||||
set_fsr(fsr);
|
||||
|
||||
softfloat_exception_mask:=dword(Mask);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@ -45,11 +45,20 @@ function get_got : pointer;assembler;nostackframe;[public, alias: 'FPC_GETGOT'];
|
||||
end;
|
||||
|
||||
|
||||
{$define FPC_SYSTEM_HAS_SYSRESETFPU}
|
||||
Procedure SysResetFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
begin
|
||||
softfloat_exception_flags:=0;
|
||||
softfloat_exception_mask:=float_flag_underflow or float_flag_inexact or float_flag_denormal;
|
||||
{ enable div by 0 and invalid operation fpu exceptions
|
||||
round towards zero; ieee compliant arithmetics }
|
||||
set_fsr((get_fsr and $3fbfffff) or $09000000);
|
||||
end;
|
||||
|
||||
|
||||
procedure fpc_cpuinit;
|
||||
begin
|
||||
{ enable div by 0 and invalid operation fpu exceptions }
|
||||
{ round towards zero; ieee compliant arithmetics }
|
||||
set_fsr((get_fsr and $3fbfffff) or $09000000);
|
||||
SysResetFPU;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user