From 065515c76c0b87183c840d6dc655f8db227bcb03 Mon Sep 17 00:00:00 2001 From: JF Bastien Date: Sat, 17 Oct 2015 00:12:29 +0000 Subject: [PATCH] WebAssembly: fix the syntax for comparisons Summary: It has also slightly changed. Reviewers: binji Subscribers: jfb, dschuff, llvm-commits, sunfish Differential Revision: http://reviews.llvm.org/D13837 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250591 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../WebAssembly/WebAssemblyInstrInteger.td | 16 ++++++++-------- test/CodeGen/WebAssembly/comparisons_i32.ll | 16 ++++++++-------- test/CodeGen/WebAssembly/comparisons_i64.ll | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/Target/WebAssembly/WebAssemblyInstrInteger.td b/lib/Target/WebAssembly/WebAssemblyInstrInteger.td index 073b261ef09..b62cdaeb393 100644 --- a/lib/Target/WebAssembly/WebAssemblyInstrInteger.td +++ b/lib/Target/WebAssembly/WebAssemblyInstrInteger.td @@ -28,14 +28,14 @@ defm SHR_S : BinaryInt; defm EQ : ComparisonInt; defm NE : ComparisonInt; -defm SLT : ComparisonInt; -defm SLE : ComparisonInt; -defm ULT : ComparisonInt; -defm ULE : ComparisonInt; -defm SGT : ComparisonInt; -defm SGE : ComparisonInt; -defm UGT : ComparisonInt; -defm UGE : ComparisonInt; +defm LT_S : ComparisonInt; +defm LE_S : ComparisonInt; +defm LT_U : ComparisonInt; +defm LE_U : ComparisonInt; +defm GT_S : ComparisonInt; +defm GE_S : ComparisonInt; +defm GT_U : ComparisonInt; +defm GE_U : ComparisonInt; defm CLZ : UnaryInt; defm CTZ : UnaryInt; diff --git a/test/CodeGen/WebAssembly/comparisons_i32.ll b/test/CodeGen/WebAssembly/comparisons_i32.ll index a8b6246114c..c47bcdf0176 100644 --- a/test/CodeGen/WebAssembly/comparisons_i32.ll +++ b/test/CodeGen/WebAssembly/comparisons_i32.ll @@ -33,7 +33,7 @@ define i32 @ne_i32(i32 %x, i32 %y) { } ; CHECK-LABEL: slt_i32: -; CHECK: slt (get_local 3), (get_local 2){{$}} +; CHECK: i32.lt_s (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @slt_i32(i32 %x, i32 %y) { %a = icmp slt i32 %x, %y @@ -42,7 +42,7 @@ define i32 @slt_i32(i32 %x, i32 %y) { } ; CHECK-LABEL: sle_i32: -; CHECK: sle (get_local 3), (get_local 2){{$}} +; CHECK: i32.le_s (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @sle_i32(i32 %x, i32 %y) { %a = icmp sle i32 %x, %y @@ -51,7 +51,7 @@ define i32 @sle_i32(i32 %x, i32 %y) { } ; CHECK-LABEL: ult_i32: -; CHECK: ult (get_local 3), (get_local 2){{$}} +; CHECK: i32.lt_u (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @ult_i32(i32 %x, i32 %y) { %a = icmp ult i32 %x, %y @@ -60,7 +60,7 @@ define i32 @ult_i32(i32 %x, i32 %y) { } ; CHECK-LABEL: ule_i32: -; CHECK: ule (get_local 3), (get_local 2){{$}} +; CHECK: i32.le_u (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @ule_i32(i32 %x, i32 %y) { %a = icmp ule i32 %x, %y @@ -69,7 +69,7 @@ define i32 @ule_i32(i32 %x, i32 %y) { } ; CHECK-LABEL: sgt_i32: -; CHECK: sgt (get_local 3), (get_local 2){{$}} +; CHECK: i32.gt_s (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @sgt_i32(i32 %x, i32 %y) { %a = icmp sgt i32 %x, %y @@ -78,7 +78,7 @@ define i32 @sgt_i32(i32 %x, i32 %y) { } ; CHECK-LABEL: sge_i32: -; CHECK: sge (get_local 3), (get_local 2){{$}} +; CHECK: i32.ge_s (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @sge_i32(i32 %x, i32 %y) { %a = icmp sge i32 %x, %y @@ -87,7 +87,7 @@ define i32 @sge_i32(i32 %x, i32 %y) { } ; CHECK-LABEL: ugt_i32: -; CHECK: ugt (get_local 3), (get_local 2){{$}} +; CHECK: i32.gt_u (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @ugt_i32(i32 %x, i32 %y) { %a = icmp ugt i32 %x, %y @@ -96,7 +96,7 @@ define i32 @ugt_i32(i32 %x, i32 %y) { } ; CHECK-LABEL: uge_i32: -; CHECK: uge (get_local 3), (get_local 2){{$}} +; CHECK: i32.ge_u (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @uge_i32(i32 %x, i32 %y) { %a = icmp uge i32 %x, %y diff --git a/test/CodeGen/WebAssembly/comparisons_i64.ll b/test/CodeGen/WebAssembly/comparisons_i64.ll index 1050bcc2173..d8d9a295e65 100644 --- a/test/CodeGen/WebAssembly/comparisons_i64.ll +++ b/test/CodeGen/WebAssembly/comparisons_i64.ll @@ -33,7 +33,7 @@ define i32 @ne_i64(i64 %x, i64 %y) { } ; CHECK-LABEL: slt_i64: -; CHECK: slt (get_local 3), (get_local 2){{$}} +; CHECK: i64.lt_s (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @slt_i64(i64 %x, i64 %y) { %a = icmp slt i64 %x, %y @@ -42,7 +42,7 @@ define i32 @slt_i64(i64 %x, i64 %y) { } ; CHECK-LABEL: sle_i64: -; CHECK: sle (get_local 3), (get_local 2){{$}} +; CHECK: i64.le_s (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @sle_i64(i64 %x, i64 %y) { %a = icmp sle i64 %x, %y @@ -51,7 +51,7 @@ define i32 @sle_i64(i64 %x, i64 %y) { } ; CHECK-LABEL: ult_i64: -; CHECK: ult (get_local 3), (get_local 2){{$}} +; CHECK: i64.lt_u (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @ult_i64(i64 %x, i64 %y) { %a = icmp ult i64 %x, %y @@ -60,7 +60,7 @@ define i32 @ult_i64(i64 %x, i64 %y) { } ; CHECK-LABEL: ule_i64: -; CHECK: ule (get_local 3), (get_local 2){{$}} +; CHECK: i64.le_u (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @ule_i64(i64 %x, i64 %y) { %a = icmp ule i64 %x, %y @@ -69,7 +69,7 @@ define i32 @ule_i64(i64 %x, i64 %y) { } ; CHECK-LABEL: sgt_i64: -; CHECK: sgt (get_local 3), (get_local 2){{$}} +; CHECK: i64.gt_s (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @sgt_i64(i64 %x, i64 %y) { %a = icmp sgt i64 %x, %y @@ -78,7 +78,7 @@ define i32 @sgt_i64(i64 %x, i64 %y) { } ; CHECK-LABEL: sge_i64: -; CHECK: sge (get_local 3), (get_local 2){{$}} +; CHECK: i64.ge_s (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @sge_i64(i64 %x, i64 %y) { %a = icmp sge i64 %x, %y @@ -87,7 +87,7 @@ define i32 @sge_i64(i64 %x, i64 %y) { } ; CHECK-LABEL: ugt_i64: -; CHECK: ugt (get_local 3), (get_local 2){{$}} +; CHECK: i64.gt_u (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @ugt_i64(i64 %x, i64 %y) { %a = icmp ugt i64 %x, %y @@ -96,7 +96,7 @@ define i32 @ugt_i64(i64 %x, i64 %y) { } ; CHECK-LABEL: uge_i64: -; CHECK: uge (get_local 3), (get_local 2){{$}} +; CHECK: i64.ge_u (get_local 3), (get_local 2){{$}} ; CHECK-NEXT: set_local 4, pop{{$}} define i32 @uge_i64(i64 %x, i64 %y) { %a = icmp uge i64 %x, %y -- 2.34.1