Jelajahi Sumber

* fixed fpa flag setting

git-svn-id: trunk@6154 -
florian 18 tahun lalu
induk
melakukan
1ab81c7eb6
1 mengubah file dengan 13 tambahan dan 13 penghapusan
  1. 13 13
      rtl/arm/mathu.inc

+ 13 - 13
rtl/arm/mathu.inc

@@ -267,22 +267,22 @@ function GetExceptionMask: TFPUExceptionMask;
     Result:=[];
     cw:=FPU_GetCW;
 
-    if (cw and _FPU_MASK_IM)<>0 then
+    if (cw and _FPU_MASK_IM)=0 then
       include(Result,exInvalidOp);
 
-    if (cw and _FPU_MASK_DM)<>0 then
+    if (cw and _FPU_MASK_DM)=0 then
       include(Result,exDenormalized);
 
-    if (cw and _FPU_MASK_ZM)<>0 then
+    if (cw and _FPU_MASK_ZM)=0 then
       include(Result,exZeroDivide);
 
-    if (cw and _FPU_MASK_OM)<>0 then
+    if (cw and _FPU_MASK_OM)=0 then
       include(Result,exOverflow);
 
-    if (cw and _FPU_MASK_UM)<>0 then
+    if (cw and _FPU_MASK_UM)=0 then
       include(Result,exUnderflow);
 
-    if (cw and _FPU_MASK_PM)<>0 then
+    if (cw and _FPU_MASK_PM)=0 then
       include(Result,exPrecision);
 {$else}
     dword(Result):=softfloat_exception_mask;
@@ -295,25 +295,25 @@ function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask;
     cw : dword;
   begin
 {$if not(defined(gba)) and not(defined(nds))}
-    cw:=FPU_GetCW and not(_FPU_MASK_ALL);
+    cw:=FPU_GetCW or _FPU_MASK_ALL;
 
     if exInvalidOp in Mask then
-      cw:=cw or _FPU_MASK_IM;
+      cw:=cw and not(_FPU_MASK_IM);
 
     if exDenormalized in Mask then
-      cw:=cw or _FPU_MASK_DM;
+      cw:=cw and not(_FPU_MASK_DM);
 
     if exZeroDivide in Mask then
-      cw:=cw or _FPU_MASK_ZM;
+      cw:=cw and not(_FPU_MASK_ZM);
 
     if exOverflow in Mask then
-      cw:=cw or _FPU_MASK_OM;
+      cw:=cw and not(_FPU_MASK_OM);
 
     if exUnderflow in Mask then
-      cw:=cw or _FPU_MASK_UM;
+      cw:=cw and not(_FPU_MASK_UM);
 
     if exPrecision in Mask then
-      cw:=cw or _FPU_MASK_PM;
+      cw:=cw and not(_FPU_MASK_PM);
 
     FPU_SetCW(cw);
 {$endif}