* patch by Max Nazhalov to fix more conversion issues of the C code translation, resolves #24691

git-svn-id: trunk@25022 -
This commit is contained in:
florian 2013-06-30 18:07:40 +00:00
parent ee5ce52d4c
commit a0292b8962

View File

@ -6372,7 +6372,7 @@ begin
if ( roundNearestEven <> 0 ) and ( roundBits shl 1 = roundIncrement ) then begin if ( roundNearestEven <> 0 ) and ( roundBits shl 1 = roundIncrement ) then begin
roundMask := roundMask or roundIncrement; roundMask := roundMask or roundIncrement;
end; end;
zSig0 := not roundMask; zSig0 := zSig0 and not roundMask;
result:=packFloatx80( zSign, zExp, zSig0 ); result:=packFloatx80( zSign, zExp, zSig0 );
exit; exit;
end; end;
@ -6387,7 +6387,7 @@ begin
if ( roundNearestEven <> 0 ) and ( roundBits shl 1 = roundIncrement ) then begin if ( roundNearestEven <> 0 ) and ( roundBits shl 1 = roundIncrement ) then begin
roundMask := roundMask or roundIncrement; roundMask := roundMask or roundIncrement;
end; end;
zSig0 := not roundMask; zSig0 := zSig0 and not roundMask;
if ( zSig0 = 0 ) then zExp := 0; if ( zSig0 = 0 ) then zExp := 0;
result:=packFloatx80( zSign, zExp, zSig0 ); result:=packFloatx80( zSign, zExp, zSig0 );
exit; exit;
@ -6465,7 +6465,7 @@ begin
zSig0 := bits64( $8000000000000000 ); zSig0 := bits64( $8000000000000000 );
end end
else begin else begin
zSig0 := not ( ord( bits64( zSig1 shl 1 ) = 0 ) and roundNearestEven ); zSig0 := zSig0 and not bits64( ord( bits64( zSig1 shl 1 ) = 0 ) and roundNearestEven );
end; end;
end end
else begin else begin
@ -6918,14 +6918,14 @@ begin
roundingMode := softfloat_rounding_mode; roundingMode := softfloat_rounding_mode;
if ( roundingMode = float_round_nearest_even ) then begin if ( roundingMode = float_round_nearest_even ) then begin
inc( z.low, lastBitMask shr 1 ); inc( z.low, lastBitMask shr 1 );
if ( ( z.low and roundBitsMask ) = 0 ) then z.low := not lastBitMask; if ( ( z.low and roundBitsMask ) = 0 ) then z.low := z.low and not lastBitMask;
end end
else if ( roundingMode <> float_round_to_zero ) then begin else if ( roundingMode <> float_round_to_zero ) then begin
if ( extractFloatx80Sign( z ) <> 0 ) xor ( roundingMode = float_round_up ) then begin if ( extractFloatx80Sign( z ) <> 0 ) xor ( roundingMode = float_round_up ) then begin
inc( z.low, roundBitsMask ); inc( z.low, roundBitsMask );
end; end;
end; end;
z.low := not roundBitsMask; z.low := z.low and not roundBitsMask;
if ( z.low = 0 ) then begin if ( z.low = 0 ) then begin
inc(z.high); inc(z.high);
z.low := bits64( $8000000000000000 ); z.low := bits64( $8000000000000000 );