1 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
3 ; CHECK-DAG: OpName [[EQ:%.*]] "test_eq"
4 ; CHECK-DAG: OpName [[NE:%.*]] "test_ne"
5 ; CHECK-DAG: OpName [[ULT:%.*]] "test_ult"
6 ; CHECK-DAG: OpName [[SLT:%.*]] "test_slt"
7 ; CHECK-DAG: OpName [[ULE:%.*]] "test_ule"
8 ; CHECK-DAG: OpName [[SLE:%.*]] "test_sle"
9 ; CHECK-DAG: OpName [[UGT:%.*]] "test_ugt"
10 ; CHECK-DAG: OpName [[SGT:%.*]] "test_sgt"
11 ; CHECK-DAG: OpName [[UGE:%.*]] "test_uge"
12 ; CHECK-DAG: OpName [[SGE:%.*]] "test_sge"
14 ; CHECK-DAG: OpName [[v3EQ:%.*]] "test_v3_eq"
15 ; CHECK-DAG: OpName [[v3NE:%.*]] "test_v3_ne"
16 ; CHECK-DAG: OpName [[v3ULT:%.*]] "test_v3_ult"
17 ; CHECK-DAG: OpName [[v3SLT:%.*]] "test_v3_slt"
18 ; CHECK-DAG: OpName [[v3ULE:%.*]] "test_v3_ule"
19 ; CHECK-DAG: OpName [[v3SLE:%.*]] "test_v3_sle"
20 ; CHECK-DAG: OpName [[v3UGT:%.*]] "test_v3_ugt"
21 ; CHECK-DAG: OpName [[v3SGT:%.*]] "test_v3_sgt"
22 ; CHECK-DAG: OpName [[v3UGE:%.*]] "test_v3_uge"
23 ; CHECK-DAG: OpName [[v3SGE:%.*]] "test_v3_sge"
25 ; CHECK: [[EQ]] = OpFunction
26 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
27 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
29 ; CHECK-NEXT: [[R:%.*]] = OpIEqual {{%.+}} [[A]] [[B]]
30 ; CHECK-NEXT: OpReturnValue [[R]]
31 ; CHECK-NEXT: OpFunctionEnd
32 define i1 @test_eq(i32 %a, i32 %b) {
33 %r = icmp eq i32 %a, %b
37 ; CHECK: [[NE]] = OpFunction
38 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
39 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
41 ; CHECK-NEXT: [[R:%.*]] = OpINotEqual {{%.+}} [[A]] [[B]]
42 ; CHECK-NEXT: OpReturnValue [[R]]
43 ; CHECK-NEXT: OpFunctionEnd
44 define i1 @test_ne(i32 %a, i32 %b) {
45 %r = icmp ne i32 %a, %b
49 ; CHECK: [[SLT]] = OpFunction
50 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
51 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
53 ; CHECK-NEXT: [[R:%.*]] = OpSLessThan {{%.+}} [[A]] [[B]]
54 ; CHECK-NEXT: OpReturnValue [[R]]
55 ; CHECK-NEXT: OpFunctionEnd
56 define i1 @test_slt(i32 %a, i32 %b) {
57 %r = icmp slt i32 %a, %b
61 ; CHECK: [[ULT]] = OpFunction
62 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
63 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
65 ; CHECK-NEXT: [[R:%.*]] = OpULessThan {{%.+}} [[A]] [[B]]
66 ; CHECK-NEXT: OpReturnValue [[R]]
67 ; CHECK-NEXT: OpFunctionEnd
68 define i1 @test_ult(i32 %a, i32 %b) {
69 %r = icmp ult i32 %a, %b
73 ; CHECK: [[ULE]] = OpFunction
74 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
75 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
77 ; CHECK-NEXT: [[R:%.*]] = OpULessThanEqual {{%.+}} [[A]] [[B]]
78 ; CHECK-NEXT: OpReturnValue [[R]]
79 ; CHECK-NEXT: OpFunctionEnd
80 define i1 @test_ule(i32 %a, i32 %b) {
81 %r = icmp ule i32 %a, %b
85 ; CHECK: [[SLE]] = OpFunction
86 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
87 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
89 ; CHECK-NEXT: [[R:%.*]] = OpSLessThanEqual {{%.+}} [[A]] [[B]]
90 ; CHECK-NEXT: OpReturnValue [[R]]
91 ; CHECK-NEXT: OpFunctionEnd
92 define i1 @test_sle(i32 %a, i32 %b) {
93 %r = icmp sle i32 %a, %b
97 ; CHECK: [[UGT]] = OpFunction
98 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
99 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
100 ; CHECK-NEXT: OpLabel
101 ; CHECK-NEXT: [[R:%.*]] = OpUGreaterThan {{%.+}} [[A]] [[B]]
102 ; CHECK-NEXT: OpReturnValue [[R]]
103 ; CHECK-NEXT: OpFunctionEnd
104 define i1 @test_ugt(i32 %a, i32 %b) {
105 %r = icmp ugt i32 %a, %b
109 ; CHECK: [[SGT]] = OpFunction
110 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
111 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
112 ; CHECK-NEXT: OpLabel
113 ; CHECK-NEXT: [[R:%.*]] = OpSGreaterThan {{%.+}} [[A]] [[B]]
114 ; CHECK-NEXT: OpReturnValue [[R]]
115 ; CHECK-NEXT: OpFunctionEnd
116 define i1 @test_sgt(i32 %a, i32 %b) {
117 %r = icmp sgt i32 %a, %b
121 ; CHECK: [[UGE]] = OpFunction
122 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
123 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
124 ; CHECK-NEXT: OpLabel
125 ; CHECK-NEXT: [[R:%.*]] = OpUGreaterThanEqual {{%.+}} [[A]] [[B]]
126 ; CHECK-NEXT: OpReturnValue [[R]]
127 ; CHECK-NEXT: OpFunctionEnd
128 define i1 @test_uge(i32 %a, i32 %b) {
129 %r = icmp uge i32 %a, %b
133 ; CHECK: [[SGE]] = OpFunction
134 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
135 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
136 ; CHECK-NEXT: OpLabel
137 ; CHECK-NEXT: [[R:%.*]] = OpSGreaterThanEqual {{%.+}} [[A]] [[B]]
138 ; CHECK-NEXT: OpReturnValue [[R]]
139 ; CHECK-NEXT: OpFunctionEnd
140 define i1 @test_sge(i32 %a, i32 %b) {
141 %r = icmp sge i32 %a, %b
145 ; CHECK: [[v3EQ]] = OpFunction
146 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
147 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
148 ; CHECK-NEXT: OpLabel
149 ; CHECK-NEXT: [[R:%.*]] = OpIEqual {{%.+}} [[A]] [[B]]
150 ; CHECK-NEXT: OpReturnValue [[R]]
151 ; CHECK-NEXT: OpFunctionEnd
152 define <3 x i1> @test_v3_eq(<3 x i32> %a, <3 x i32> %b) {
153 %r = icmp eq <3 x i32> %a, %b
157 ; CHECK: [[v3NE]] = OpFunction
158 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
159 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
160 ; CHECK-NEXT: OpLabel
161 ; CHECK-NEXT: [[R:%.*]] = OpINotEqual {{%.+}} [[A]] [[B]]
162 ; CHECK-NEXT: OpReturnValue [[R]]
163 ; CHECK-NEXT: OpFunctionEnd
164 define <3 x i1> @test_v3_ne(<3 x i32> %a, <3 x i32> %b) {
165 %r = icmp ne <3 x i32> %a, %b
169 ; CHECK: [[v3SLT]] = OpFunction
170 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
171 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
172 ; CHECK-NEXT: OpLabel
173 ; CHECK-NEXT: [[R:%.*]] = OpSLessThan {{%.+}} [[A]] [[B]]
174 ; CHECK-NEXT: OpReturnValue [[R]]
175 ; CHECK-NEXT: OpFunctionEnd
176 define <3 x i1> @test_v3_slt(<3 x i32> %a, <3 x i32> %b) {
177 %r = icmp slt <3 x i32> %a, %b
181 ; CHECK: [[v3ULT]] = OpFunction
182 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
183 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
184 ; CHECK-NEXT: OpLabel
185 ; CHECK-NEXT: [[R:%.*]] = OpULessThan {{%.+}} [[A]] [[B]]
186 ; CHECK-NEXT: OpReturnValue [[R]]
187 ; CHECK-NEXT: OpFunctionEnd
188 define <3 x i1> @test_v3_ult(<3 x i32> %a, <3 x i32> %b) {
189 %r = icmp ult <3 x i32> %a, %b
193 ; CHECK: [[v3ULE]] = OpFunction
194 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
195 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
196 ; CHECK-NEXT: OpLabel
197 ; CHECK-NEXT: [[R:%.*]] = OpULessThanEqual {{%.+}} [[A]] [[B]]
198 ; CHECK-NEXT: OpReturnValue [[R]]
199 ; CHECK-NEXT: OpFunctionEnd
200 define <3 x i1> @test_v3_ule(<3 x i32> %a, <3 x i32> %b) {
201 %r = icmp ule <3 x i32> %a, %b
205 ; CHECK: [[v3SLE]] = OpFunction
206 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
207 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
208 ; CHECK-NEXT: OpLabel
209 ; CHECK-NEXT: [[R:%.*]] = OpSLessThanEqual {{%.+}} [[A]] [[B]]
210 ; CHECK-NEXT: OpReturnValue [[R]]
211 ; CHECK-NEXT: OpFunctionEnd
212 define <3 x i1> @test_v3_sle(<3 x i32> %a, <3 x i32> %b) {
213 %r = icmp sle <3 x i32> %a, %b
217 ; CHECK: [[v3UGT]] = OpFunction
218 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
219 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
220 ; CHECK-NEXT: OpLabel
221 ; CHECK-NEXT: [[R:%.*]] = OpUGreaterThan {{%.+}} [[A]] [[B]]
222 ; CHECK-NEXT: OpReturnValue [[R]]
223 ; CHECK-NEXT: OpFunctionEnd
224 define <3 x i1> @test_v3_ugt(<3 x i32> %a, <3 x i32> %b) {
225 %r = icmp ugt <3 x i32> %a, %b
229 ; CHECK: [[v3SGT]] = OpFunction
230 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
231 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
232 ; CHECK-NEXT: OpLabel
233 ; CHECK-NEXT: [[R:%.*]] = OpSGreaterThan {{%.+}} [[A]] [[B]]
234 ; CHECK-NEXT: OpReturnValue [[R]]
235 ; CHECK-NEXT: OpFunctionEnd
236 define <3 x i1> @test_v3_sgt(<3 x i32> %a, <3 x i32> %b) {
237 %r = icmp sgt <3 x i32> %a, %b
241 ; CHECK: [[v3UGE]] = OpFunction
242 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
243 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
244 ; CHECK-NEXT: OpLabel
245 ; CHECK-NEXT: [[R:%.*]] = OpUGreaterThanEqual {{%.+}} [[A]] [[B]]
246 ; CHECK-NEXT: OpReturnValue [[R]]
247 ; CHECK-NEXT: OpFunctionEnd
248 define <3 x i1> @test_v3_uge(<3 x i32> %a, <3 x i32> %b) {
249 %r = icmp uge <3 x i32> %a, %b
253 ; CHECK: [[v3SGE]] = OpFunction
254 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
255 ; CHECK-NEXT: [[B:%.*]] = OpFunctionParameter
256 ; CHECK-NEXT: OpLabel
257 ; CHECK-NEXT: [[R:%.*]] = OpSGreaterThanEqual {{%.+}} [[A]] [[B]]
258 ; CHECK-NEXT: OpReturnValue [[R]]
259 ; CHECK-NEXT: OpFunctionEnd
260 define <3 x i1> @test_v3_sge(<3 x i32> %a, <3 x i32> %b) {
261 %r = icmp sge <3 x i32> %a, %b