add F2Int f64 i64 test
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 28 Jul 2019 19:27:42 +0000 (20:27 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 28 Jul 2019 19:27:42 +0000 (20:27 +0100)
src/ieee754/fcvt/test/test_fcvt_f2int_pipe.py

index dc48b402e88309c5069ffc030845a1d5488d0697..bac4824da772b92735b588de5f8fcf3ea63f38df 100644 (file)
@@ -48,6 +48,9 @@ def fcvt_f16_i16(x):
 def fcvt_f32_i32(x):
     return sfpy.float.f32_to_i32(x) & 0xffffffff
 
+def fcvt_f64_i64(x):
+    return sfpy.float.f64_to_i64(x) & 0xffffffffffffffff
+
 
 ######################
 # signed int to fp
@@ -70,6 +73,11 @@ def test_int_pipe_i32_f32():
     runfp(dut, 32, "test_fcvt_int_pipe_i32_f32", to_int32, fcvt_i32_f32, True,
           n_vals=100, opcode=0x1)
 
+def test_int_pipe_f64_i64():
+    dut = FPCVTF2IntMuxInOut(64, 64, 4, op_wid=1)
+    runfp(dut, 64, "test_fcvt_f2int_pipe_f64_i64", Float64, fcvt_f64_i64,
+                True, n_vals=100, opcode=0x1)
+
 def test_int_pipe_f32_i32():
     dut = FPCVTF2IntMuxInOut(32, 32, 4, op_wid=1)
     runfp(dut, 32, "test_fcvt_f2int_pipe_f32_i32", Float32, fcvt_f32_i32,
@@ -139,6 +147,7 @@ if __name__ == '__main__':
     for i in range(200):
         test_int_pipe_f16_i16()
         test_int_pipe_f32_i32()
+        test_int_pipe_f64_i64()
         continue
         test_int_pipe_f64_ui64()
         test_int_pipe_f32_ui32()