add fp cvt 64-16 test
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 8 Jul 2019 13:29:24 +0000 (14:29 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 8 Jul 2019 13:29:24 +0000 (14:29 +0100)
src/ieee754/fcvt/test/fcvt_data_64_16.py [new file with mode: 0644]
src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py [new file with mode: 0644]

diff --git a/src/ieee754/fcvt/test/fcvt_data_64_16.py b/src/ieee754/fcvt/test/fcvt_data_64_16.py
new file mode 100644 (file)
index 0000000..db9f23d
--- /dev/null
@@ -0,0 +1,4 @@
+def regressions():
+    yield 0x9885020648d8c0e8,
+    yield 0x9885020648d8c0e8,
+
diff --git a/src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py b/src/ieee754/fcvt/test/test_fcvt_pipe_64_16.py
new file mode 100644 (file)
index 0000000..8bd001f
--- /dev/null
@@ -0,0 +1,21 @@
+""" test of FPCVTMuxInOut
+"""
+
+from ieee754.fcvt.pipeline import (FPCVTMuxInOut,)
+from ieee754.fpcommon.test.case_gen import run_pipe_fp
+from ieee754.fpcommon.test import unit_test_single
+from ieee754.fcvt.test.fcvt_data_64_16 import regressions
+
+from sfpy import Float64, Float16
+
+def fcvt_16(x):
+    return Float16(x)
+
+def test_pipe_fp64_16():
+    dut = FPCVTMuxInOut(64, 16, 4)
+    run_pipe_fp(dut, 64, "add", unit_test_single, Float64,
+                regressions, fcvt_16, 10, True)
+
+if __name__ == '__main__':
+    test_pipe_fp64_16()
+