浏览代码

* gba and nds have no softfloat support

git-svn-id: trunk@6090 -
florian 18 年之前
父节点
当前提交
83a0391c24
共有 1 个文件被更改,包括 23 次插入15 次删除
  1. 23 15
      rtl/arm/mathu.inc

+ 23 - 15
rtl/arm/mathu.inc

@@ -140,7 +140,7 @@ end;
  *****************************************************************************}
  *****************************************************************************}
 {
 {
  Docs from uclib
  Docs from uclib
- 
+
  * We have a slight terminology confusion here.  On the ARM, the register
  * We have a slight terminology confusion here.  On the ARM, the register
  * we're interested in is actually the FPU status word - the FPU control
  * we're interested in is actually the FPU status word - the FPU control
  * word is something different (which is implementation-defined and only
  * word is something different (which is implementation-defined and only
@@ -212,6 +212,7 @@ end;
 }
 }
 
 
 
 
+{$if not(defined(gba)) and not(defined(nds))}
 const
 const
   _FPU_MASK_IM  =  $00010000;      { invalid operation      }
   _FPU_MASK_IM  =  $00010000;      { invalid operation      }
   _FPU_MASK_ZM  =  $00020000;      { divide by zero         }
   _FPU_MASK_ZM  =  $00020000;      { divide by zero         }
@@ -231,6 +232,7 @@ procedure FPU_SetCW(cw : dword); nostackframe; assembler;
   asm
   asm
     wfs r0
     wfs r0
   end;
   end;
+{$endif}
 
 
 
 
 function GetRoundMode: TFPURoundingMode;
 function GetRoundMode: TFPURoundingMode;
@@ -261,26 +263,30 @@ function GetExceptionMask: TFPUExceptionMask;
   var
   var
     cw : dword;
     cw : dword;
   begin
   begin
+{$if not(defined(gba)) and not(defined(nds))}
     Result:=[];
     Result:=[];
     cw:=FPU_GetCW;
     cw:=FPU_GetCW;
-    
+
     if (cw and _FPU_MASK_IM)<>0 then
     if (cw and _FPU_MASK_IM)<>0 then
       include(Result,exInvalidOp);
       include(Result,exInvalidOp);
-    
+
     if (cw and _FPU_MASK_DM)<>0 then
     if (cw and _FPU_MASK_DM)<>0 then
       include(Result,exDenormalized);
       include(Result,exDenormalized);
-      
+
     if (cw and _FPU_MASK_ZM)<>0 then
     if (cw and _FPU_MASK_ZM)<>0 then
       include(Result,exZeroDivide);
       include(Result,exZeroDivide);
-      
+
     if (cw and _FPU_MASK_OM)<>0 then
     if (cw and _FPU_MASK_OM)<>0 then
       include(Result,exOverflow);
       include(Result,exOverflow);
-      
+
     if (cw and _FPU_MASK_UM)<>0 then
     if (cw and _FPU_MASK_UM)<>0 then
       include(Result,exUnderflow);
       include(Result,exUnderflow);
-      
+
     if (cw and _FPU_MASK_PM)<>0 then
     if (cw and _FPU_MASK_PM)<>0 then
-      include(Result,exPrecision);    
+      include(Result,exPrecision);
+{$else}
+    dword(Result):=softfloat_exception_mask;
+{$endif}
   end;
   end;
 
 
 
 
@@ -288,27 +294,29 @@ function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask;
   var
   var
     cw : dword;
     cw : dword;
   begin
   begin
+{$if not(defined(gba)) and not(defined(nds))}
     cw:=FPU_GetCW and not(_FPU_MASK_ALL);
     cw:=FPU_GetCW and not(_FPU_MASK_ALL);
-    
+
     if exInvalidOp in Mask then
     if exInvalidOp in Mask then
       cw:=cw or _FPU_MASK_IM;
       cw:=cw or _FPU_MASK_IM;
-      
+
     if exDenormalized in Mask then
     if exDenormalized in Mask then
       cw:=cw or _FPU_MASK_DM;
       cw:=cw or _FPU_MASK_DM;
-      
+
     if exZeroDivide in Mask then
     if exZeroDivide in Mask then
       cw:=cw or _FPU_MASK_ZM;
       cw:=cw or _FPU_MASK_ZM;
-      
+
     if exOverflow in Mask then
     if exOverflow in Mask then
       cw:=cw or _FPU_MASK_OM;
       cw:=cw or _FPU_MASK_OM;
-      
+
     if exUnderflow in Mask then
     if exUnderflow in Mask then
       cw:=cw or _FPU_MASK_UM;
       cw:=cw or _FPU_MASK_UM;
-      
+
     if exPrecision in Mask then
     if exPrecision in Mask then
       cw:=cw or _FPU_MASK_PM;
       cw:=cw or _FPU_MASK_PM;
-      
+
     FPU_SetCW(cw);
     FPU_SetCW(cw);
+{$endif}
     softfloat_exception_mask:=dword(Mask);
     softfloat_exception_mask:=dword(Mask);
   end;
   end;