From 5279693919665e137f897c985853da380e7295a5 Mon Sep 17 00:00:00 2001 From: sergei Date: Sat, 6 Sep 2014 21:01:50 +0000 Subject: [PATCH] * softfpu.pp: fixed two more porting bugs, and also added two typecasts to avoid unnecessary 64-bit operations. git-svn-id: trunk@28609 - --- rtl/inc/softfpu.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rtl/inc/softfpu.pp b/rtl/inc/softfpu.pp index 4be189b9a9..6df5d06c7d 100644 --- a/rtl/inc/softfpu.pp +++ b/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;