add fp16 mul (and some regression tests)
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 8 Jul 2019 11:33:10 +0000 (12:33 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 8 Jul 2019 11:33:10 +0000 (12:33 +0100)
src/ieee754/fpcommon/test/case_gen.py
src/ieee754/fpmul/test/mul_data16.py [new file with mode: 0644]

index cbccd923bacba27a7509bb5d1498b8da4e874720..d667f340efe3698901b1a94ad2e3b8f27e2367e4 100644 (file)
@@ -113,13 +113,13 @@ class PipeFPCase:
 
 def run_pipe_fp(dut, width, name, mod, fmod, regressions, fpfn, count):
     pc = PipeFPCase(dut, name, mod, fmod, width, fpfn, count)
+    pc.run_regressions(regressions)
+    pc.run_cornercases()
     pc.run("rand1", get_rand1)
     pc.run("n127", get_n127)
     pc.run("noncan", get_nan_noncan)
     pc.run("nearlyzero", get_nearly_zero)
     pc.run("nearlyinf", get_nearly_inf)
     pc.run("corner_rand", get_corner_rand)
-    pc.run_cornercases()
-    pc.run_regressions(regressions)
     pc.run_random()
 
diff --git a/src/ieee754/fpmul/test/mul_data16.py b/src/ieee754/fpmul/test/mul_data16.py
new file mode 100644 (file)
index 0000000..fb13fbb
--- /dev/null
@@ -0,0 +1,5 @@
+def regressions():
+    yield 0x0000, 0xfc00
+    yield 0xe7bb, 0x81ce
+    yield 0xe225, 0x8181
+    yield 0x0201, 0x4901