From: Luke Kenneth Casson Leighton Date: Mon, 18 Feb 2019 12:05:26 +0000 (+0000) Subject: whoops set mantissa = -127 instead of exponent... oops... X-Git-Tag: ls180-24jan2020~1912 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d30d28fd7c323582d79cf949fcd865d187fb9b9d;p=ieee754fpu.git whoops set mantissa = -127 instead of exponent... oops... --- diff --git a/src/add/fpbase.py b/src/add/fpbase.py index 8c10d782..e18df3a5 100644 --- a/src/add/fpbase.py +++ b/src/add/fpbase.py @@ -308,7 +308,7 @@ class FPBase: m.next = next_state # denormalised, correct exponent to zero with m.If(z.is_denormalised()): - m.d.sync += z.m.eq(z.N127) + m.d.sync += z.e.eq(z.N127) # FIX SIGN BUG: -a + a = +0. with m.If((z.e == z.N126) & (z.m[0:] == 0)): m.d.sync += z.s.eq(0) diff --git a/src/add/test_add.py b/src/add/test_add.py index 8347c556..9a8ebe97 100644 --- a/src/add/test_add.py +++ b/src/add/test_add.py @@ -120,6 +120,7 @@ def run_test(dut, stimulus_a, stimulus_b): sys.exit(0) def testbench(dut): + yield from check_case(dut, 0x82471f51, 0x243985f, 0x801c3790) yield from check_case(dut, 0, 0, 0) yield from check_case(dut, 0x40000000, 0xc0000000, 0x00000000) yield from check_case(dut, 0x3F800000, 0x40000000, 0x40400000)