From d8d39c8c9d6ba8d62a3fd2702e33edb2f4b12267 Mon Sep 17 00:00:00 2001 From: Johnnie Birch <45402135+jlb6740@users.noreply.github.com> Date: Mon, 26 Oct 2020 17:12:50 -0700 Subject: [PATCH] Add filetests for fcvt_from_sint.f32x4 Add portions of filetests simd-conversion-legalize.clif and simd-conversion-run.clif that test fcvt_from_sint.f32x4 --- .../isa/x64/simd-conversion-run.clif | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 cranelift/filetests/filetests/isa/x64/simd-conversion-run.clif diff --git a/cranelift/filetests/filetests/isa/x64/simd-conversion-run.clif b/cranelift/filetests/filetests/isa/x64/simd-conversion-run.clif new file mode 100644 index 000000000000..3e33b27670d0 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/simd-conversion-run.clif @@ -0,0 +1,25 @@ +test run +set enable_simd +target x86_64 +feature "experimental_x64" + +function %fcvt_from_sint() -> b1 { +block0: + v0 = vconst.i32x4 [-1 0 1 123456789] + v1 = fcvt_from_sint.f32x4 v0 + + v2 = vconst.f32x4 [-0x1.0 0.0 0x1.0 0x75bcd18.0] ; 123456789 rounds to 123456792.0, an error of 3 + v3 = fcmp eq v1, v2 + v4 = vall_true v3 + return v4 +} +; run + +function %fcvt_to_sint_sat(f32x4) -> i32x4 { +block0(v0:f32x4): + v1 = fcvt_to_sint_sat.i32x4 v0 + return v1 +} +; run: %fcvt_to_sint_sat([0x0.0 -0x1.0 0x1.0 0x1.0p100]) == [0 -1 1 0x7FFFFFFF] +; run: %fcvt_to_sint_sat([-0x8.1 0x0.0 0x0.0 -0x1.0p100]) == [-8 0 0 0x80000000] +