Explorar el Código

Add FPC_SOFT_FPUX80 conditional code for 80-bit float type using soft float unit

git-svn-id: trunk@37294 -
pierre hace 7 años
padre
commit
82dce8d7e1
Se han modificado 2 ficheros con 11 adiciones y 3 borrados
  1. 5 1
      rtl/inc/genmath.inc
  2. 6 2
      rtl/inc/mathh.inc

+ 5 - 1
rtl/inc/genmath.inc

@@ -1922,7 +1922,7 @@ function FPower10(val: Extended; Power: Longint): Extended;
   end;
 {$endif SUPPORT_EXTENDED}
 
-{$ifdef SUPPORT_EXTENDED}
+{$if defined(SUPPORT_EXTENDED) or defined(FPC_SOFT_FPUX80)}
 function TExtended80Rec.Mantissa : QWord;
   begin
     Result:=Frac and $7fffffffffffffff;
@@ -1931,7 +1931,11 @@ function TExtended80Rec.Mantissa : QWord;
 
 function TExtended80Rec.Fraction : Extended;
   begin
+{$ifdef SUPPORT_EXTENDED}
     Result:=system.frac(Value);
+{$else}
+    Result:=Frac / Double (1 shl 63) / 2.0;
+{$endif}
   end;
 
 

+ 6 - 2
rtl/inc/mathh.inc

@@ -135,7 +135,7 @@ procedure float_raise(i: TFPUExceptionMask);
       TFloatSpecial = (fsZero,fsNZero,fsDenormal,fsNDenormal,fsPositive,fsNegative,
                        fsInf,fsNInf,fsNaN,fsInvalidOp);
 
-{$ifdef SUPPORT_EXTENDED}
+{$if defined(SUPPORT_EXTENDED) or defined(FPC_SOFT_FPUX80)}
       TExtended80Rec = packed record
       private
         function GetExp : QWord;
@@ -158,9 +158,13 @@ procedure float_raise(i: TFPUExceptionMask);
 {$else ENDIAN_LITTLE}
           2: (_Exp: Word; Frac : QWord);
 {$endif ENDIAN_LITTLE}
+{$ifdef SUPPORT_EXTENDED}
           3: (Value: Extended);
+{$else}
+          3: (Value: array[0..9] of Byte);
+{$endif}
       end;
-{$endif SUPPORT_EXTENDED}
+{$endif SUPPORT_EXTENDED or FPC_SOFT_FPUX80}
 
 {$ifdef SUPPORT_DOUBLE}
       TDoubleRec = packed record