1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc < %s -wasm-keep-registers | FileCheck %s
4 target triple = "wasm32-unknown-unknown"
6 define i8 @ucmp.8.8(i8 zeroext %x, i8 zeroext %y) nounwind {
7 ; CHECK-LABEL: ucmp.8.8:
8 ; CHECK: .functype ucmp.8.8 (i32, i32) -> (i32)
10 ; CHECK-NEXT: local.get $push4=, 0
11 ; CHECK-NEXT: local.get $push3=, 1
12 ; CHECK-NEXT: i32.gt_u $push1=, $pop4, $pop3
13 ; CHECK-NEXT: local.get $push6=, 0
14 ; CHECK-NEXT: local.get $push5=, 1
15 ; CHECK-NEXT: i32.lt_u $push0=, $pop6, $pop5
16 ; CHECK-NEXT: i32.sub $push2=, $pop1, $pop0
17 ; CHECK-NEXT: # fallthrough-return
18 %1 = call i8 @llvm.ucmp(i8 %x, i8 %y)
22 define i8 @ucmp.8.16(i16 zeroext %x, i16 zeroext %y) nounwind {
23 ; CHECK-LABEL: ucmp.8.16:
24 ; CHECK: .functype ucmp.8.16 (i32, i32) -> (i32)
25 ; CHECK-NEXT: # %bb.0:
26 ; CHECK-NEXT: local.get $push4=, 0
27 ; CHECK-NEXT: local.get $push3=, 1
28 ; CHECK-NEXT: i32.gt_u $push1=, $pop4, $pop3
29 ; CHECK-NEXT: local.get $push6=, 0
30 ; CHECK-NEXT: local.get $push5=, 1
31 ; CHECK-NEXT: i32.lt_u $push0=, $pop6, $pop5
32 ; CHECK-NEXT: i32.sub $push2=, $pop1, $pop0
33 ; CHECK-NEXT: # fallthrough-return
34 %1 = call i8 @llvm.ucmp(i16 %x, i16 %y)
38 define i8 @ucmp.8.32(i32 %x, i32 %y) nounwind {
39 ; CHECK-LABEL: ucmp.8.32:
40 ; CHECK: .functype ucmp.8.32 (i32, i32) -> (i32)
41 ; CHECK-NEXT: # %bb.0:
42 ; CHECK-NEXT: local.get $push4=, 0
43 ; CHECK-NEXT: local.get $push3=, 1
44 ; CHECK-NEXT: i32.gt_u $push1=, $pop4, $pop3
45 ; CHECK-NEXT: local.get $push6=, 0
46 ; CHECK-NEXT: local.get $push5=, 1
47 ; CHECK-NEXT: i32.lt_u $push0=, $pop6, $pop5
48 ; CHECK-NEXT: i32.sub $push2=, $pop1, $pop0
49 ; CHECK-NEXT: # fallthrough-return
50 %1 = call i8 @llvm.ucmp(i32 %x, i32 %y)
54 define i8 @ucmp.8.64(i64 %x, i64 %y) nounwind {
55 ; CHECK-LABEL: ucmp.8.64:
56 ; CHECK: .functype ucmp.8.64 (i64, i64) -> (i32)
57 ; CHECK-NEXT: # %bb.0:
58 ; CHECK-NEXT: local.get $push4=, 0
59 ; CHECK-NEXT: local.get $push3=, 1
60 ; CHECK-NEXT: i64.gt_u $push1=, $pop4, $pop3
61 ; CHECK-NEXT: local.get $push6=, 0
62 ; CHECK-NEXT: local.get $push5=, 1
63 ; CHECK-NEXT: i64.lt_u $push0=, $pop6, $pop5
64 ; CHECK-NEXT: i32.sub $push2=, $pop1, $pop0
65 ; CHECK-NEXT: # fallthrough-return
66 %1 = call i8 @llvm.ucmp(i64 %x, i64 %y)
70 define i8 @ucmp.8.128(i128 %x, i128 %y) nounwind {
71 ; CHECK-LABEL: ucmp.8.128:
72 ; CHECK: .functype ucmp.8.128 (i64, i64, i64, i64) -> (i32)
73 ; CHECK-NEXT: .local i32
74 ; CHECK-NEXT: # %bb.0:
75 ; CHECK-NEXT: local.get $push10=, 0
76 ; CHECK-NEXT: local.get $push9=, 2
77 ; CHECK-NEXT: i64.gt_u $push4=, $pop10, $pop9
78 ; CHECK-NEXT: local.get $push12=, 1
79 ; CHECK-NEXT: local.get $push11=, 3
80 ; CHECK-NEXT: i64.gt_u $push3=, $pop12, $pop11
81 ; CHECK-NEXT: local.get $push14=, 1
82 ; CHECK-NEXT: local.get $push13=, 3
83 ; CHECK-NEXT: i64.eq $push8=, $pop14, $pop13
84 ; CHECK-NEXT: local.tee $push7=, 4, $pop8
85 ; CHECK-NEXT: i32.select $push5=, $pop4, $pop3, $pop7
86 ; CHECK-NEXT: local.get $push16=, 0
87 ; CHECK-NEXT: local.get $push15=, 2
88 ; CHECK-NEXT: i64.lt_u $push1=, $pop16, $pop15
89 ; CHECK-NEXT: local.get $push18=, 1
90 ; CHECK-NEXT: local.get $push17=, 3
91 ; CHECK-NEXT: i64.lt_u $push0=, $pop18, $pop17
92 ; CHECK-NEXT: local.get $push19=, 4
93 ; CHECK-NEXT: i32.select $push2=, $pop1, $pop0, $pop19
94 ; CHECK-NEXT: i32.sub $push6=, $pop5, $pop2
95 ; CHECK-NEXT: # fallthrough-return
96 %1 = call i8 @llvm.ucmp(i128 %x, i128 %y)
100 define i32 @ucmp.32.32(i32 %x, i32 %y) nounwind {
101 ; CHECK-LABEL: ucmp.32.32:
102 ; CHECK: .functype ucmp.32.32 (i32, i32) -> (i32)
103 ; CHECK-NEXT: # %bb.0:
104 ; CHECK-NEXT: local.get $push4=, 0
105 ; CHECK-NEXT: local.get $push3=, 1
106 ; CHECK-NEXT: i32.gt_u $push1=, $pop4, $pop3
107 ; CHECK-NEXT: local.get $push6=, 0
108 ; CHECK-NEXT: local.get $push5=, 1
109 ; CHECK-NEXT: i32.lt_u $push0=, $pop6, $pop5
110 ; CHECK-NEXT: i32.sub $push2=, $pop1, $pop0
111 ; CHECK-NEXT: # fallthrough-return
112 %1 = call i32 @llvm.ucmp(i32 %x, i32 %y)
116 define i32 @ucmp.32.64(i64 %x, i64 %y) nounwind {
117 ; CHECK-LABEL: ucmp.32.64:
118 ; CHECK: .functype ucmp.32.64 (i64, i64) -> (i32)
119 ; CHECK-NEXT: # %bb.0:
120 ; CHECK-NEXT: local.get $push4=, 0
121 ; CHECK-NEXT: local.get $push3=, 1
122 ; CHECK-NEXT: i64.gt_u $push1=, $pop4, $pop3
123 ; CHECK-NEXT: local.get $push6=, 0
124 ; CHECK-NEXT: local.get $push5=, 1
125 ; CHECK-NEXT: i64.lt_u $push0=, $pop6, $pop5
126 ; CHECK-NEXT: i32.sub $push2=, $pop1, $pop0
127 ; CHECK-NEXT: # fallthrough-return
128 %1 = call i32 @llvm.ucmp(i64 %x, i64 %y)
132 define i64 @ucmp.64.64(i64 %x, i64 %y) nounwind {
133 ; CHECK-LABEL: ucmp.64.64:
134 ; CHECK: .functype ucmp.64.64 (i64, i64) -> (i64)
135 ; CHECK-NEXT: # %bb.0:
136 ; CHECK-NEXT: local.get $push5=, 0
137 ; CHECK-NEXT: local.get $push4=, 1
138 ; CHECK-NEXT: i64.gt_u $push1=, $pop5, $pop4
139 ; CHECK-NEXT: local.get $push7=, 0
140 ; CHECK-NEXT: local.get $push6=, 1
141 ; CHECK-NEXT: i64.lt_u $push0=, $pop7, $pop6
142 ; CHECK-NEXT: i32.sub $push2=, $pop1, $pop0
143 ; CHECK-NEXT: i64.extend_i32_s $push3=, $pop2
144 ; CHECK-NEXT: # fallthrough-return
145 %1 = call i64 @llvm.ucmp(i64 %x, i64 %y)