defm IOR : BinaryInt<or>;
defm XOR : BinaryInt<xor>;
defm SHL : BinaryInt<shl>;
-defm SHR : BinaryInt<srl>;
-defm SAR : BinaryInt<sra>;
+defm SHR_U : BinaryInt<srl>;
+defm SHR_S : BinaryInt<sra>;
defm EQ : ComparisonInt<SETEQ>;
defm NE : ComparisonInt<SETNE>;
; CHECK-NEXT: (param i32) (param i32) (result i32)
; CHECK-NEXT: (setlocal @0 (argument 1))
; CHECK-NEXT: (setlocal @1 (argument 0))
-; CHECK-NEXT: (setlocal @2 (shr @1 @0))
+; CHECK-NEXT: (setlocal @2 (shr_u @1 @0))
; CHECK-NEXT: (return @2)
define i32 @shr32(i32 %x, i32 %y) {
%a = lshr i32 %x, %y
; CHECK-NEXT: (param i32) (param i32) (result i32)
; CHECK-NEXT: (setlocal @0 (argument 1))
; CHECK-NEXT: (setlocal @1 (argument 0))
-; CHECK-NEXT: (setlocal @2 (sar @1 @0))
+; CHECK-NEXT: (setlocal @2 (shr_s @1 @0))
; CHECK-NEXT: (return @2)
define i32 @sar32(i32 %x, i32 %y) {
%a = ashr i32 %x, %y
; CHECK-NEXT: (param i64) (param i64) (result i64)
; CHECK-NEXT: (setlocal @0 (argument 1))
; CHECK-NEXT: (setlocal @1 (argument 0))
-; CHECK-NEXT: (setlocal @2 (shr @1 @0))
+; CHECK-NEXT: (setlocal @2 (shr_u @1 @0))
; CHECK-NEXT: (return @2)
define i64 @shr64(i64 %x, i64 %y) {
%a = lshr i64 %x, %y
; CHECK-NEXT: (param i64) (param i64) (result i64)
; CHECK-NEXT: (setlocal @0 (argument 1))
; CHECK-NEXT: (setlocal @1 (argument 0))
-; CHECK-NEXT: (setlocal @2 (sar @1 @0))
+; CHECK-NEXT: (setlocal @2 (shr_s @1 @0))
; CHECK-NEXT: (return @2)
define i64 @sar64(i64 %x, i64 %y) {
%a = ashr i64 %x, %y
; CHECK: (setlocal @1 (load_zx_i8_i32 @0))
; CHECK-NEXT: (setlocal @2 (immediate 31))
; CHECK-NEXT: (setlocal @3 (shl @1 @2))
-; CHECK-NEXT: (setlocal @4 (sar @3 @2))
+; CHECK-NEXT: (setlocal @4 (shr_s @3 @2))
; CHECK-NEXT: (return @4)
define i32 @load_signed_i1_i32(i1* %p) {
%v = load i1, i1* %p
; CHECK: (setlocal @1 (load_zx_i8_i64 @0))
; CHECK-NEXT: (setlocal @2 (immediate 63))
; CHECK-NEXT: (setlocal @3 (shl @1 @2))
-; CHECK-NEXT: (setlocal @4 (sar @3 @2))
+; CHECK-NEXT: (setlocal @4 (shr_s @3 @2))
; CHECK-NEXT: (return @4)
define i64 @load_signed_i1_i64(i1* %p) {
%v = load i1, i1* %p