diff --git a/fpu.vhdl b/fpu.vhdl index 4662c9b..0246faf 100644 --- a/fpu.vhdl +++ b/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; diff --git a/tests/fpu/fpu.c b/tests/fpu/fpu.c index ed2b619..b89674f 100644 --- a/tests/fpu/fpu.c +++ b/tests/fpu/fpu.c @@ -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) diff --git a/tests/test_fpu.bin b/tests/test_fpu.bin index 35d5f45..e75740c 100755 Binary files a/tests/test_fpu.bin and b/tests/test_fpu.bin differ