2
0
Эх сурвалжийг харах

* sparc uses softfloat routines so softfloat exception masking needs to be set properly

git-svn-id: trunk@6888 -
florian 18 жил өмнө
parent
commit
2d0c27e80d

+ 2 - 1
rtl/sparc/mathu.inc

@@ -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;
 
 

+ 12 - 3
rtl/sparc/sparc.inc

@@ -45,14 +45,23 @@ function get_got : pointer;assembler;nostackframe;[public, alias: 'FPC_GETGOT'];
   end;
 
 
-procedure fpc_cpuinit;
+{$define FPC_SYSTEM_HAS_SYSRESETFPU}
+Procedure SysResetFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
   begin
-    { enable div by 0 and invalid operation fpu exceptions }
-    { round towards zero; ieee compliant arithmetics }
+    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
+    SysResetFPU;
+  end;
+
+
 {$define FPC_SYSTEM_HAS_GET_FRAME}
 function get_frame:pointer;assembler;nostackframe;
   asm