Browse Source

Wipe out any pre-existing exception on SetExceptionMask call for m68k cpu

git-svn-id: trunk@43908 -
pierre 5 years ago
parent
commit
90d2982977
1 changed files with 4 additions and 0 deletions
  1. 4 0
      rtl/m68k/mathu.inc

+ 4 - 0
rtl/m68k/mathu.inc

@@ -79,6 +79,8 @@ const
   FPU68K_EXCEPT_SNAN       = 1 shl (FPU68K_EXCEPT_MASK_SHIFT + 6);
   FPU68K_EXCEPT_SNAN       = 1 shl (FPU68K_EXCEPT_MASK_SHIFT + 6);
   FPU68K_EXCEPT_BSUN       = 1 shl (FPU68K_EXCEPT_MASK_SHIFt + 7);
   FPU68K_EXCEPT_BSUN       = 1 shl (FPU68K_EXCEPT_MASK_SHIFt + 7);
 
 
+  FPU68K_AE_MASK           = $F8;
+
 
 
 function GetExceptionMask: TFPUExceptionMask;
 function GetExceptionMask: TFPUExceptionMask;
 begin
 begin
@@ -116,6 +118,8 @@ begin
       mode:=mode or FPCToFPUExceptionFlags[e];
       mode:=mode or FPCToFPUExceptionFlags[e];
 
 
   SetFPCR((GetFPCR and not FPU68K_EXCEPT_MASK) or (mode and FPU68K_EXCEPT_MASK));
   SetFPCR((GetFPCR and not FPU68K_EXCEPT_MASK) or (mode and FPU68K_EXCEPT_MASK));
+  { Wipe out any previous exception }
+  SetFPSR(GetFPSR and (not (FPU68K_AE_MASK or FPU68K_EXCEPT_MASK)));
   softfloat_exception_mask:=mask;
   softfloat_exception_mask:=mask;
 end;
 end;