소스 검색

* 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 년 전
부모
커밋
4f0b3f61ec
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  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
                if (a.high<>$C3E00000) or (a.low<>0) then
                  begin
                  begin
                    float_raise(float_flag_invalid);
                    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
                       (aSig<>$0010000000000000 )) then
                      begin
                      begin
                        result:=$7FFFFFFFFFFFFFFF;
                        result:=$7FFFFFFFFFFFFFFF;
@@ -183,7 +183,7 @@ type
              float_exception_flags |= float_flag_inexact;
              float_exception_flags |= float_flag_inexact;
            }
            }
          end;
          end;
-       if a.high<0 then
+       if longint(a.high)<0 then
          z:=-z;
          z:=-z;
        result:=z;
        result:=z;
      end;
      end;
@@ -205,7 +205,7 @@ type
            if ( a <> Float32($DF000000) ) then
            if ( a <> Float32($DF000000) ) then
              Begin
              Begin
                float_raise( float_flag_invalid );
                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
                  Begin
                    result:=$7fffffffffffffff;
                    result:=$7fffffffffffffff;
                    exit;
                    exit;
@@ -222,7 +222,7 @@ type
          End;
          End;
        aSig64 := int64( aSig or $00800000 ) shl 40;
        aSig64 := int64( aSig or $00800000 ) shl 40;
        z := aSig64 shr ( - shiftCount );
        z := aSig64 shr ( - shiftCount );
-       if ( a<0 ) then z := - z;
+       if ( longint(a)<0 ) then z := - z;
        result := z;
        result := z;
     End;
     End;
 {$endif SUPPORT_DOUBLE}
 {$endif SUPPORT_DOUBLE}