Przeglądaj źródła

* softfpu.pp: fixed two more porting bugs, and also added two typecasts to avoid unnecessary 64-bit operations.

git-svn-id: trunk@28609 -
sergei 11 lat temu
rodzic
commit
5279693919
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      rtl/inc/softfpu.pp

+ 4 - 4
rtl/inc/softfpu.pp

@@ -612,13 +612,13 @@ begin
             end;
         end;
     end;
-    roundBits := absZ and $7F;
+    roundBits := lo(absZ) and $7F;
     absZ := ( absZ + roundIncrement ) shr 7;
-    absZ := absZ and not( ord( ( roundBits xor  $40 ) = 0 ) and ord(roundNearestEven) );
+    absZ := absZ and not( bits64( ord( ( roundBits xor  $40 ) = 0 ) and ord(roundNearestEven) ));
     z := absZ;
     if ( zSign<>0 ) then
       z := - z;
-    if ( ( absZ shr 32 ) or ( z and ( ord( z < 0 ) xor  zSign ) ) )<>0 then
+    if ( longint(hi( absZ )) or ( z and ( ord( z < 0 ) xor  zSign ) ) )<>0 then
     begin
         float_raise( float_flag_invalid );
         if zSign<>0 then
@@ -1602,7 +1602,7 @@ Begin
           z := ( z shl 15 );
         if ( z <= a ) then
         Begin
-           estimateSqrt32 := bits32 ( ( sbits32 (a )) shr 1 );
+           estimateSqrt32 := bits32 ( SarLongint( sbits32 (a)) );
            exit;
         End;
     End;