[llvm] r250591 - WebAssembly: fix the syntax for comparisons

JF Bastien via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 17:12:30 PDT 2015


Author: jfb
Date: Fri Oct 16 19:12:29 2015
New Revision: 250591

URL: http://llvm.org/viewvc/llvm-project?rev=250591&view=rev
Log:
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

Modified:
    llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrInteger.td
    llvm/trunk/test/CodeGen/WebAssembly/comparisons_i32.ll
    llvm/trunk/test/CodeGen/WebAssembly/comparisons_i64.ll

Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrInteger.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrInteger.td?rev=250591&r1=250590&r2=250591&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrInteger.td (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrInteger.td Fri Oct 16 19:12:29 2015
@@ -28,14 +28,14 @@ defm SHR_S : BinaryInt<sra>;
 
 defm EQ : ComparisonInt<SETEQ>;
 defm NE : ComparisonInt<SETNE>;
-defm SLT : ComparisonInt<SETLT>;
-defm SLE : ComparisonInt<SETLE>;
-defm ULT : ComparisonInt<SETULT>;
-defm ULE : ComparisonInt<SETULE>;
-defm SGT : ComparisonInt<SETGT>;
-defm SGE : ComparisonInt<SETGE>;
-defm UGT : ComparisonInt<SETUGT>;
-defm UGE : ComparisonInt<SETUGE>;
+defm LT_S : ComparisonInt<SETLT>;
+defm LE_S : ComparisonInt<SETLE>;
+defm LT_U : ComparisonInt<SETULT>;
+defm LE_U : ComparisonInt<SETULE>;
+defm GT_S : ComparisonInt<SETGT>;
+defm GE_S : ComparisonInt<SETGE>;
+defm GT_U : ComparisonInt<SETUGT>;
+defm GE_U : ComparisonInt<SETUGE>;
 
 defm CLZ : UnaryInt<ctlz>;
 defm CTZ : UnaryInt<cttz>;

Modified: llvm/trunk/test/CodeGen/WebAssembly/comparisons_i32.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/comparisons_i32.ll?rev=250591&r1=250590&r2=250591&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/comparisons_i32.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/comparisons_i32.ll Fri Oct 16 19:12:29 2015
@@ -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

Modified: llvm/trunk/test/CodeGen/WebAssembly/comparisons_i64.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/comparisons_i64.ll?rev=250591&r1=250590&r2=250591&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/comparisons_i64.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/comparisons_i64.ll Fri Oct 16 19:12:29 2015
@@ -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




More information about the llvm-commits mailing list