Pārlūkot izejas kodu

* fpc_trunc_real: explicitly cast float64.high and float32 to longint, fixes test suite regressions on softfloat targets. These targets have different definitions of float64/float32 (with unsigned fields), causing comparisons like "float64.high<0" to be optimized out.

git-svn-id: trunk@26095 -
sergei 11 gadi atpakaļ
vecāks
revīzija
4f0b3f61ec
1 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. 4 4
      rtl/inc/genmath.inc

+ 4 - 4
rtl/inc/genmath.inc

@@ -158,7 +158,7 @@ type
                if (a.high<>$C3E00000) or (a.low<>0) then
                  begin
                    float_raise(float_flag_invalid);
-                   if (a.high>=0) or ((aExp=$7FF) and
+                   if (longint(a.high)>=0) or ((aExp=$7FF) and
                       (aSig<>$0010000000000000 )) then
                      begin
                        result:=$7FFFFFFFFFFFFFFF;
@@ -183,7 +183,7 @@ type
              float_exception_flags |= float_flag_inexact;
            }
          end;
-       if a.high<0 then
+       if longint(a.high)<0 then
          z:=-z;
        result:=z;
      end;
@@ -205,7 +205,7 @@ type
            if ( a <> Float32($DF000000) ) then
              Begin
                float_raise( float_flag_invalid );
-               if ( (a>=0) or ( ( aExp = $FF ) and (aSig<>0) ) ) then
+               if ( (longint(a)>=0) or ( ( aExp = $FF ) and (aSig<>0) ) ) then
                  Begin
                    result:=$7fffffffffffffff;
                    exit;
@@ -222,7 +222,7 @@ type
          End;
        aSig64 := int64( aSig or $00800000 ) shl 40;
        z := aSig64 shr ( - shiftCount );
-       if ( a<0 ) then z := - z;
+       if ( longint(a)<0 ) then z := - z;
        result := z;
     End;
 {$endif SUPPORT_DOUBLE}