From c55c5e0506f78038ababe5fbf94ff114a9913516 Mon Sep 17 00:00:00 2001 From: Kasey Carrothers Date: Sat, 23 Jan 2021 18:03:06 -0800 Subject: [PATCH 1/2] Add additional tests for icmp-i128. Fixes #1136. Tests added: * eq with nonzero values * gt with nonzero values * ge with nonzero values --- .../filetests/isa/x86/icmp-i128.clif | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/cranelift/filetests/filetests/isa/x86/icmp-i128.clif b/cranelift/filetests/filetests/isa/x86/icmp-i128.clif index dce0e1db87..789fcc6ea3 100644 --- a/cranelift/filetests/filetests/isa/x86/icmp-i128.clif +++ b/cranelift/filetests/filetests/isa/x86/icmp-i128.clif @@ -50,3 +50,45 @@ block0: } ; run + +function %test_icmp_nz_eq_i128() -> b1 { +block0: + v11 = iconst.i64 0x1 + v12 = iconst.i64 0x1 + v1 = iconcat v11, v12 + v21 = iconst.i64 0x1 + v22 = iconst.i64 0x1 + v2 = iconcat v21, v22 + v10 = icmp.i128 eq v1, v2 + return v10 +} + +; run + +function %test_icmp_nz_gt_i128() -> b1 { +block0: + v11 = iconst.i64 0x1 + v12 = iconst.i64 0x1 + v1 = iconcat v11, v12 + v21 = iconst.i64 0x1 + v22 = iconst.i64 0x2 + v2 = iconcat v21, v22 + v10 = icmp.i128 ugt v2, v1 + return v10 +} + +; run + +function %test_icmp_nz_ge_i128() -> b1 { +block0: + v11 = iconst.i64 0x1 + v12 = iconst.i64 0x1 + v1 = iconcat v11, v12 + v21 = iconst.i64 0x1 + v22 = iconst.i64 0x1 + v2 = iconcat v21, v22 + v10 = icmp.i128 uge v1, v2 + return v10 +} + +; run From c6c5fe48b6209f61c0aecc6b618027899b0809db Mon Sep 17 00:00:00 2001 From: Kasey Carrothers Date: Sun, 24 Jan 2021 22:18:21 -0800 Subject: [PATCH 2/2] Add i128.icmp run tests for the x64 backend. --- .../filetests/isa/x64/icmp-i128-run.clif | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 cranelift/filetests/filetests/isa/x64/icmp-i128-run.clif diff --git a/cranelift/filetests/filetests/isa/x64/icmp-i128-run.clif b/cranelift/filetests/filetests/isa/x64/icmp-i128-run.clif new file mode 100644 index 0000000000..2f9e2d5331 --- /dev/null +++ b/cranelift/filetests/filetests/isa/x64/icmp-i128-run.clif @@ -0,0 +1,95 @@ +test run +target x86_64 +feature "experimental_x64" + +function %test_icmp_eq_i128() -> b1 { +block0: + v11 = iconst.i64 0x0 + v12 = iconst.i64 0x0 + v1 = iconcat v11, v12 + v21 = iconst.i64 0x0 + v22 = iconst.i64 0x0 + v2 = iconcat v21, v22 + v10 = icmp.i128 eq v1, v2 + return v10 +} + +; run + +function %test_icmp_imm_eq_i128() -> b1 { +block0: + v11 = iconst.i64 0x0 + v12 = iconst.i64 0x0 + v1 = iconcat v11, v12 + v10 = icmp_imm.i128 eq v1, 0x0 + return v10 +} + +; run + +function %test_icmp_ne_i128() -> b1 { +block0: + v11 = iconst.i64 0x0 + v12 = iconst.i64 0x0 + v1 = iconcat v11, v12 + v21 = iconst.i64 0x0 + v22 = iconst.i64 0x1 + v2 = iconcat v21, v22 + v10 = icmp.i128 ne v1, v2 + return v10 +} + +; run + +function %test_icmp_imm_ne_i128() -> b1 { +block0: + v11 = iconst.i64 0x0 + v12 = iconst.i64 0x0 + v1 = iconcat v11, v12 + v10 = icmp_imm.i128 ne v1, 0x1 + return v10 +} + +; run + +function %test_icmp_nz_eq_i128() -> b1 { +block0: + v11 = iconst.i64 0x1 + v12 = iconst.i64 0x1 + v1 = iconcat v11, v12 + v21 = iconst.i64 0x1 + v22 = iconst.i64 0x1 + v2 = iconcat v21, v22 + v10 = icmp.i128 eq v1, v2 + return v10 +} + +; run + +function %test_icmp_nz_gt_i128() -> b1 { +block0: + v11 = iconst.i64 0x1 + v12 = iconst.i64 0x1 + v1 = iconcat v11, v12 + v21 = iconst.i64 0x1 + v22 = iconst.i64 0x2 + v2 = iconcat v21, v22 + v10 = icmp.i128 ugt v2, v1 + return v10 +} + +; run + +function %test_icmp_nz_ge_i128() -> b1 { +block0: + v11 = iconst.i64 0x1 + v12 = iconst.i64 0x1 + v1 = iconcat v11, v12 + v21 = iconst.i64 0x1 + v22 = iconst.i64 0x1 + v2 = iconcat v21, v22 + v10 = icmp.i128 uge v1, v2 + return v10 +} + +; run