mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 06:09:22 +02:00
* another patch by Max Nazhalov to fix shifting and rounding of float128
git-svn-id: trunk@25031 -
This commit is contained in:
parent
8823574fe2
commit
162cb30528
@ -6135,7 +6135,7 @@ begin
|
|||||||
else begin
|
else begin
|
||||||
if ( count < 64 ) then
|
if ( count < 64 ) then
|
||||||
begin
|
begin
|
||||||
z2 := a1 shr negCount;
|
z2 := a1 shl negCount;
|
||||||
z1 := ( a0 shl negCount ) or ( a1 shr count );
|
z1 := ( a0 shl negCount ) or ( a1 shr count );
|
||||||
z0 := a0 shr count;
|
z0 := a0 shr count;
|
||||||
end
|
end
|
||||||
@ -7869,7 +7869,7 @@ begin
|
|||||||
float_raise( float_flag_overflow or float_flag_inexact );
|
float_raise( float_flag_overflow or float_flag_inexact );
|
||||||
if ( ord( roundingMode = float_round_to_zero )
|
if ( ord( roundingMode = float_round_to_zero )
|
||||||
or ( zSign and ord( roundingMode = float_round_up ) )
|
or ( zSign and ord( roundingMode = float_round_up ) )
|
||||||
or ( not(zSign) and ord( roundingMode = float_round_down ) )
|
or ( ord( zSign = 0) and ord( roundingMode = float_round_down ) )
|
||||||
)<>0 then
|
)<>0 then
|
||||||
begin
|
begin
|
||||||
result :=
|
result :=
|
||||||
@ -7921,7 +7921,7 @@ begin
|
|||||||
if ( increment<>0 ) then
|
if ( increment<>0 ) then
|
||||||
begin
|
begin
|
||||||
add128( zSig0, zSig1, 0, 1, zSig0, zSig1 );
|
add128( zSig0, zSig1, 0, 1, zSig0, zSig1 );
|
||||||
zSig1 := zSig1 and not( ord( zSig2 + zSig2 = 0 ) and roundNearestEven );
|
zSig1 := zSig1 and not bits64( ord( zSig2 + zSig2 = 0 ) and roundNearestEven );
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
if ( ( zSig0 or zSig1 ) = 0 ) then
|
if ( ( zSig0 or zSig1 ) = 0 ) then
|
||||||
|
Loading…
Reference in New Issue
Block a user