mirror of
https://github.com/antonblanchard/microwatt.git
synced 2026-01-11 23:43:15 +00:00
FPU: Fix setting of r.x for single-precision operations
The fp_rounding function expects r.x to have been set based on the lower 31 bits of r.r, not 29 as presently done, so change 28 to SP_RBIT-1 (SP_RBIT is 31). Also add a test to check. Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
This commit is contained in:
parent
577bbb8f5d
commit
2f29daab2d
2
fpu.vhdl
2
fpu.vhdl
@ -3239,7 +3239,7 @@ begin
|
||||
|
||||
-- If shifting right, test if bits of R will be shifted out of significance
|
||||
if r.longmask = '1' then
|
||||
mshift := to_signed(28, EXP_BITS);
|
||||
mshift := to_signed(SP_RBIT - 1, EXP_BITS);
|
||||
else
|
||||
mshift := to_signed(-1, EXP_BITS);
|
||||
end if;
|
||||
|
||||
@ -680,6 +680,7 @@ struct roundvals {
|
||||
{ FPS_RN_NEAR, 0x38012345b0000000, 0x38012345c0000000, FPS_FR|FPS_FI },
|
||||
{ FPS_RN_NEAR, 0x37c12345b0000000, 0x37c1234400000000, FPS_FI },
|
||||
{ FPS_RN_NEAR, 0x0000008800000088, 0, FPS_FI },
|
||||
{ FPS_RN_NEAR, 0xc2000000c2000000, 0xc2000000c0000000, FPS_FI },
|
||||
};
|
||||
|
||||
int test8(long arg)
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user