1 ; RUN: llc < %s -mtriple=ve | FileCheck %s
3 ;;; Test all combination of input type and output type among following types.
6 ;;; i1/i8/u8/i16/u16/i32/u32/i64/u64/i128/u128/float/double/fp128
8 ; Function Attrs: norecurse nounwind readnone
9 define zeroext i1 @select_cc_i1_i1(i1 zeroext %0, i1 zeroext %1, i1 zeroext %2, i1 zeroext %3) {
10 ; CHECK-LABEL: select_cc_i1_i1:
12 ; CHECK-NEXT: xor %s0, %s0, %s1
13 ; CHECK-NEXT: cmov.w.ne %s2, %s3, %s0
14 ; CHECK-NEXT: adds.w.zx %s0, %s2, (0)1
15 ; CHECK-NEXT: b.l.t (, %s10)
17 %6 = select i1 %5, i1 %3, i1 %2
21 ; Function Attrs: norecurse nounwind readnone
22 define zeroext i1 @select_cc_i8_i1(i8 signext %0, i8 signext %1, i1 zeroext %2, i1 zeroext %3) {
23 ; CHECK-LABEL: select_cc_i8_i1:
25 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
26 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
27 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
28 ; CHECK-NEXT: b.l.t (, %s10)
29 %5 = icmp eq i8 %0, %1
30 %6 = select i1 %5, i1 %2, i1 %3
34 ; Function Attrs: norecurse nounwind readnone
35 define zeroext i1 @select_cc_u8_i1(i8 zeroext %0, i8 zeroext %1, i1 zeroext %2, i1 zeroext %3) {
36 ; CHECK-LABEL: select_cc_u8_i1:
38 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
39 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
40 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
41 ; CHECK-NEXT: b.l.t (, %s10)
42 %5 = icmp eq i8 %0, %1
43 %6 = select i1 %5, i1 %2, i1 %3
47 ; Function Attrs: norecurse nounwind readnone
48 define zeroext i1 @select_cc_i16_i1(i16 signext %0, i16 signext %1, i1 zeroext %2, i1 zeroext %3) {
49 ; CHECK-LABEL: select_cc_i16_i1:
51 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
52 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
53 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
54 ; CHECK-NEXT: b.l.t (, %s10)
55 %5 = icmp eq i16 %0, %1
56 %6 = select i1 %5, i1 %2, i1 %3
60 ; Function Attrs: norecurse nounwind readnone
61 define zeroext i1 @select_cc_u16_i1(i16 zeroext %0, i16 zeroext %1, i1 zeroext %2, i1 zeroext %3) {
62 ; CHECK-LABEL: select_cc_u16_i1:
64 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
65 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
66 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
67 ; CHECK-NEXT: b.l.t (, %s10)
68 %5 = icmp eq i16 %0, %1
69 %6 = select i1 %5, i1 %2, i1 %3
73 ; Function Attrs: norecurse nounwind readnone
74 define zeroext i1 @select_cc_i32_i1(i32 signext %0, i32 signext %1, i1 zeroext %2, i1 zeroext %3) {
75 ; CHECK-LABEL: select_cc_i32_i1:
77 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
78 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
79 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
80 ; CHECK-NEXT: b.l.t (, %s10)
81 %5 = icmp eq i32 %0, %1
82 %6 = select i1 %5, i1 %2, i1 %3
86 ; Function Attrs: norecurse nounwind readnone
87 define zeroext i1 @select_cc_u32_i1(i32 zeroext %0, i32 zeroext %1, i1 zeroext %2, i1 zeroext %3) {
88 ; CHECK-LABEL: select_cc_u32_i1:
90 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
91 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
92 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
93 ; CHECK-NEXT: b.l.t (, %s10)
94 %5 = icmp eq i32 %0, %1
95 %6 = select i1 %5, i1 %2, i1 %3
99 ; Function Attrs: norecurse nounwind readnone
100 define zeroext i1 @select_cc_i64_i1(i64 %0, i64 %1, i1 zeroext %2, i1 zeroext %3) {
101 ; CHECK-LABEL: select_cc_i64_i1:
103 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
104 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
105 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
106 ; CHECK-NEXT: b.l.t (, %s10)
107 %5 = icmp eq i64 %0, %1
108 %6 = select i1 %5, i1 %2, i1 %3
112 ; Function Attrs: norecurse nounwind readnone
113 define zeroext i1 @select_cc_u64_i1(i64 %0, i64 %1, i1 zeroext %2, i1 zeroext %3) {
114 ; CHECK-LABEL: select_cc_u64_i1:
116 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
117 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
118 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
119 ; CHECK-NEXT: b.l.t (, %s10)
120 %5 = icmp eq i64 %0, %1
121 %6 = select i1 %5, i1 %2, i1 %3
125 ; Function Attrs: norecurse nounwind readnone
126 define zeroext i1 @select_cc_i128_i1(i128 %0, i128 %1, i1 zeroext %2, i1 zeroext %3) {
127 ; CHECK-LABEL: select_cc_i128_i1:
129 ; CHECK-NEXT: xor %s1, %s1, %s3
130 ; CHECK-NEXT: xor %s0, %s0, %s2
131 ; CHECK-NEXT: or %s0, %s0, %s1
132 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
133 ; CHECK-NEXT: adds.w.zx %s0, %s5, (0)1
134 ; CHECK-NEXT: b.l.t (, %s10)
135 %5 = icmp eq i128 %0, %1
136 %6 = select i1 %5, i1 %2, i1 %3
140 ; Function Attrs: norecurse nounwind readnone
141 define zeroext i1 @select_cc_u128_i1(i128 %0, i128 %1, i1 zeroext %2, i1 zeroext %3) {
142 ; CHECK-LABEL: select_cc_u128_i1:
144 ; CHECK-NEXT: xor %s1, %s1, %s3
145 ; CHECK-NEXT: xor %s0, %s0, %s2
146 ; CHECK-NEXT: or %s0, %s0, %s1
147 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
148 ; CHECK-NEXT: adds.w.zx %s0, %s5, (0)1
149 ; CHECK-NEXT: b.l.t (, %s10)
150 %5 = icmp eq i128 %0, %1
151 %6 = select i1 %5, i1 %2, i1 %3
155 ; Function Attrs: norecurse nounwind readnone
156 define zeroext i1 @select_cc_float_i1(float %0, float %1, i1 zeroext %2, i1 zeroext %3) {
157 ; CHECK-LABEL: select_cc_float_i1:
159 ; CHECK-NEXT: fcmp.s %s0, %s0, %s1
160 ; CHECK-NEXT: cmov.s.eq %s3, %s2, %s0
161 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
162 ; CHECK-NEXT: b.l.t (, %s10)
163 %5 = fcmp fast oeq float %0, %1
164 %6 = select i1 %5, i1 %2, i1 %3
168 ; Function Attrs: norecurse nounwind readnone
169 define zeroext i1 @select_cc_double_i1(double %0, double %1, i1 zeroext %2, i1 zeroext %3) {
170 ; CHECK-LABEL: select_cc_double_i1:
172 ; CHECK-NEXT: fcmp.d %s0, %s0, %s1
173 ; CHECK-NEXT: cmov.d.eq %s3, %s2, %s0
174 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
175 ; CHECK-NEXT: b.l.t (, %s10)
176 %5 = fcmp fast oeq double %0, %1
177 %6 = select i1 %5, i1 %2, i1 %3
181 ; Function Attrs: norecurse nounwind readnone
182 define zeroext i1 @select_cc_quad_i1(fp128 %0, fp128 %1, i1 zeroext %2, i1 zeroext %3) {
183 ; CHECK-LABEL: select_cc_quad_i1:
185 ; CHECK-NEXT: fcmp.q %s0, %s0, %s2
186 ; CHECK-NEXT: cmov.d.eq %s5, %s4, %s0
187 ; CHECK-NEXT: adds.w.zx %s0, %s5, (0)1
188 ; CHECK-NEXT: b.l.t (, %s10)
189 %5 = fcmp fast oeq fp128 %0, %1
190 %6 = select i1 %5, i1 %2, i1 %3
194 ; Function Attrs: norecurse nounwind readnone
195 define signext i8 @select_cc_i1_i8(i1 zeroext %0, i1 zeroext %1, i8 signext %2, i8 signext %3) {
196 ; CHECK-LABEL: select_cc_i1_i8:
198 ; CHECK-NEXT: xor %s0, %s0, %s1
199 ; CHECK-NEXT: cmov.w.ne %s2, %s3, %s0
200 ; CHECK-NEXT: adds.w.sx %s0, %s2, (0)1
201 ; CHECK-NEXT: b.l.t (, %s10)
203 %6 = select i1 %5, i8 %3, i8 %2
207 ; Function Attrs: norecurse nounwind readnone
208 define signext i8 @select_cc_i8_i8(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
209 ; CHECK-LABEL: select_cc_i8_i8:
211 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
212 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
213 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
214 ; CHECK-NEXT: b.l.t (, %s10)
215 %5 = icmp eq i8 %0, %1
216 %6 = select i1 %5, i8 %2, i8 %3
220 ; Function Attrs: norecurse nounwind readnone
221 define signext i8 @select_cc_u8_i8(i8 zeroext %0, i8 zeroext %1, i8 signext %2, i8 signext %3) {
222 ; CHECK-LABEL: select_cc_u8_i8:
224 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
225 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
226 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
227 ; CHECK-NEXT: b.l.t (, %s10)
228 %5 = icmp eq i8 %0, %1
229 %6 = select i1 %5, i8 %2, i8 %3
233 ; Function Attrs: norecurse nounwind readnone
234 define signext i8 @select_cc_i16_i8(i16 signext %0, i16 signext %1, i8 signext %2, i8 signext %3) {
235 ; CHECK-LABEL: select_cc_i16_i8:
237 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
238 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
239 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
240 ; CHECK-NEXT: b.l.t (, %s10)
241 %5 = icmp eq i16 %0, %1
242 %6 = select i1 %5, i8 %2, i8 %3
246 ; Function Attrs: norecurse nounwind readnone
247 define signext i8 @select_cc_u16_i8(i16 zeroext %0, i16 zeroext %1, i8 signext %2, i8 signext %3) {
248 ; CHECK-LABEL: select_cc_u16_i8:
250 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
251 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
252 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
253 ; CHECK-NEXT: b.l.t (, %s10)
254 %5 = icmp eq i16 %0, %1
255 %6 = select i1 %5, i8 %2, i8 %3
259 ; Function Attrs: norecurse nounwind readnone
260 define signext i8 @select_cc_i32_i8(i32 signext %0, i32 signext %1, i8 signext %2, i8 signext %3) {
261 ; CHECK-LABEL: select_cc_i32_i8:
263 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
264 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
265 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
266 ; CHECK-NEXT: b.l.t (, %s10)
267 %5 = icmp eq i32 %0, %1
268 %6 = select i1 %5, i8 %2, i8 %3
272 ; Function Attrs: norecurse nounwind readnone
273 define signext i8 @select_cc_u32_i8(i32 zeroext %0, i32 zeroext %1, i8 signext %2, i8 signext %3) {
274 ; CHECK-LABEL: select_cc_u32_i8:
276 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
277 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
278 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
279 ; CHECK-NEXT: b.l.t (, %s10)
280 %5 = icmp eq i32 %0, %1
281 %6 = select i1 %5, i8 %2, i8 %3
285 ; Function Attrs: norecurse nounwind readnone
286 define signext i8 @select_cc_i64_i8(i64 %0, i64 %1, i8 signext %2, i8 signext %3) {
287 ; CHECK-LABEL: select_cc_i64_i8:
289 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
290 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
291 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
292 ; CHECK-NEXT: b.l.t (, %s10)
293 %5 = icmp eq i64 %0, %1
294 %6 = select i1 %5, i8 %2, i8 %3
298 ; Function Attrs: norecurse nounwind readnone
299 define signext i8 @select_cc_u64_i8(i64 %0, i64 %1, i8 signext %2, i8 signext %3) {
300 ; CHECK-LABEL: select_cc_u64_i8:
302 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
303 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
304 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
305 ; CHECK-NEXT: b.l.t (, %s10)
306 %5 = icmp eq i64 %0, %1
307 %6 = select i1 %5, i8 %2, i8 %3
311 ; Function Attrs: norecurse nounwind readnone
312 define signext i8 @select_cc_i128_i8(i128 %0, i128 %1, i8 signext %2, i8 signext %3) {
313 ; CHECK-LABEL: select_cc_i128_i8:
315 ; CHECK-NEXT: xor %s1, %s1, %s3
316 ; CHECK-NEXT: xor %s0, %s0, %s2
317 ; CHECK-NEXT: or %s0, %s0, %s1
318 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
319 ; CHECK-NEXT: adds.w.sx %s0, %s5, (0)1
320 ; CHECK-NEXT: b.l.t (, %s10)
321 %5 = icmp eq i128 %0, %1
322 %6 = select i1 %5, i8 %2, i8 %3
326 ; Function Attrs: norecurse nounwind readnone
327 define signext i8 @select_cc_u128_i8(i128 %0, i128 %1, i8 signext %2, i8 signext %3) {
328 ; CHECK-LABEL: select_cc_u128_i8:
330 ; CHECK-NEXT: xor %s1, %s1, %s3
331 ; CHECK-NEXT: xor %s0, %s0, %s2
332 ; CHECK-NEXT: or %s0, %s0, %s1
333 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
334 ; CHECK-NEXT: adds.w.sx %s0, %s5, (0)1
335 ; CHECK-NEXT: b.l.t (, %s10)
336 %5 = icmp eq i128 %0, %1
337 %6 = select i1 %5, i8 %2, i8 %3
341 ; Function Attrs: norecurse nounwind readnone
342 define signext i8 @select_cc_float_i8(float %0, float %1, i8 signext %2, i8 signext %3) {
343 ; CHECK-LABEL: select_cc_float_i8:
345 ; CHECK-NEXT: fcmp.s %s0, %s0, %s1
346 ; CHECK-NEXT: cmov.s.eq %s3, %s2, %s0
347 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
348 ; CHECK-NEXT: b.l.t (, %s10)
349 %5 = fcmp fast oeq float %0, %1
350 %6 = select i1 %5, i8 %2, i8 %3
354 ; Function Attrs: norecurse nounwind readnone
355 define signext i8 @select_cc_double_i8(double %0, double %1, i8 signext %2, i8 signext %3) {
356 ; CHECK-LABEL: select_cc_double_i8:
358 ; CHECK-NEXT: fcmp.d %s0, %s0, %s1
359 ; CHECK-NEXT: cmov.d.eq %s3, %s2, %s0
360 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
361 ; CHECK-NEXT: b.l.t (, %s10)
362 %5 = fcmp fast oeq double %0, %1
363 %6 = select i1 %5, i8 %2, i8 %3
367 ; Function Attrs: norecurse nounwind readnone
368 define signext i8 @select_cc_quad_i8(fp128 %0, fp128 %1, i8 signext %2, i8 signext %3) {
369 ; CHECK-LABEL: select_cc_quad_i8:
371 ; CHECK-NEXT: fcmp.q %s0, %s0, %s2
372 ; CHECK-NEXT: cmov.d.eq %s5, %s4, %s0
373 ; CHECK-NEXT: adds.w.sx %s0, %s5, (0)1
374 ; CHECK-NEXT: b.l.t (, %s10)
375 %5 = fcmp fast oeq fp128 %0, %1
376 %6 = select i1 %5, i8 %2, i8 %3
380 ; Function Attrs: norecurse nounwind readnone
381 define zeroext i8 @select_cc_i1_u8(i1 zeroext %0, i1 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
382 ; CHECK-LABEL: select_cc_i1_u8:
384 ; CHECK-NEXT: xor %s0, %s0, %s1
385 ; CHECK-NEXT: cmov.w.ne %s2, %s3, %s0
386 ; CHECK-NEXT: adds.w.zx %s0, %s2, (0)1
387 ; CHECK-NEXT: b.l.t (, %s10)
389 %6 = select i1 %5, i8 %3, i8 %2
393 ; Function Attrs: norecurse nounwind readnone
394 define zeroext i8 @select_cc_i8_u8(i8 signext %0, i8 signext %1, i8 zeroext %2, i8 zeroext %3) {
395 ; CHECK-LABEL: select_cc_i8_u8:
397 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
398 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
399 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
400 ; CHECK-NEXT: b.l.t (, %s10)
401 %5 = icmp eq i8 %0, %1
402 %6 = select i1 %5, i8 %2, i8 %3
406 ; Function Attrs: norecurse nounwind readnone
407 define zeroext i8 @select_cc_u8_u8(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
408 ; CHECK-LABEL: select_cc_u8_u8:
410 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
411 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
412 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
413 ; CHECK-NEXT: b.l.t (, %s10)
414 %5 = icmp eq i8 %0, %1
415 %6 = select i1 %5, i8 %2, i8 %3
419 ; Function Attrs: norecurse nounwind readnone
420 define zeroext i8 @select_cc_i16_u8(i16 signext %0, i16 signext %1, i8 zeroext %2, i8 zeroext %3) {
421 ; CHECK-LABEL: select_cc_i16_u8:
423 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
424 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
425 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
426 ; CHECK-NEXT: b.l.t (, %s10)
427 %5 = icmp eq i16 %0, %1
428 %6 = select i1 %5, i8 %2, i8 %3
432 ; Function Attrs: norecurse nounwind readnone
433 define zeroext i8 @select_cc_u16_u8(i16 zeroext %0, i16 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
434 ; CHECK-LABEL: select_cc_u16_u8:
436 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
437 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
438 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
439 ; CHECK-NEXT: b.l.t (, %s10)
440 %5 = icmp eq i16 %0, %1
441 %6 = select i1 %5, i8 %2, i8 %3
445 ; Function Attrs: norecurse nounwind readnone
446 define zeroext i8 @select_cc_i32_u8(i32 signext %0, i32 signext %1, i8 zeroext %2, i8 zeroext %3) {
447 ; CHECK-LABEL: select_cc_i32_u8:
449 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
450 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
451 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
452 ; CHECK-NEXT: b.l.t (, %s10)
453 %5 = icmp eq i32 %0, %1
454 %6 = select i1 %5, i8 %2, i8 %3
458 ; Function Attrs: norecurse nounwind readnone
459 define zeroext i8 @select_cc_u32_u8(i32 zeroext %0, i32 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
460 ; CHECK-LABEL: select_cc_u32_u8:
462 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
463 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
464 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
465 ; CHECK-NEXT: b.l.t (, %s10)
466 %5 = icmp eq i32 %0, %1
467 %6 = select i1 %5, i8 %2, i8 %3
471 ; Function Attrs: norecurse nounwind readnone
472 define zeroext i8 @select_cc_i64_u8(i64 %0, i64 %1, i8 zeroext %2, i8 zeroext %3) {
473 ; CHECK-LABEL: select_cc_i64_u8:
475 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
476 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
477 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
478 ; CHECK-NEXT: b.l.t (, %s10)
479 %5 = icmp eq i64 %0, %1
480 %6 = select i1 %5, i8 %2, i8 %3
484 ; Function Attrs: norecurse nounwind readnone
485 define zeroext i8 @select_cc_u64_u8(i64 %0, i64 %1, i8 zeroext %2, i8 zeroext %3) {
486 ; CHECK-LABEL: select_cc_u64_u8:
488 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
489 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
490 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
491 ; CHECK-NEXT: b.l.t (, %s10)
492 %5 = icmp eq i64 %0, %1
493 %6 = select i1 %5, i8 %2, i8 %3
497 ; Function Attrs: norecurse nounwind readnone
498 define zeroext i8 @select_cc_i128_u8(i128 %0, i128 %1, i8 zeroext %2, i8 zeroext %3) {
499 ; CHECK-LABEL: select_cc_i128_u8:
501 ; CHECK-NEXT: xor %s1, %s1, %s3
502 ; CHECK-NEXT: xor %s0, %s0, %s2
503 ; CHECK-NEXT: or %s0, %s0, %s1
504 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
505 ; CHECK-NEXT: adds.w.zx %s0, %s5, (0)1
506 ; CHECK-NEXT: b.l.t (, %s10)
507 %5 = icmp eq i128 %0, %1
508 %6 = select i1 %5, i8 %2, i8 %3
512 ; Function Attrs: norecurse nounwind readnone
513 define zeroext i8 @select_cc_u128_u8(i128 %0, i128 %1, i8 zeroext %2, i8 zeroext %3) {
514 ; CHECK-LABEL: select_cc_u128_u8:
516 ; CHECK-NEXT: xor %s1, %s1, %s3
517 ; CHECK-NEXT: xor %s0, %s0, %s2
518 ; CHECK-NEXT: or %s0, %s0, %s1
519 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
520 ; CHECK-NEXT: adds.w.zx %s0, %s5, (0)1
521 ; CHECK-NEXT: b.l.t (, %s10)
522 %5 = icmp eq i128 %0, %1
523 %6 = select i1 %5, i8 %2, i8 %3
527 ; Function Attrs: norecurse nounwind readnone
528 define zeroext i8 @select_cc_float_u8(float %0, float %1, i8 zeroext %2, i8 zeroext %3) {
529 ; CHECK-LABEL: select_cc_float_u8:
531 ; CHECK-NEXT: fcmp.s %s0, %s0, %s1
532 ; CHECK-NEXT: cmov.s.eq %s3, %s2, %s0
533 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
534 ; CHECK-NEXT: b.l.t (, %s10)
535 %5 = fcmp fast oeq float %0, %1
536 %6 = select i1 %5, i8 %2, i8 %3
540 ; Function Attrs: norecurse nounwind readnone
541 define zeroext i8 @select_cc_double_u8(double %0, double %1, i8 zeroext %2, i8 zeroext %3) {
542 ; CHECK-LABEL: select_cc_double_u8:
544 ; CHECK-NEXT: fcmp.d %s0, %s0, %s1
545 ; CHECK-NEXT: cmov.d.eq %s3, %s2, %s0
546 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
547 ; CHECK-NEXT: b.l.t (, %s10)
548 %5 = fcmp fast oeq double %0, %1
549 %6 = select i1 %5, i8 %2, i8 %3
553 ; Function Attrs: norecurse nounwind readnone
554 define zeroext i8 @select_cc_quad_u8(fp128 %0, fp128 %1, i8 zeroext %2, i8 zeroext %3) {
555 ; CHECK-LABEL: select_cc_quad_u8:
557 ; CHECK-NEXT: fcmp.q %s0, %s0, %s2
558 ; CHECK-NEXT: cmov.d.eq %s5, %s4, %s0
559 ; CHECK-NEXT: adds.w.zx %s0, %s5, (0)1
560 ; CHECK-NEXT: b.l.t (, %s10)
561 %5 = fcmp fast oeq fp128 %0, %1
562 %6 = select i1 %5, i8 %2, i8 %3
566 ; Function Attrs: norecurse nounwind readnone
567 define signext i16 @select_cc_i1_i16(i1 zeroext %0, i1 zeroext %1, i16 signext %2, i16 signext %3) {
568 ; CHECK-LABEL: select_cc_i1_i16:
570 ; CHECK-NEXT: xor %s0, %s0, %s1
571 ; CHECK-NEXT: cmov.w.ne %s2, %s3, %s0
572 ; CHECK-NEXT: adds.w.sx %s0, %s2, (0)1
573 ; CHECK-NEXT: b.l.t (, %s10)
575 %6 = select i1 %5, i16 %3, i16 %2
579 ; Function Attrs: norecurse nounwind readnone
580 define signext i16 @select_cc_i8_i16(i8 signext %0, i8 signext %1, i16 signext %2, i16 signext %3) {
581 ; CHECK-LABEL: select_cc_i8_i16:
583 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
584 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
585 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
586 ; CHECK-NEXT: b.l.t (, %s10)
587 %5 = icmp eq i8 %0, %1
588 %6 = select i1 %5, i16 %2, i16 %3
592 ; Function Attrs: norecurse nounwind readnone
593 define signext i16 @select_cc_u8_i16(i8 zeroext %0, i8 zeroext %1, i16 signext %2, i16 signext %3) {
594 ; CHECK-LABEL: select_cc_u8_i16:
596 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
597 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
598 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
599 ; CHECK-NEXT: b.l.t (, %s10)
600 %5 = icmp eq i8 %0, %1
601 %6 = select i1 %5, i16 %2, i16 %3
605 ; Function Attrs: norecurse nounwind readnone
606 define signext i16 @select_cc_i16_i16(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
607 ; CHECK-LABEL: select_cc_i16_i16:
609 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
610 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
611 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
612 ; CHECK-NEXT: b.l.t (, %s10)
613 %5 = icmp eq i16 %0, %1
614 %6 = select i1 %5, i16 %2, i16 %3
618 ; Function Attrs: norecurse nounwind readnone
619 define signext i16 @select_cc_u16_i16(i16 zeroext %0, i16 zeroext %1, i16 signext %2, i16 signext %3) {
620 ; CHECK-LABEL: select_cc_u16_i16:
622 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
623 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
624 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
625 ; CHECK-NEXT: b.l.t (, %s10)
626 %5 = icmp eq i16 %0, %1
627 %6 = select i1 %5, i16 %2, i16 %3
631 ; Function Attrs: norecurse nounwind readnone
632 define signext i16 @select_cc_i32_i16(i32 signext %0, i32 signext %1, i16 signext %2, i16 signext %3) {
633 ; CHECK-LABEL: select_cc_i32_i16:
635 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
636 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
637 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
638 ; CHECK-NEXT: b.l.t (, %s10)
639 %5 = icmp eq i32 %0, %1
640 %6 = select i1 %5, i16 %2, i16 %3
644 ; Function Attrs: norecurse nounwind readnone
645 define signext i16 @select_cc_u32_i16(i32 zeroext %0, i32 zeroext %1, i16 signext %2, i16 signext %3) {
646 ; CHECK-LABEL: select_cc_u32_i16:
648 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
649 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
650 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
651 ; CHECK-NEXT: b.l.t (, %s10)
652 %5 = icmp eq i32 %0, %1
653 %6 = select i1 %5, i16 %2, i16 %3
657 ; Function Attrs: norecurse nounwind readnone
658 define signext i16 @select_cc_i64_i16(i64 %0, i64 %1, i16 signext %2, i16 signext %3) {
659 ; CHECK-LABEL: select_cc_i64_i16:
661 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
662 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
663 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
664 ; CHECK-NEXT: b.l.t (, %s10)
665 %5 = icmp eq i64 %0, %1
666 %6 = select i1 %5, i16 %2, i16 %3
670 ; Function Attrs: norecurse nounwind readnone
671 define signext i16 @select_cc_u64_i16(i64 %0, i64 %1, i16 signext %2, i16 signext %3) {
672 ; CHECK-LABEL: select_cc_u64_i16:
674 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
675 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
676 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
677 ; CHECK-NEXT: b.l.t (, %s10)
678 %5 = icmp eq i64 %0, %1
679 %6 = select i1 %5, i16 %2, i16 %3
683 ; Function Attrs: norecurse nounwind readnone
684 define signext i16 @select_cc_i128_i16(i128 %0, i128 %1, i16 signext %2, i16 signext %3) {
685 ; CHECK-LABEL: select_cc_i128_i16:
687 ; CHECK-NEXT: xor %s1, %s1, %s3
688 ; CHECK-NEXT: xor %s0, %s0, %s2
689 ; CHECK-NEXT: or %s0, %s0, %s1
690 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
691 ; CHECK-NEXT: adds.w.sx %s0, %s5, (0)1
692 ; CHECK-NEXT: b.l.t (, %s10)
693 %5 = icmp eq i128 %0, %1
694 %6 = select i1 %5, i16 %2, i16 %3
698 ; Function Attrs: norecurse nounwind readnone
699 define signext i16 @select_cc_u128_i16(i128 %0, i128 %1, i16 signext %2, i16 signext %3) {
700 ; CHECK-LABEL: select_cc_u128_i16:
702 ; CHECK-NEXT: xor %s1, %s1, %s3
703 ; CHECK-NEXT: xor %s0, %s0, %s2
704 ; CHECK-NEXT: or %s0, %s0, %s1
705 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
706 ; CHECK-NEXT: adds.w.sx %s0, %s5, (0)1
707 ; CHECK-NEXT: b.l.t (, %s10)
708 %5 = icmp eq i128 %0, %1
709 %6 = select i1 %5, i16 %2, i16 %3
713 ; Function Attrs: norecurse nounwind readnone
714 define signext i16 @select_cc_float_i16(float %0, float %1, i16 signext %2, i16 signext %3) {
715 ; CHECK-LABEL: select_cc_float_i16:
717 ; CHECK-NEXT: fcmp.s %s0, %s0, %s1
718 ; CHECK-NEXT: cmov.s.eq %s3, %s2, %s0
719 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
720 ; CHECK-NEXT: b.l.t (, %s10)
721 %5 = fcmp fast oeq float %0, %1
722 %6 = select i1 %5, i16 %2, i16 %3
726 ; Function Attrs: norecurse nounwind readnone
727 define signext i16 @select_cc_double_i16(double %0, double %1, i16 signext %2, i16 signext %3) {
728 ; CHECK-LABEL: select_cc_double_i16:
730 ; CHECK-NEXT: fcmp.d %s0, %s0, %s1
731 ; CHECK-NEXT: cmov.d.eq %s3, %s2, %s0
732 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
733 ; CHECK-NEXT: b.l.t (, %s10)
734 %5 = fcmp fast oeq double %0, %1
735 %6 = select i1 %5, i16 %2, i16 %3
739 ; Function Attrs: norecurse nounwind readnone
740 define signext i16 @select_cc_quad_i16(fp128 %0, fp128 %1, i16 signext %2, i16 signext %3) {
741 ; CHECK-LABEL: select_cc_quad_i16:
743 ; CHECK-NEXT: fcmp.q %s0, %s0, %s2
744 ; CHECK-NEXT: cmov.d.eq %s5, %s4, %s0
745 ; CHECK-NEXT: adds.w.sx %s0, %s5, (0)1
746 ; CHECK-NEXT: b.l.t (, %s10)
747 %5 = fcmp fast oeq fp128 %0, %1
748 %6 = select i1 %5, i16 %2, i16 %3
752 ; Function Attrs: norecurse nounwind readnone
753 define zeroext i16 @select_cc_i1_u16(i1 zeroext %0, i1 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
754 ; CHECK-LABEL: select_cc_i1_u16:
756 ; CHECK-NEXT: xor %s0, %s0, %s1
757 ; CHECK-NEXT: cmov.w.ne %s2, %s3, %s0
758 ; CHECK-NEXT: adds.w.zx %s0, %s2, (0)1
759 ; CHECK-NEXT: b.l.t (, %s10)
761 %6 = select i1 %5, i16 %3, i16 %2
765 ; Function Attrs: norecurse nounwind readnone
766 define zeroext i16 @select_cc_i8_u16(i8 signext %0, i8 signext %1, i16 zeroext %2, i16 zeroext %3) {
767 ; CHECK-LABEL: select_cc_i8_u16:
769 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
770 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
771 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
772 ; CHECK-NEXT: b.l.t (, %s10)
773 %5 = icmp eq i8 %0, %1
774 %6 = select i1 %5, i16 %2, i16 %3
778 ; Function Attrs: norecurse nounwind readnone
779 define zeroext i16 @select_cc_u8_u16(i8 zeroext %0, i8 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
780 ; CHECK-LABEL: select_cc_u8_u16:
782 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
783 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
784 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
785 ; CHECK-NEXT: b.l.t (, %s10)
786 %5 = icmp eq i8 %0, %1
787 %6 = select i1 %5, i16 %2, i16 %3
791 ; Function Attrs: norecurse nounwind readnone
792 define zeroext i16 @select_cc_i16_u16(i16 signext %0, i16 signext %1, i16 zeroext %2, i16 zeroext %3) {
793 ; CHECK-LABEL: select_cc_i16_u16:
795 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
796 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
797 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
798 ; CHECK-NEXT: b.l.t (, %s10)
799 %5 = icmp eq i16 %0, %1
800 %6 = select i1 %5, i16 %2, i16 %3
804 ; Function Attrs: norecurse nounwind readnone
805 define zeroext i16 @select_cc_u16_u16(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
806 ; CHECK-LABEL: select_cc_u16_u16:
808 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
809 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
810 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
811 ; CHECK-NEXT: b.l.t (, %s10)
812 %5 = icmp eq i16 %0, %1
813 %6 = select i1 %5, i16 %2, i16 %3
817 ; Function Attrs: norecurse nounwind readnone
818 define zeroext i16 @select_cc_i32_u16(i32 signext %0, i32 signext %1, i16 zeroext %2, i16 zeroext %3) {
819 ; CHECK-LABEL: select_cc_i32_u16:
821 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
822 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
823 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
824 ; CHECK-NEXT: b.l.t (, %s10)
825 %5 = icmp eq i32 %0, %1
826 %6 = select i1 %5, i16 %2, i16 %3
830 ; Function Attrs: norecurse nounwind readnone
831 define zeroext i16 @select_cc_u32_u16(i32 zeroext %0, i32 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
832 ; CHECK-LABEL: select_cc_u32_u16:
834 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
835 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
836 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
837 ; CHECK-NEXT: b.l.t (, %s10)
838 %5 = icmp eq i32 %0, %1
839 %6 = select i1 %5, i16 %2, i16 %3
843 ; Function Attrs: norecurse nounwind readnone
844 define zeroext i16 @select_cc_i64_u16(i64 %0, i64 %1, i16 zeroext %2, i16 zeroext %3) {
845 ; CHECK-LABEL: select_cc_i64_u16:
847 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
848 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
849 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
850 ; CHECK-NEXT: b.l.t (, %s10)
851 %5 = icmp eq i64 %0, %1
852 %6 = select i1 %5, i16 %2, i16 %3
856 ; Function Attrs: norecurse nounwind readnone
857 define zeroext i16 @select_cc_u64_u16(i64 %0, i64 %1, i16 zeroext %2, i16 zeroext %3) {
858 ; CHECK-LABEL: select_cc_u64_u16:
860 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
861 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
862 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
863 ; CHECK-NEXT: b.l.t (, %s10)
864 %5 = icmp eq i64 %0, %1
865 %6 = select i1 %5, i16 %2, i16 %3
869 ; Function Attrs: norecurse nounwind readnone
870 define zeroext i16 @select_cc_i128_u16(i128 %0, i128 %1, i16 zeroext %2, i16 zeroext %3) {
871 ; CHECK-LABEL: select_cc_i128_u16:
873 ; CHECK-NEXT: xor %s1, %s1, %s3
874 ; CHECK-NEXT: xor %s0, %s0, %s2
875 ; CHECK-NEXT: or %s0, %s0, %s1
876 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
877 ; CHECK-NEXT: adds.w.zx %s0, %s5, (0)1
878 ; CHECK-NEXT: b.l.t (, %s10)
879 %5 = icmp eq i128 %0, %1
880 %6 = select i1 %5, i16 %2, i16 %3
884 ; Function Attrs: norecurse nounwind readnone
885 define zeroext i16 @select_cc_u128_u16(i128 %0, i128 %1, i16 zeroext %2, i16 zeroext %3) {
886 ; CHECK-LABEL: select_cc_u128_u16:
888 ; CHECK-NEXT: xor %s1, %s1, %s3
889 ; CHECK-NEXT: xor %s0, %s0, %s2
890 ; CHECK-NEXT: or %s0, %s0, %s1
891 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
892 ; CHECK-NEXT: adds.w.zx %s0, %s5, (0)1
893 ; CHECK-NEXT: b.l.t (, %s10)
894 %5 = icmp eq i128 %0, %1
895 %6 = select i1 %5, i16 %2, i16 %3
899 ; Function Attrs: norecurse nounwind readnone
900 define zeroext i16 @select_cc_float_u16(float %0, float %1, i16 zeroext %2, i16 zeroext %3) {
901 ; CHECK-LABEL: select_cc_float_u16:
903 ; CHECK-NEXT: fcmp.s %s0, %s0, %s1
904 ; CHECK-NEXT: cmov.s.eq %s3, %s2, %s0
905 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
906 ; CHECK-NEXT: b.l.t (, %s10)
907 %5 = fcmp fast oeq float %0, %1
908 %6 = select i1 %5, i16 %2, i16 %3
912 ; Function Attrs: norecurse nounwind readnone
913 define zeroext i16 @select_cc_double_u16(double %0, double %1, i16 zeroext %2, i16 zeroext %3) {
914 ; CHECK-LABEL: select_cc_double_u16:
916 ; CHECK-NEXT: fcmp.d %s0, %s0, %s1
917 ; CHECK-NEXT: cmov.d.eq %s3, %s2, %s0
918 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
919 ; CHECK-NEXT: b.l.t (, %s10)
920 %5 = fcmp fast oeq double %0, %1
921 %6 = select i1 %5, i16 %2, i16 %3
925 ; Function Attrs: norecurse nounwind readnone
926 define zeroext i16 @select_cc_quad_u16(fp128 %0, fp128 %1, i16 zeroext %2, i16 zeroext %3) {
927 ; CHECK-LABEL: select_cc_quad_u16:
929 ; CHECK-NEXT: fcmp.q %s0, %s0, %s2
930 ; CHECK-NEXT: cmov.d.eq %s5, %s4, %s0
931 ; CHECK-NEXT: adds.w.zx %s0, %s5, (0)1
932 ; CHECK-NEXT: b.l.t (, %s10)
933 %5 = fcmp fast oeq fp128 %0, %1
934 %6 = select i1 %5, i16 %2, i16 %3
938 ; Function Attrs: norecurse nounwind readnone
939 define signext i32 @select_cc_i1_i32(i1 zeroext %0, i1 zeroext %1, i32 signext %2, i32 signext %3) {
940 ; CHECK-LABEL: select_cc_i1_i32:
942 ; CHECK-NEXT: xor %s0, %s0, %s1
943 ; CHECK-NEXT: cmov.w.ne %s2, %s3, %s0
944 ; CHECK-NEXT: adds.w.sx %s0, %s2, (0)1
945 ; CHECK-NEXT: b.l.t (, %s10)
947 %6 = select i1 %5, i32 %3, i32 %2
951 ; Function Attrs: norecurse nounwind readnone
952 define signext i32 @select_cc_i8_i32(i8 signext %0, i8 signext %1, i32 signext %2, i32 signext %3) {
953 ; CHECK-LABEL: select_cc_i8_i32:
955 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
956 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
957 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
958 ; CHECK-NEXT: b.l.t (, %s10)
959 %5 = icmp eq i8 %0, %1
960 %6 = select i1 %5, i32 %2, i32 %3
964 ; Function Attrs: norecurse nounwind readnone
965 define signext i32 @select_cc_u8_i32(i8 zeroext %0, i8 zeroext %1, i32 signext %2, i32 signext %3) {
966 ; CHECK-LABEL: select_cc_u8_i32:
968 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
969 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
970 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
971 ; CHECK-NEXT: b.l.t (, %s10)
972 %5 = icmp eq i8 %0, %1
973 %6 = select i1 %5, i32 %2, i32 %3
977 ; Function Attrs: norecurse nounwind readnone
978 define signext i32 @select_cc_i16_i32(i16 signext %0, i16 signext %1, i32 signext %2, i32 signext %3) {
979 ; CHECK-LABEL: select_cc_i16_i32:
981 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
982 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
983 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
984 ; CHECK-NEXT: b.l.t (, %s10)
985 %5 = icmp eq i16 %0, %1
986 %6 = select i1 %5, i32 %2, i32 %3
990 ; Function Attrs: norecurse nounwind readnone
991 define signext i32 @select_cc_u16_i32(i16 zeroext %0, i16 zeroext %1, i32 signext %2, i32 signext %3) {
992 ; CHECK-LABEL: select_cc_u16_i32:
994 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
995 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
996 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
997 ; CHECK-NEXT: b.l.t (, %s10)
998 %5 = icmp eq i16 %0, %1
999 %6 = select i1 %5, i32 %2, i32 %3
1003 ; Function Attrs: norecurse nounwind readnone
1004 define signext i32 @select_cc_i32_i32(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
1005 ; CHECK-LABEL: select_cc_i32_i32:
1007 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1008 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1009 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
1010 ; CHECK-NEXT: b.l.t (, %s10)
1011 %5 = icmp eq i32 %0, %1
1012 %6 = select i1 %5, i32 %2, i32 %3
1016 ; Function Attrs: norecurse nounwind readnone
1017 define signext i32 @select_cc_u32_i32(i32 zeroext %0, i32 zeroext %1, i32 signext %2, i32 signext %3) {
1018 ; CHECK-LABEL: select_cc_u32_i32:
1020 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1021 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1022 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
1023 ; CHECK-NEXT: b.l.t (, %s10)
1024 %5 = icmp eq i32 %0, %1
1025 %6 = select i1 %5, i32 %2, i32 %3
1029 ; Function Attrs: norecurse nounwind readnone
1030 define signext i32 @select_cc_i64_i32(i64 %0, i64 %1, i32 signext %2, i32 signext %3) {
1031 ; CHECK-LABEL: select_cc_i64_i32:
1033 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
1034 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
1035 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
1036 ; CHECK-NEXT: b.l.t (, %s10)
1037 %5 = icmp eq i64 %0, %1
1038 %6 = select i1 %5, i32 %2, i32 %3
1042 ; Function Attrs: norecurse nounwind readnone
1043 define signext i32 @select_cc_u64_i32(i64 %0, i64 %1, i32 signext %2, i32 signext %3) {
1044 ; CHECK-LABEL: select_cc_u64_i32:
1046 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
1047 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
1048 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
1049 ; CHECK-NEXT: b.l.t (, %s10)
1050 %5 = icmp eq i64 %0, %1
1051 %6 = select i1 %5, i32 %2, i32 %3
1055 ; Function Attrs: norecurse nounwind readnone
1056 define signext i32 @select_cc_i128_i32(i128 %0, i128 %1, i32 signext %2, i32 signext %3) {
1057 ; CHECK-LABEL: select_cc_i128_i32:
1059 ; CHECK-NEXT: xor %s1, %s1, %s3
1060 ; CHECK-NEXT: xor %s0, %s0, %s2
1061 ; CHECK-NEXT: or %s0, %s0, %s1
1062 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
1063 ; CHECK-NEXT: adds.w.sx %s0, %s5, (0)1
1064 ; CHECK-NEXT: b.l.t (, %s10)
1065 %5 = icmp eq i128 %0, %1
1066 %6 = select i1 %5, i32 %2, i32 %3
1070 ; Function Attrs: norecurse nounwind readnone
1071 define signext i32 @select_cc_u128_i32(i128 %0, i128 %1, i32 signext %2, i32 signext %3) {
1072 ; CHECK-LABEL: select_cc_u128_i32:
1074 ; CHECK-NEXT: xor %s1, %s1, %s3
1075 ; CHECK-NEXT: xor %s0, %s0, %s2
1076 ; CHECK-NEXT: or %s0, %s0, %s1
1077 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
1078 ; CHECK-NEXT: adds.w.sx %s0, %s5, (0)1
1079 ; CHECK-NEXT: b.l.t (, %s10)
1080 %5 = icmp eq i128 %0, %1
1081 %6 = select i1 %5, i32 %2, i32 %3
1085 ; Function Attrs: norecurse nounwind readnone
1086 define signext i32 @select_cc_float_i32(float %0, float %1, i32 signext %2, i32 signext %3) {
1087 ; CHECK-LABEL: select_cc_float_i32:
1089 ; CHECK-NEXT: fcmp.s %s0, %s0, %s1
1090 ; CHECK-NEXT: cmov.s.eq %s3, %s2, %s0
1091 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
1092 ; CHECK-NEXT: b.l.t (, %s10)
1093 %5 = fcmp fast oeq float %0, %1
1094 %6 = select i1 %5, i32 %2, i32 %3
1098 ; Function Attrs: norecurse nounwind readnone
1099 define signext i32 @select_cc_double_i32(double %0, double %1, i32 signext %2, i32 signext %3) {
1100 ; CHECK-LABEL: select_cc_double_i32:
1102 ; CHECK-NEXT: fcmp.d %s0, %s0, %s1
1103 ; CHECK-NEXT: cmov.d.eq %s3, %s2, %s0
1104 ; CHECK-NEXT: adds.w.sx %s0, %s3, (0)1
1105 ; CHECK-NEXT: b.l.t (, %s10)
1106 %5 = fcmp fast oeq double %0, %1
1107 %6 = select i1 %5, i32 %2, i32 %3
1111 ; Function Attrs: norecurse nounwind readnone
1112 define signext i32 @select_cc_quad_i32(fp128 %0, fp128 %1, i32 signext %2, i32 signext %3) {
1113 ; CHECK-LABEL: select_cc_quad_i32:
1115 ; CHECK-NEXT: fcmp.q %s0, %s0, %s2
1116 ; CHECK-NEXT: cmov.d.eq %s5, %s4, %s0
1117 ; CHECK-NEXT: adds.w.sx %s0, %s5, (0)1
1118 ; CHECK-NEXT: b.l.t (, %s10)
1119 %5 = fcmp fast oeq fp128 %0, %1
1120 %6 = select i1 %5, i32 %2, i32 %3
1124 ; Function Attrs: norecurse nounwind readnone
1125 define zeroext i32 @select_cc_i1_u32(i1 zeroext %0, i1 zeroext %1, i32 zeroext %2, i32 zeroext %3) {
1126 ; CHECK-LABEL: select_cc_i1_u32:
1128 ; CHECK-NEXT: xor %s0, %s0, %s1
1129 ; CHECK-NEXT: cmov.w.ne %s2, %s3, %s0
1130 ; CHECK-NEXT: adds.w.zx %s0, %s2, (0)1
1131 ; CHECK-NEXT: b.l.t (, %s10)
1133 %6 = select i1 %5, i32 %3, i32 %2
1137 ; Function Attrs: norecurse nounwind readnone
1138 define zeroext i32 @select_cc_i8_u32(i8 signext %0, i8 signext %1, i32 zeroext %2, i32 zeroext %3) {
1139 ; CHECK-LABEL: select_cc_i8_u32:
1141 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1142 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1143 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
1144 ; CHECK-NEXT: b.l.t (, %s10)
1145 %5 = icmp eq i8 %0, %1
1146 %6 = select i1 %5, i32 %2, i32 %3
1150 ; Function Attrs: norecurse nounwind readnone
1151 define zeroext i32 @select_cc_u8_u32(i8 zeroext %0, i8 zeroext %1, i32 zeroext %2, i32 zeroext %3) {
1152 ; CHECK-LABEL: select_cc_u8_u32:
1154 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1155 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1156 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
1157 ; CHECK-NEXT: b.l.t (, %s10)
1158 %5 = icmp eq i8 %0, %1
1159 %6 = select i1 %5, i32 %2, i32 %3
1163 ; Function Attrs: norecurse nounwind readnone
1164 define zeroext i32 @select_cc_i16_u32(i16 signext %0, i16 signext %1, i32 zeroext %2, i32 zeroext %3) {
1165 ; CHECK-LABEL: select_cc_i16_u32:
1167 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1168 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1169 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
1170 ; CHECK-NEXT: b.l.t (, %s10)
1171 %5 = icmp eq i16 %0, %1
1172 %6 = select i1 %5, i32 %2, i32 %3
1176 ; Function Attrs: norecurse nounwind readnone
1177 define zeroext i32 @select_cc_u16_u32(i16 zeroext %0, i16 zeroext %1, i32 zeroext %2, i32 zeroext %3) {
1178 ; CHECK-LABEL: select_cc_u16_u32:
1180 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1181 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1182 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
1183 ; CHECK-NEXT: b.l.t (, %s10)
1184 %5 = icmp eq i16 %0, %1
1185 %6 = select i1 %5, i32 %2, i32 %3
1189 ; Function Attrs: norecurse nounwind readnone
1190 define zeroext i32 @select_cc_i32_u32(i32 signext %0, i32 signext %1, i32 zeroext %2, i32 zeroext %3) {
1191 ; CHECK-LABEL: select_cc_i32_u32:
1193 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1194 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1195 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
1196 ; CHECK-NEXT: b.l.t (, %s10)
1197 %5 = icmp eq i32 %0, %1
1198 %6 = select i1 %5, i32 %2, i32 %3
1202 ; Function Attrs: norecurse nounwind readnone
1203 define zeroext i32 @select_cc_u32_u32(i32 zeroext %0, i32 zeroext %1, i32 zeroext %2, i32 zeroext %3) {
1204 ; CHECK-LABEL: select_cc_u32_u32:
1206 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1207 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1208 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
1209 ; CHECK-NEXT: b.l.t (, %s10)
1210 %5 = icmp eq i32 %0, %1
1211 %6 = select i1 %5, i32 %2, i32 %3
1215 ; Function Attrs: norecurse nounwind readnone
1216 define zeroext i32 @select_cc_i64_u32(i64 %0, i64 %1, i32 zeroext %2, i32 zeroext %3) {
1217 ; CHECK-LABEL: select_cc_i64_u32:
1219 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
1220 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
1221 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
1222 ; CHECK-NEXT: b.l.t (, %s10)
1223 %5 = icmp eq i64 %0, %1
1224 %6 = select i1 %5, i32 %2, i32 %3
1228 ; Function Attrs: norecurse nounwind readnone
1229 define zeroext i32 @select_cc_u64_u32(i64 %0, i64 %1, i32 zeroext %2, i32 zeroext %3) {
1230 ; CHECK-LABEL: select_cc_u64_u32:
1232 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
1233 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
1234 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
1235 ; CHECK-NEXT: b.l.t (, %s10)
1236 %5 = icmp eq i64 %0, %1
1237 %6 = select i1 %5, i32 %2, i32 %3
1241 ; Function Attrs: norecurse nounwind readnone
1242 define zeroext i32 @select_cc_i128_u32(i128 %0, i128 %1, i32 zeroext %2, i32 zeroext %3) {
1243 ; CHECK-LABEL: select_cc_i128_u32:
1245 ; CHECK-NEXT: xor %s1, %s1, %s3
1246 ; CHECK-NEXT: xor %s0, %s0, %s2
1247 ; CHECK-NEXT: or %s0, %s0, %s1
1248 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
1249 ; CHECK-NEXT: adds.w.zx %s0, %s5, (0)1
1250 ; CHECK-NEXT: b.l.t (, %s10)
1251 %5 = icmp eq i128 %0, %1
1252 %6 = select i1 %5, i32 %2, i32 %3
1256 ; Function Attrs: norecurse nounwind readnone
1257 define zeroext i32 @select_cc_u128_u32(i128 %0, i128 %1, i32 zeroext %2, i32 zeroext %3) {
1258 ; CHECK-LABEL: select_cc_u128_u32:
1260 ; CHECK-NEXT: xor %s1, %s1, %s3
1261 ; CHECK-NEXT: xor %s0, %s0, %s2
1262 ; CHECK-NEXT: or %s0, %s0, %s1
1263 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
1264 ; CHECK-NEXT: adds.w.zx %s0, %s5, (0)1
1265 ; CHECK-NEXT: b.l.t (, %s10)
1266 %5 = icmp eq i128 %0, %1
1267 %6 = select i1 %5, i32 %2, i32 %3
1271 ; Function Attrs: norecurse nounwind readnone
1272 define zeroext i32 @select_cc_float_u32(float %0, float %1, i32 zeroext %2, i32 zeroext %3) {
1273 ; CHECK-LABEL: select_cc_float_u32:
1275 ; CHECK-NEXT: fcmp.s %s0, %s0, %s1
1276 ; CHECK-NEXT: cmov.s.eq %s3, %s2, %s0
1277 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
1278 ; CHECK-NEXT: b.l.t (, %s10)
1279 %5 = fcmp fast oeq float %0, %1
1280 %6 = select i1 %5, i32 %2, i32 %3
1284 ; Function Attrs: norecurse nounwind readnone
1285 define zeroext i32 @select_cc_double_u32(double %0, double %1, i32 zeroext %2, i32 zeroext %3) {
1286 ; CHECK-LABEL: select_cc_double_u32:
1288 ; CHECK-NEXT: fcmp.d %s0, %s0, %s1
1289 ; CHECK-NEXT: cmov.d.eq %s3, %s2, %s0
1290 ; CHECK-NEXT: adds.w.zx %s0, %s3, (0)1
1291 ; CHECK-NEXT: b.l.t (, %s10)
1292 %5 = fcmp fast oeq double %0, %1
1293 %6 = select i1 %5, i32 %2, i32 %3
1297 ; Function Attrs: norecurse nounwind readnone
1298 define zeroext i32 @select_cc_quad_u32(fp128 %0, fp128 %1, i32 zeroext %2, i32 zeroext %3) {
1299 ; CHECK-LABEL: select_cc_quad_u32:
1301 ; CHECK-NEXT: fcmp.q %s0, %s0, %s2
1302 ; CHECK-NEXT: cmov.d.eq %s5, %s4, %s0
1303 ; CHECK-NEXT: adds.w.zx %s0, %s5, (0)1
1304 ; CHECK-NEXT: b.l.t (, %s10)
1305 %5 = fcmp fast oeq fp128 %0, %1
1306 %6 = select i1 %5, i32 %2, i32 %3
1310 ; Function Attrs: norecurse nounwind readnone
1311 define i64 @select_cc_i1_i64(i1 zeroext %0, i1 zeroext %1, i64 %2, i64 %3) {
1312 ; CHECK-LABEL: select_cc_i1_i64:
1314 ; CHECK-NEXT: xor %s0, %s0, %s1
1315 ; CHECK-NEXT: cmov.w.ne %s2, %s3, %s0
1316 ; CHECK-NEXT: or %s0, 0, %s2
1317 ; CHECK-NEXT: b.l.t (, %s10)
1319 %6 = select i1 %5, i64 %3, i64 %2
1323 ; Function Attrs: norecurse nounwind readnone
1324 define i64 @select_cc_i8_i64(i8 signext %0, i8 signext %1, i64 %2, i64 %3) {
1325 ; CHECK-LABEL: select_cc_i8_i64:
1327 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1328 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1329 ; CHECK-NEXT: or %s0, 0, %s3
1330 ; CHECK-NEXT: b.l.t (, %s10)
1331 %5 = icmp eq i8 %0, %1
1332 %6 = select i1 %5, i64 %2, i64 %3
1336 ; Function Attrs: norecurse nounwind readnone
1337 define i64 @select_cc_u8_i64(i8 zeroext %0, i8 zeroext %1, i64 %2, i64 %3) {
1338 ; CHECK-LABEL: select_cc_u8_i64:
1340 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1341 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1342 ; CHECK-NEXT: or %s0, 0, %s3
1343 ; CHECK-NEXT: b.l.t (, %s10)
1344 %5 = icmp eq i8 %0, %1
1345 %6 = select i1 %5, i64 %2, i64 %3
1349 ; Function Attrs: norecurse nounwind readnone
1350 define i64 @select_cc_i16_i64(i16 signext %0, i16 signext %1, i64 %2, i64 %3) {
1351 ; CHECK-LABEL: select_cc_i16_i64:
1353 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1354 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1355 ; CHECK-NEXT: or %s0, 0, %s3
1356 ; CHECK-NEXT: b.l.t (, %s10)
1357 %5 = icmp eq i16 %0, %1
1358 %6 = select i1 %5, i64 %2, i64 %3
1362 ; Function Attrs: norecurse nounwind readnone
1363 define i64 @select_cc_u16_i64(i16 zeroext %0, i16 zeroext %1, i64 %2, i64 %3) {
1364 ; CHECK-LABEL: select_cc_u16_i64:
1366 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1367 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1368 ; CHECK-NEXT: or %s0, 0, %s3
1369 ; CHECK-NEXT: b.l.t (, %s10)
1370 %5 = icmp eq i16 %0, %1
1371 %6 = select i1 %5, i64 %2, i64 %3
1375 ; Function Attrs: norecurse nounwind readnone
1376 define i64 @select_cc_i32_i64(i32 signext %0, i32 signext %1, i64 %2, i64 %3) {
1377 ; CHECK-LABEL: select_cc_i32_i64:
1379 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1380 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1381 ; CHECK-NEXT: or %s0, 0, %s3
1382 ; CHECK-NEXT: b.l.t (, %s10)
1383 %5 = icmp eq i32 %0, %1
1384 %6 = select i1 %5, i64 %2, i64 %3
1388 ; Function Attrs: norecurse nounwind readnone
1389 define i64 @select_cc_u32_i64(i32 zeroext %0, i32 zeroext %1, i64 %2, i64 %3) {
1390 ; CHECK-LABEL: select_cc_u32_i64:
1392 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1393 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1394 ; CHECK-NEXT: or %s0, 0, %s3
1395 ; CHECK-NEXT: b.l.t (, %s10)
1396 %5 = icmp eq i32 %0, %1
1397 %6 = select i1 %5, i64 %2, i64 %3
1401 ; Function Attrs: norecurse nounwind readnone
1402 define i64 @select_cc_i64_i64(i64 %0, i64 %1, i64 %2, i64 %3) {
1403 ; CHECK-LABEL: select_cc_i64_i64:
1405 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
1406 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
1407 ; CHECK-NEXT: or %s0, 0, %s3
1408 ; CHECK-NEXT: b.l.t (, %s10)
1409 %5 = icmp eq i64 %0, %1
1410 %6 = select i1 %5, i64 %2, i64 %3
1414 ; Function Attrs: norecurse nounwind readnone
1415 define i64 @select_cc_u64_i64(i64 %0, i64 %1, i64 %2, i64 %3) {
1416 ; CHECK-LABEL: select_cc_u64_i64:
1418 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
1419 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
1420 ; CHECK-NEXT: or %s0, 0, %s3
1421 ; CHECK-NEXT: b.l.t (, %s10)
1422 %5 = icmp eq i64 %0, %1
1423 %6 = select i1 %5, i64 %2, i64 %3
1427 ; Function Attrs: norecurse nounwind readnone
1428 define i64 @select_cc_i128_i64(i128 %0, i128 %1, i64 %2, i64 %3) {
1429 ; CHECK-LABEL: select_cc_i128_i64:
1431 ; CHECK-NEXT: xor %s1, %s1, %s3
1432 ; CHECK-NEXT: xor %s0, %s0, %s2
1433 ; CHECK-NEXT: or %s0, %s0, %s1
1434 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
1435 ; CHECK-NEXT: or %s0, 0, %s5
1436 ; CHECK-NEXT: b.l.t (, %s10)
1437 %5 = icmp eq i128 %0, %1
1438 %6 = select i1 %5, i64 %2, i64 %3
1442 ; Function Attrs: norecurse nounwind readnone
1443 define i64 @select_cc_u128_i64(i128 %0, i128 %1, i64 %2, i64 %3) {
1444 ; CHECK-LABEL: select_cc_u128_i64:
1446 ; CHECK-NEXT: xor %s1, %s1, %s3
1447 ; CHECK-NEXT: xor %s0, %s0, %s2
1448 ; CHECK-NEXT: or %s0, %s0, %s1
1449 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
1450 ; CHECK-NEXT: or %s0, 0, %s5
1451 ; CHECK-NEXT: b.l.t (, %s10)
1452 %5 = icmp eq i128 %0, %1
1453 %6 = select i1 %5, i64 %2, i64 %3
1457 ; Function Attrs: norecurse nounwind readnone
1458 define i64 @select_cc_float_i64(float %0, float %1, i64 %2, i64 %3) {
1459 ; CHECK-LABEL: select_cc_float_i64:
1461 ; CHECK-NEXT: fcmp.s %s0, %s0, %s1
1462 ; CHECK-NEXT: cmov.s.eq %s3, %s2, %s0
1463 ; CHECK-NEXT: or %s0, 0, %s3
1464 ; CHECK-NEXT: b.l.t (, %s10)
1465 %5 = fcmp fast oeq float %0, %1
1466 %6 = select i1 %5, i64 %2, i64 %3
1470 ; Function Attrs: norecurse nounwind readnone
1471 define i64 @select_cc_double_i64(double %0, double %1, i64 %2, i64 %3) {
1472 ; CHECK-LABEL: select_cc_double_i64:
1474 ; CHECK-NEXT: fcmp.d %s0, %s0, %s1
1475 ; CHECK-NEXT: cmov.d.eq %s3, %s2, %s0
1476 ; CHECK-NEXT: or %s0, 0, %s3
1477 ; CHECK-NEXT: b.l.t (, %s10)
1478 %5 = fcmp fast oeq double %0, %1
1479 %6 = select i1 %5, i64 %2, i64 %3
1483 ; Function Attrs: norecurse nounwind readnone
1484 define i64 @select_cc_quad_i64(fp128 %0, fp128 %1, i64 %2, i64 %3) {
1485 ; CHECK-LABEL: select_cc_quad_i64:
1487 ; CHECK-NEXT: fcmp.q %s0, %s0, %s2
1488 ; CHECK-NEXT: cmov.d.eq %s5, %s4, %s0
1489 ; CHECK-NEXT: or %s0, 0, %s5
1490 ; CHECK-NEXT: b.l.t (, %s10)
1491 %5 = fcmp fast oeq fp128 %0, %1
1492 %6 = select i1 %5, i64 %2, i64 %3
1496 ; Function Attrs: norecurse nounwind readnone
1497 define i64 @select_cc_i1_u64(i1 zeroext %0, i1 zeroext %1, i64 %2, i64 %3) {
1498 ; CHECK-LABEL: select_cc_i1_u64:
1500 ; CHECK-NEXT: xor %s0, %s0, %s1
1501 ; CHECK-NEXT: cmov.w.ne %s2, %s3, %s0
1502 ; CHECK-NEXT: or %s0, 0, %s2
1503 ; CHECK-NEXT: b.l.t (, %s10)
1505 %6 = select i1 %5, i64 %3, i64 %2
1509 ; Function Attrs: norecurse nounwind readnone
1510 define i64 @select_cc_i8_u64(i8 signext %0, i8 signext %1, i64 %2, i64 %3) {
1511 ; CHECK-LABEL: select_cc_i8_u64:
1513 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1514 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1515 ; CHECK-NEXT: or %s0, 0, %s3
1516 ; CHECK-NEXT: b.l.t (, %s10)
1517 %5 = icmp eq i8 %0, %1
1518 %6 = select i1 %5, i64 %2, i64 %3
1522 ; Function Attrs: norecurse nounwind readnone
1523 define i64 @select_cc_u8_u64(i8 zeroext %0, i8 zeroext %1, i64 %2, i64 %3) {
1524 ; CHECK-LABEL: select_cc_u8_u64:
1526 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1527 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1528 ; CHECK-NEXT: or %s0, 0, %s3
1529 ; CHECK-NEXT: b.l.t (, %s10)
1530 %5 = icmp eq i8 %0, %1
1531 %6 = select i1 %5, i64 %2, i64 %3
1535 ; Function Attrs: norecurse nounwind readnone
1536 define i64 @select_cc_i16_u64(i16 signext %0, i16 signext %1, i64 %2, i64 %3) {
1537 ; CHECK-LABEL: select_cc_i16_u64:
1539 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1540 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1541 ; CHECK-NEXT: or %s0, 0, %s3
1542 ; CHECK-NEXT: b.l.t (, %s10)
1543 %5 = icmp eq i16 %0, %1
1544 %6 = select i1 %5, i64 %2, i64 %3
1548 ; Function Attrs: norecurse nounwind readnone
1549 define i64 @select_cc_u16_u64(i16 zeroext %0, i16 zeroext %1, i64 %2, i64 %3) {
1550 ; CHECK-LABEL: select_cc_u16_u64:
1552 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1553 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1554 ; CHECK-NEXT: or %s0, 0, %s3
1555 ; CHECK-NEXT: b.l.t (, %s10)
1556 %5 = icmp eq i16 %0, %1
1557 %6 = select i1 %5, i64 %2, i64 %3
1561 ; Function Attrs: norecurse nounwind readnone
1562 define i64 @select_cc_i32_u64(i32 signext %0, i32 signext %1, i64 %2, i64 %3) {
1563 ; CHECK-LABEL: select_cc_i32_u64:
1565 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1566 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1567 ; CHECK-NEXT: or %s0, 0, %s3
1568 ; CHECK-NEXT: b.l.t (, %s10)
1569 %5 = icmp eq i32 %0, %1
1570 %6 = select i1 %5, i64 %2, i64 %3
1574 ; Function Attrs: norecurse nounwind readnone
1575 define i64 @select_cc_u32_u64(i32 zeroext %0, i32 zeroext %1, i64 %2, i64 %3) {
1576 ; CHECK-LABEL: select_cc_u32_u64:
1578 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1579 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
1580 ; CHECK-NEXT: or %s0, 0, %s3
1581 ; CHECK-NEXT: b.l.t (, %s10)
1582 %5 = icmp eq i32 %0, %1
1583 %6 = select i1 %5, i64 %2, i64 %3
1587 ; Function Attrs: norecurse nounwind readnone
1588 define i64 @select_cc_i64_u64(i64 %0, i64 %1, i64 %2, i64 %3) {
1589 ; CHECK-LABEL: select_cc_i64_u64:
1591 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
1592 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
1593 ; CHECK-NEXT: or %s0, 0, %s3
1594 ; CHECK-NEXT: b.l.t (, %s10)
1595 %5 = icmp eq i64 %0, %1
1596 %6 = select i1 %5, i64 %2, i64 %3
1600 ; Function Attrs: norecurse nounwind readnone
1601 define i64 @select_cc_u64_u64(i64 %0, i64 %1, i64 %2, i64 %3) {
1602 ; CHECK-LABEL: select_cc_u64_u64:
1604 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
1605 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
1606 ; CHECK-NEXT: or %s0, 0, %s3
1607 ; CHECK-NEXT: b.l.t (, %s10)
1608 %5 = icmp eq i64 %0, %1
1609 %6 = select i1 %5, i64 %2, i64 %3
1613 ; Function Attrs: norecurse nounwind readnone
1614 define i64 @select_cc_i128_u64(i128 %0, i128 %1, i64 %2, i64 %3) {
1615 ; CHECK-LABEL: select_cc_i128_u64:
1617 ; CHECK-NEXT: xor %s1, %s1, %s3
1618 ; CHECK-NEXT: xor %s0, %s0, %s2
1619 ; CHECK-NEXT: or %s0, %s0, %s1
1620 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
1621 ; CHECK-NEXT: or %s0, 0, %s5
1622 ; CHECK-NEXT: b.l.t (, %s10)
1623 %5 = icmp eq i128 %0, %1
1624 %6 = select i1 %5, i64 %2, i64 %3
1628 ; Function Attrs: norecurse nounwind readnone
1629 define i64 @select_cc_u128_u64(i128 %0, i128 %1, i64 %2, i64 %3) {
1630 ; CHECK-LABEL: select_cc_u128_u64:
1632 ; CHECK-NEXT: xor %s1, %s1, %s3
1633 ; CHECK-NEXT: xor %s0, %s0, %s2
1634 ; CHECK-NEXT: or %s0, %s0, %s1
1635 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
1636 ; CHECK-NEXT: or %s0, 0, %s5
1637 ; CHECK-NEXT: b.l.t (, %s10)
1638 %5 = icmp eq i128 %0, %1
1639 %6 = select i1 %5, i64 %2, i64 %3
1643 ; Function Attrs: norecurse nounwind readnone
1644 define i64 @select_cc_float_u64(float %0, float %1, i64 %2, i64 %3) {
1645 ; CHECK-LABEL: select_cc_float_u64:
1647 ; CHECK-NEXT: fcmp.s %s0, %s0, %s1
1648 ; CHECK-NEXT: cmov.s.eq %s3, %s2, %s0
1649 ; CHECK-NEXT: or %s0, 0, %s3
1650 ; CHECK-NEXT: b.l.t (, %s10)
1651 %5 = fcmp fast oeq float %0, %1
1652 %6 = select i1 %5, i64 %2, i64 %3
1656 ; Function Attrs: norecurse nounwind readnone
1657 define i64 @select_cc_double_u64(double %0, double %1, i64 %2, i64 %3) {
1658 ; CHECK-LABEL: select_cc_double_u64:
1660 ; CHECK-NEXT: fcmp.d %s0, %s0, %s1
1661 ; CHECK-NEXT: cmov.d.eq %s3, %s2, %s0
1662 ; CHECK-NEXT: or %s0, 0, %s3
1663 ; CHECK-NEXT: b.l.t (, %s10)
1664 %5 = fcmp fast oeq double %0, %1
1665 %6 = select i1 %5, i64 %2, i64 %3
1669 ; Function Attrs: norecurse nounwind readnone
1670 define i64 @select_cc_quad_u64(fp128 %0, fp128 %1, i64 %2, i64 %3) {
1671 ; CHECK-LABEL: select_cc_quad_u64:
1673 ; CHECK-NEXT: fcmp.q %s0, %s0, %s2
1674 ; CHECK-NEXT: cmov.d.eq %s5, %s4, %s0
1675 ; CHECK-NEXT: or %s0, 0, %s5
1676 ; CHECK-NEXT: b.l.t (, %s10)
1677 %5 = fcmp fast oeq fp128 %0, %1
1678 %6 = select i1 %5, i64 %2, i64 %3
1682 ; Function Attrs: norecurse nounwind readnone
1683 define i128 @select_cc_i1_i128(i1 zeroext %0, i1 zeroext %1, i128 %2, i128 %3) {
1684 ; CHECK-LABEL: select_cc_i1_i128:
1686 ; CHECK-NEXT: xor %s0, %s0, %s1
1687 ; CHECK-NEXT: cmov.w.ne %s2, %s4, %s0
1688 ; CHECK-NEXT: cmov.w.ne %s3, %s5, %s0
1689 ; CHECK-NEXT: or %s0, 0, %s2
1690 ; CHECK-NEXT: or %s1, 0, %s3
1691 ; CHECK-NEXT: b.l.t (, %s10)
1693 %6 = select i1 %5, i128 %3, i128 %2
1697 ; Function Attrs: norecurse nounwind readnone
1698 define i128 @select_cc_i8_i128(i8 signext %0, i8 signext %1, i128 %2, i128 %3) {
1699 ; CHECK-LABEL: select_cc_i8_i128:
1701 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1702 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
1703 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
1704 ; CHECK-NEXT: or %s0, 0, %s4
1705 ; CHECK-NEXT: or %s1, 0, %s5
1706 ; CHECK-NEXT: b.l.t (, %s10)
1707 %5 = icmp eq i8 %0, %1
1708 %6 = select i1 %5, i128 %2, i128 %3
1712 ; Function Attrs: norecurse nounwind readnone
1713 define i128 @select_cc_u8_i128(i8 zeroext %0, i8 zeroext %1, i128 %2, i128 %3) {
1714 ; CHECK-LABEL: select_cc_u8_i128:
1716 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1717 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
1718 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
1719 ; CHECK-NEXT: or %s0, 0, %s4
1720 ; CHECK-NEXT: or %s1, 0, %s5
1721 ; CHECK-NEXT: b.l.t (, %s10)
1722 %5 = icmp eq i8 %0, %1
1723 %6 = select i1 %5, i128 %2, i128 %3
1727 ; Function Attrs: norecurse nounwind readnone
1728 define i128 @select_cc_i16_i128(i16 signext %0, i16 signext %1, i128 %2, i128 %3) {
1729 ; CHECK-LABEL: select_cc_i16_i128:
1731 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1732 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
1733 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
1734 ; CHECK-NEXT: or %s0, 0, %s4
1735 ; CHECK-NEXT: or %s1, 0, %s5
1736 ; CHECK-NEXT: b.l.t (, %s10)
1737 %5 = icmp eq i16 %0, %1
1738 %6 = select i1 %5, i128 %2, i128 %3
1742 ; Function Attrs: norecurse nounwind readnone
1743 define i128 @select_cc_u16_i128(i16 zeroext %0, i16 zeroext %1, i128 %2, i128 %3) {
1744 ; CHECK-LABEL: select_cc_u16_i128:
1746 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1747 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
1748 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
1749 ; CHECK-NEXT: or %s0, 0, %s4
1750 ; CHECK-NEXT: or %s1, 0, %s5
1751 ; CHECK-NEXT: b.l.t (, %s10)
1752 %5 = icmp eq i16 %0, %1
1753 %6 = select i1 %5, i128 %2, i128 %3
1757 ; Function Attrs: norecurse nounwind readnone
1758 define i128 @select_cc_i32_i128(i32 signext %0, i32 signext %1, i128 %2, i128 %3) {
1759 ; CHECK-LABEL: select_cc_i32_i128:
1761 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1762 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
1763 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
1764 ; CHECK-NEXT: or %s0, 0, %s4
1765 ; CHECK-NEXT: or %s1, 0, %s5
1766 ; CHECK-NEXT: b.l.t (, %s10)
1767 %5 = icmp eq i32 %0, %1
1768 %6 = select i1 %5, i128 %2, i128 %3
1772 ; Function Attrs: norecurse nounwind readnone
1773 define i128 @select_cc_u32_i128(i32 zeroext %0, i32 zeroext %1, i128 %2, i128 %3) {
1774 ; CHECK-LABEL: select_cc_u32_i128:
1776 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1777 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
1778 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
1779 ; CHECK-NEXT: or %s0, 0, %s4
1780 ; CHECK-NEXT: or %s1, 0, %s5
1781 ; CHECK-NEXT: b.l.t (, %s10)
1782 %5 = icmp eq i32 %0, %1
1783 %6 = select i1 %5, i128 %2, i128 %3
1787 ; Function Attrs: norecurse nounwind readnone
1788 define i128 @select_cc_i64_i128(i64 %0, i64 %1, i128 %2, i128 %3) {
1789 ; CHECK-LABEL: select_cc_i64_i128:
1791 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
1792 ; CHECK-NEXT: cmov.l.eq %s4, %s2, %s0
1793 ; CHECK-NEXT: cmov.l.eq %s5, %s3, %s0
1794 ; CHECK-NEXT: or %s0, 0, %s4
1795 ; CHECK-NEXT: or %s1, 0, %s5
1796 ; CHECK-NEXT: b.l.t (, %s10)
1797 %5 = icmp eq i64 %0, %1
1798 %6 = select i1 %5, i128 %2, i128 %3
1802 ; Function Attrs: norecurse nounwind readnone
1803 define i128 @select_cc_u64_i128(i64 %0, i64 %1, i128 %2, i128 %3) {
1804 ; CHECK-LABEL: select_cc_u64_i128:
1806 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
1807 ; CHECK-NEXT: cmov.l.eq %s4, %s2, %s0
1808 ; CHECK-NEXT: cmov.l.eq %s5, %s3, %s0
1809 ; CHECK-NEXT: or %s0, 0, %s4
1810 ; CHECK-NEXT: or %s1, 0, %s5
1811 ; CHECK-NEXT: b.l.t (, %s10)
1812 %5 = icmp eq i64 %0, %1
1813 %6 = select i1 %5, i128 %2, i128 %3
1817 ; Function Attrs: norecurse nounwind readnone
1818 define i128 @select_cc_i128_i128(i128 %0, i128 %1, i128 %2, i128 %3) {
1819 ; CHECK-LABEL: select_cc_i128_i128:
1821 ; CHECK-NEXT: xor %s1, %s1, %s3
1822 ; CHECK-NEXT: xor %s0, %s0, %s2
1823 ; CHECK-NEXT: or %s0, %s0, %s1
1824 ; CHECK-NEXT: cmov.l.eq %s6, %s4, %s0
1825 ; CHECK-NEXT: cmov.l.eq %s7, %s5, %s0
1826 ; CHECK-NEXT: or %s0, 0, %s6
1827 ; CHECK-NEXT: or %s1, 0, %s7
1828 ; CHECK-NEXT: b.l.t (, %s10)
1829 %5 = icmp eq i128 %0, %1
1830 %6 = select i1 %5, i128 %2, i128 %3
1834 ; Function Attrs: norecurse nounwind readnone
1835 define i128 @select_cc_u128_i128(i128 %0, i128 %1, i128 %2, i128 %3) {
1836 ; CHECK-LABEL: select_cc_u128_i128:
1838 ; CHECK-NEXT: xor %s1, %s1, %s3
1839 ; CHECK-NEXT: xor %s0, %s0, %s2
1840 ; CHECK-NEXT: or %s0, %s0, %s1
1841 ; CHECK-NEXT: cmov.l.eq %s6, %s4, %s0
1842 ; CHECK-NEXT: cmov.l.eq %s7, %s5, %s0
1843 ; CHECK-NEXT: or %s0, 0, %s6
1844 ; CHECK-NEXT: or %s1, 0, %s7
1845 ; CHECK-NEXT: b.l.t (, %s10)
1846 %5 = icmp eq i128 %0, %1
1847 %6 = select i1 %5, i128 %2, i128 %3
1851 ; Function Attrs: norecurse nounwind readnone
1852 define i128 @select_cc_float_i128(float %0, float %1, i128 %2, i128 %3) {
1853 ; CHECK-LABEL: select_cc_float_i128:
1855 ; CHECK-NEXT: fcmp.s %s0, %s0, %s1
1856 ; CHECK-NEXT: cmov.s.eq %s4, %s2, %s0
1857 ; CHECK-NEXT: cmov.s.eq %s5, %s3, %s0
1858 ; CHECK-NEXT: or %s0, 0, %s4
1859 ; CHECK-NEXT: or %s1, 0, %s5
1860 ; CHECK-NEXT: b.l.t (, %s10)
1861 %5 = fcmp fast oeq float %0, %1
1862 %6 = select i1 %5, i128 %2, i128 %3
1866 ; Function Attrs: norecurse nounwind readnone
1867 define i128 @select_cc_double_i128(double %0, double %1, i128 %2, i128 %3) {
1868 ; CHECK-LABEL: select_cc_double_i128:
1870 ; CHECK-NEXT: fcmp.d %s0, %s0, %s1
1871 ; CHECK-NEXT: cmov.d.eq %s4, %s2, %s0
1872 ; CHECK-NEXT: cmov.d.eq %s5, %s3, %s0
1873 ; CHECK-NEXT: or %s0, 0, %s4
1874 ; CHECK-NEXT: or %s1, 0, %s5
1875 ; CHECK-NEXT: b.l.t (, %s10)
1876 %5 = fcmp fast oeq double %0, %1
1877 %6 = select i1 %5, i128 %2, i128 %3
1881 ; Function Attrs: norecurse nounwind readnone
1882 define i128 @select_cc_quad_i128(fp128 %0, fp128 %1, i128 %2, i128 %3) {
1883 ; CHECK-LABEL: select_cc_quad_i128:
1885 ; CHECK-NEXT: fcmp.q %s0, %s0, %s2
1886 ; CHECK-NEXT: cmov.d.eq %s6, %s4, %s0
1887 ; CHECK-NEXT: cmov.d.eq %s7, %s5, %s0
1888 ; CHECK-NEXT: or %s0, 0, %s6
1889 ; CHECK-NEXT: or %s1, 0, %s7
1890 ; CHECK-NEXT: b.l.t (, %s10)
1891 %5 = fcmp fast oeq fp128 %0, %1
1892 %6 = select i1 %5, i128 %2, i128 %3
1896 ; Function Attrs: norecurse nounwind readnone
1897 define i128 @select_cc_i1_u128(i1 zeroext %0, i1 zeroext %1, i128 %2, i128 %3) {
1898 ; CHECK-LABEL: select_cc_i1_u128:
1900 ; CHECK-NEXT: xor %s0, %s0, %s1
1901 ; CHECK-NEXT: cmov.w.ne %s2, %s4, %s0
1902 ; CHECK-NEXT: cmov.w.ne %s3, %s5, %s0
1903 ; CHECK-NEXT: or %s0, 0, %s2
1904 ; CHECK-NEXT: or %s1, 0, %s3
1905 ; CHECK-NEXT: b.l.t (, %s10)
1907 %6 = select i1 %5, i128 %3, i128 %2
1911 ; Function Attrs: norecurse nounwind readnone
1912 define i128 @select_cc_i8_u128(i8 signext %0, i8 signext %1, i128 %2, i128 %3) {
1913 ; CHECK-LABEL: select_cc_i8_u128:
1915 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1916 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
1917 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
1918 ; CHECK-NEXT: or %s0, 0, %s4
1919 ; CHECK-NEXT: or %s1, 0, %s5
1920 ; CHECK-NEXT: b.l.t (, %s10)
1921 %5 = icmp eq i8 %0, %1
1922 %6 = select i1 %5, i128 %2, i128 %3
1926 ; Function Attrs: norecurse nounwind readnone
1927 define i128 @select_cc_u8_u128(i8 zeroext %0, i8 zeroext %1, i128 %2, i128 %3) {
1928 ; CHECK-LABEL: select_cc_u8_u128:
1930 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1931 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
1932 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
1933 ; CHECK-NEXT: or %s0, 0, %s4
1934 ; CHECK-NEXT: or %s1, 0, %s5
1935 ; CHECK-NEXT: b.l.t (, %s10)
1936 %5 = icmp eq i8 %0, %1
1937 %6 = select i1 %5, i128 %2, i128 %3
1941 ; Function Attrs: norecurse nounwind readnone
1942 define i128 @select_cc_i16_u128(i16 signext %0, i16 signext %1, i128 %2, i128 %3) {
1943 ; CHECK-LABEL: select_cc_i16_u128:
1945 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1946 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
1947 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
1948 ; CHECK-NEXT: or %s0, 0, %s4
1949 ; CHECK-NEXT: or %s1, 0, %s5
1950 ; CHECK-NEXT: b.l.t (, %s10)
1951 %5 = icmp eq i16 %0, %1
1952 %6 = select i1 %5, i128 %2, i128 %3
1956 ; Function Attrs: norecurse nounwind readnone
1957 define i128 @select_cc_u16_u128(i16 zeroext %0, i16 zeroext %1, i128 %2, i128 %3) {
1958 ; CHECK-LABEL: select_cc_u16_u128:
1960 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1961 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
1962 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
1963 ; CHECK-NEXT: or %s0, 0, %s4
1964 ; CHECK-NEXT: or %s1, 0, %s5
1965 ; CHECK-NEXT: b.l.t (, %s10)
1966 %5 = icmp eq i16 %0, %1
1967 %6 = select i1 %5, i128 %2, i128 %3
1971 ; Function Attrs: norecurse nounwind readnone
1972 define i128 @select_cc_i32_u128(i32 signext %0, i32 signext %1, i128 %2, i128 %3) {
1973 ; CHECK-LABEL: select_cc_i32_u128:
1975 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1976 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
1977 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
1978 ; CHECK-NEXT: or %s0, 0, %s4
1979 ; CHECK-NEXT: or %s1, 0, %s5
1980 ; CHECK-NEXT: b.l.t (, %s10)
1981 %5 = icmp eq i32 %0, %1
1982 %6 = select i1 %5, i128 %2, i128 %3
1986 ; Function Attrs: norecurse nounwind readnone
1987 define i128 @select_cc_u32_u128(i32 zeroext %0, i32 zeroext %1, i128 %2, i128 %3) {
1988 ; CHECK-LABEL: select_cc_u32_u128:
1990 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
1991 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
1992 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
1993 ; CHECK-NEXT: or %s0, 0, %s4
1994 ; CHECK-NEXT: or %s1, 0, %s5
1995 ; CHECK-NEXT: b.l.t (, %s10)
1996 %5 = icmp eq i32 %0, %1
1997 %6 = select i1 %5, i128 %2, i128 %3
2001 ; Function Attrs: norecurse nounwind readnone
2002 define i128 @select_cc_i64_u128(i64 %0, i64 %1, i128 %2, i128 %3) {
2003 ; CHECK-LABEL: select_cc_i64_u128:
2005 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
2006 ; CHECK-NEXT: cmov.l.eq %s4, %s2, %s0
2007 ; CHECK-NEXT: cmov.l.eq %s5, %s3, %s0
2008 ; CHECK-NEXT: or %s0, 0, %s4
2009 ; CHECK-NEXT: or %s1, 0, %s5
2010 ; CHECK-NEXT: b.l.t (, %s10)
2011 %5 = icmp eq i64 %0, %1
2012 %6 = select i1 %5, i128 %2, i128 %3
2016 ; Function Attrs: norecurse nounwind readnone
2017 define i128 @select_cc_u64_u128(i64 %0, i64 %1, i128 %2, i128 %3) {
2018 ; CHECK-LABEL: select_cc_u64_u128:
2020 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
2021 ; CHECK-NEXT: cmov.l.eq %s4, %s2, %s0
2022 ; CHECK-NEXT: cmov.l.eq %s5, %s3, %s0
2023 ; CHECK-NEXT: or %s0, 0, %s4
2024 ; CHECK-NEXT: or %s1, 0, %s5
2025 ; CHECK-NEXT: b.l.t (, %s10)
2026 %5 = icmp eq i64 %0, %1
2027 %6 = select i1 %5, i128 %2, i128 %3
2031 ; Function Attrs: norecurse nounwind readnone
2032 define i128 @select_cc_i128_u128(i128 %0, i128 %1, i128 %2, i128 %3) {
2033 ; CHECK-LABEL: select_cc_i128_u128:
2035 ; CHECK-NEXT: xor %s1, %s1, %s3
2036 ; CHECK-NEXT: xor %s0, %s0, %s2
2037 ; CHECK-NEXT: or %s0, %s0, %s1
2038 ; CHECK-NEXT: cmov.l.eq %s6, %s4, %s0
2039 ; CHECK-NEXT: cmov.l.eq %s7, %s5, %s0
2040 ; CHECK-NEXT: or %s0, 0, %s6
2041 ; CHECK-NEXT: or %s1, 0, %s7
2042 ; CHECK-NEXT: b.l.t (, %s10)
2043 %5 = icmp eq i128 %0, %1
2044 %6 = select i1 %5, i128 %2, i128 %3
2048 ; Function Attrs: norecurse nounwind readnone
2049 define i128 @select_cc_u128_u128(i128 %0, i128 %1, i128 %2, i128 %3) {
2050 ; CHECK-LABEL: select_cc_u128_u128:
2052 ; CHECK-NEXT: xor %s1, %s1, %s3
2053 ; CHECK-NEXT: xor %s0, %s0, %s2
2054 ; CHECK-NEXT: or %s0, %s0, %s1
2055 ; CHECK-NEXT: cmov.l.eq %s6, %s4, %s0
2056 ; CHECK-NEXT: cmov.l.eq %s7, %s5, %s0
2057 ; CHECK-NEXT: or %s0, 0, %s6
2058 ; CHECK-NEXT: or %s1, 0, %s7
2059 ; CHECK-NEXT: b.l.t (, %s10)
2060 %5 = icmp eq i128 %0, %1
2061 %6 = select i1 %5, i128 %2, i128 %3
2065 ; Function Attrs: norecurse nounwind readnone
2066 define i128 @select_cc_float_u128(float %0, float %1, i128 %2, i128 %3) {
2067 ; CHECK-LABEL: select_cc_float_u128:
2069 ; CHECK-NEXT: fcmp.s %s0, %s0, %s1
2070 ; CHECK-NEXT: cmov.s.eq %s4, %s2, %s0
2071 ; CHECK-NEXT: cmov.s.eq %s5, %s3, %s0
2072 ; CHECK-NEXT: or %s0, 0, %s4
2073 ; CHECK-NEXT: or %s1, 0, %s5
2074 ; CHECK-NEXT: b.l.t (, %s10)
2075 %5 = fcmp fast oeq float %0, %1
2076 %6 = select i1 %5, i128 %2, i128 %3
2080 ; Function Attrs: norecurse nounwind readnone
2081 define i128 @select_cc_double_u128(double %0, double %1, i128 %2, i128 %3) {
2082 ; CHECK-LABEL: select_cc_double_u128:
2084 ; CHECK-NEXT: fcmp.d %s0, %s0, %s1
2085 ; CHECK-NEXT: cmov.d.eq %s4, %s2, %s0
2086 ; CHECK-NEXT: cmov.d.eq %s5, %s3, %s0
2087 ; CHECK-NEXT: or %s0, 0, %s4
2088 ; CHECK-NEXT: or %s1, 0, %s5
2089 ; CHECK-NEXT: b.l.t (, %s10)
2090 %5 = fcmp fast oeq double %0, %1
2091 %6 = select i1 %5, i128 %2, i128 %3
2095 ; Function Attrs: norecurse nounwind readnone
2096 define i128 @select_cc_quad_u128(fp128 %0, fp128 %1, i128 %2, i128 %3) {
2097 ; CHECK-LABEL: select_cc_quad_u128:
2099 ; CHECK-NEXT: fcmp.q %s0, %s0, %s2
2100 ; CHECK-NEXT: cmov.d.eq %s6, %s4, %s0
2101 ; CHECK-NEXT: cmov.d.eq %s7, %s5, %s0
2102 ; CHECK-NEXT: or %s0, 0, %s6
2103 ; CHECK-NEXT: or %s1, 0, %s7
2104 ; CHECK-NEXT: b.l.t (, %s10)
2105 %5 = fcmp fast oeq fp128 %0, %1
2106 %6 = select i1 %5, i128 %2, i128 %3
2110 ; Function Attrs: norecurse nounwind readnone
2111 define float @select_cc_i1_float(i1 zeroext %0, i1 zeroext %1, float %2, float %3) {
2112 ; CHECK-LABEL: select_cc_i1_float:
2114 ; CHECK-NEXT: xor %s0, %s0, %s1
2115 ; CHECK-NEXT: cmov.w.ne %s2, %s3, %s0
2116 ; CHECK-NEXT: or %s0, 0, %s2
2117 ; CHECK-NEXT: b.l.t (, %s10)
2119 %6 = select fast i1 %5, float %3, float %2
2123 ; Function Attrs: norecurse nounwind readnone
2124 define float @select_cc_i8_float(i8 signext %0, i8 signext %1, float %2, float %3) {
2125 ; CHECK-LABEL: select_cc_i8_float:
2127 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2128 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
2129 ; CHECK-NEXT: or %s0, 0, %s3
2130 ; CHECK-NEXT: b.l.t (, %s10)
2131 %5 = icmp eq i8 %0, %1
2132 %6 = select fast i1 %5, float %2, float %3
2136 ; Function Attrs: norecurse nounwind readnone
2137 define float @select_cc_u8_float(i8 zeroext %0, i8 zeroext %1, float %2, float %3) {
2138 ; CHECK-LABEL: select_cc_u8_float:
2140 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2141 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
2142 ; CHECK-NEXT: or %s0, 0, %s3
2143 ; CHECK-NEXT: b.l.t (, %s10)
2144 %5 = icmp eq i8 %0, %1
2145 %6 = select fast i1 %5, float %2, float %3
2149 ; Function Attrs: norecurse nounwind readnone
2150 define float @select_cc_i16_float(i16 signext %0, i16 signext %1, float %2, float %3) {
2151 ; CHECK-LABEL: select_cc_i16_float:
2153 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2154 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
2155 ; CHECK-NEXT: or %s0, 0, %s3
2156 ; CHECK-NEXT: b.l.t (, %s10)
2157 %5 = icmp eq i16 %0, %1
2158 %6 = select fast i1 %5, float %2, float %3
2162 ; Function Attrs: norecurse nounwind readnone
2163 define float @select_cc_u16_float(i16 zeroext %0, i16 zeroext %1, float %2, float %3) {
2164 ; CHECK-LABEL: select_cc_u16_float:
2166 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2167 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
2168 ; CHECK-NEXT: or %s0, 0, %s3
2169 ; CHECK-NEXT: b.l.t (, %s10)
2170 %5 = icmp eq i16 %0, %1
2171 %6 = select fast i1 %5, float %2, float %3
2175 ; Function Attrs: norecurse nounwind readnone
2176 define float @select_cc_i32_float(i32 signext %0, i32 signext %1, float %2, float %3) {
2177 ; CHECK-LABEL: select_cc_i32_float:
2179 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2180 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
2181 ; CHECK-NEXT: or %s0, 0, %s3
2182 ; CHECK-NEXT: b.l.t (, %s10)
2183 %5 = icmp eq i32 %0, %1
2184 %6 = select fast i1 %5, float %2, float %3
2188 ; Function Attrs: norecurse nounwind readnone
2189 define float @select_cc_u32_float(i32 zeroext %0, i32 zeroext %1, float %2, float %3) {
2190 ; CHECK-LABEL: select_cc_u32_float:
2192 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2193 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
2194 ; CHECK-NEXT: or %s0, 0, %s3
2195 ; CHECK-NEXT: b.l.t (, %s10)
2196 %5 = icmp eq i32 %0, %1
2197 %6 = select fast i1 %5, float %2, float %3
2201 ; Function Attrs: norecurse nounwind readnone
2202 define float @select_cc_i64_float(i64 %0, i64 %1, float %2, float %3) {
2203 ; CHECK-LABEL: select_cc_i64_float:
2205 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
2206 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
2207 ; CHECK-NEXT: or %s0, 0, %s3
2208 ; CHECK-NEXT: b.l.t (, %s10)
2209 %5 = icmp eq i64 %0, %1
2210 %6 = select fast i1 %5, float %2, float %3
2214 ; Function Attrs: norecurse nounwind readnone
2215 define float @select_cc_u64_float(i64 %0, i64 %1, float %2, float %3) {
2216 ; CHECK-LABEL: select_cc_u64_float:
2218 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
2219 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
2220 ; CHECK-NEXT: or %s0, 0, %s3
2221 ; CHECK-NEXT: b.l.t (, %s10)
2222 %5 = icmp eq i64 %0, %1
2223 %6 = select fast i1 %5, float %2, float %3
2227 ; Function Attrs: norecurse nounwind readnone
2228 define float @select_cc_i128_float(i128 %0, i128 %1, float %2, float %3) {
2229 ; CHECK-LABEL: select_cc_i128_float:
2231 ; CHECK-NEXT: xor %s1, %s1, %s3
2232 ; CHECK-NEXT: xor %s0, %s0, %s2
2233 ; CHECK-NEXT: or %s0, %s0, %s1
2234 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
2235 ; CHECK-NEXT: or %s0, 0, %s5
2236 ; CHECK-NEXT: b.l.t (, %s10)
2237 %5 = icmp eq i128 %0, %1
2238 %6 = select fast i1 %5, float %2, float %3
2242 ; Function Attrs: norecurse nounwind readnone
2243 define float @select_cc_u128_float(i128 %0, i128 %1, float %2, float %3) {
2244 ; CHECK-LABEL: select_cc_u128_float:
2246 ; CHECK-NEXT: xor %s1, %s1, %s3
2247 ; CHECK-NEXT: xor %s0, %s0, %s2
2248 ; CHECK-NEXT: or %s0, %s0, %s1
2249 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
2250 ; CHECK-NEXT: or %s0, 0, %s5
2251 ; CHECK-NEXT: b.l.t (, %s10)
2252 %5 = icmp eq i128 %0, %1
2253 %6 = select fast i1 %5, float %2, float %3
2257 ; Function Attrs: norecurse nounwind readnone
2258 define float @select_cc_float_float(float %0, float %1, float %2, float %3) {
2259 ; CHECK-LABEL: select_cc_float_float:
2261 ; CHECK-NEXT: fcmp.s %s0, %s0, %s1
2262 ; CHECK-NEXT: cmov.s.eq %s3, %s2, %s0
2263 ; CHECK-NEXT: or %s0, 0, %s3
2264 ; CHECK-NEXT: b.l.t (, %s10)
2265 %5 = fcmp fast oeq float %0, %1
2266 %6 = select fast i1 %5, float %2, float %3
2270 ; Function Attrs: norecurse nounwind readnone
2271 define float @select_cc_double_float(double %0, double %1, float %2, float %3) {
2272 ; CHECK-LABEL: select_cc_double_float:
2274 ; CHECK-NEXT: fcmp.d %s0, %s0, %s1
2275 ; CHECK-NEXT: cmov.d.eq %s3, %s2, %s0
2276 ; CHECK-NEXT: or %s0, 0, %s3
2277 ; CHECK-NEXT: b.l.t (, %s10)
2278 %5 = fcmp fast oeq double %0, %1
2279 %6 = select fast i1 %5, float %2, float %3
2283 ; Function Attrs: norecurse nounwind readnone
2284 define float @select_cc_quad_float(fp128 %0, fp128 %1, float %2, float %3) {
2285 ; CHECK-LABEL: select_cc_quad_float:
2287 ; CHECK-NEXT: fcmp.q %s0, %s0, %s2
2288 ; CHECK-NEXT: cmov.d.eq %s5, %s4, %s0
2289 ; CHECK-NEXT: or %s0, 0, %s5
2290 ; CHECK-NEXT: b.l.t (, %s10)
2291 %5 = fcmp fast oeq fp128 %0, %1
2292 %6 = select fast i1 %5, float %2, float %3
2296 ; Function Attrs: norecurse nounwind readnone
2297 define double @select_cc_i1_double(i1 zeroext %0, i1 zeroext %1, double %2, double %3) {
2298 ; CHECK-LABEL: select_cc_i1_double:
2300 ; CHECK-NEXT: xor %s0, %s0, %s1
2301 ; CHECK-NEXT: cmov.w.ne %s2, %s3, %s0
2302 ; CHECK-NEXT: or %s0, 0, %s2
2303 ; CHECK-NEXT: b.l.t (, %s10)
2305 %6 = select fast i1 %5, double %3, double %2
2309 ; Function Attrs: norecurse nounwind readnone
2310 define double @select_cc_i8_double(i8 signext %0, i8 signext %1, double %2, double %3) {
2311 ; CHECK-LABEL: select_cc_i8_double:
2313 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2314 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
2315 ; CHECK-NEXT: or %s0, 0, %s3
2316 ; CHECK-NEXT: b.l.t (, %s10)
2317 %5 = icmp eq i8 %0, %1
2318 %6 = select fast i1 %5, double %2, double %3
2322 ; Function Attrs: norecurse nounwind readnone
2323 define double @select_cc_u8_double(i8 zeroext %0, i8 zeroext %1, double %2, double %3) {
2324 ; CHECK-LABEL: select_cc_u8_double:
2326 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2327 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
2328 ; CHECK-NEXT: or %s0, 0, %s3
2329 ; CHECK-NEXT: b.l.t (, %s10)
2330 %5 = icmp eq i8 %0, %1
2331 %6 = select fast i1 %5, double %2, double %3
2335 ; Function Attrs: norecurse nounwind readnone
2336 define double @select_cc_i16_double(i16 signext %0, i16 signext %1, double %2, double %3) {
2337 ; CHECK-LABEL: select_cc_i16_double:
2339 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2340 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
2341 ; CHECK-NEXT: or %s0, 0, %s3
2342 ; CHECK-NEXT: b.l.t (, %s10)
2343 %5 = icmp eq i16 %0, %1
2344 %6 = select fast i1 %5, double %2, double %3
2348 ; Function Attrs: norecurse nounwind readnone
2349 define double @select_cc_u16_double(i16 zeroext %0, i16 zeroext %1, double %2, double %3) {
2350 ; CHECK-LABEL: select_cc_u16_double:
2352 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2353 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
2354 ; CHECK-NEXT: or %s0, 0, %s3
2355 ; CHECK-NEXT: b.l.t (, %s10)
2356 %5 = icmp eq i16 %0, %1
2357 %6 = select fast i1 %5, double %2, double %3
2361 ; Function Attrs: norecurse nounwind readnone
2362 define double @select_cc_i32_double(i32 signext %0, i32 signext %1, double %2, double %3) {
2363 ; CHECK-LABEL: select_cc_i32_double:
2365 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2366 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
2367 ; CHECK-NEXT: or %s0, 0, %s3
2368 ; CHECK-NEXT: b.l.t (, %s10)
2369 %5 = icmp eq i32 %0, %1
2370 %6 = select fast i1 %5, double %2, double %3
2374 ; Function Attrs: norecurse nounwind readnone
2375 define double @select_cc_u32_double(i32 zeroext %0, i32 zeroext %1, double %2, double %3) {
2376 ; CHECK-LABEL: select_cc_u32_double:
2378 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2379 ; CHECK-NEXT: cmov.w.eq %s3, %s2, %s0
2380 ; CHECK-NEXT: or %s0, 0, %s3
2381 ; CHECK-NEXT: b.l.t (, %s10)
2382 %5 = icmp eq i32 %0, %1
2383 %6 = select fast i1 %5, double %2, double %3
2387 ; Function Attrs: norecurse nounwind readnone
2388 define double @select_cc_i64_double(i64 %0, i64 %1, double %2, double %3) {
2389 ; CHECK-LABEL: select_cc_i64_double:
2391 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
2392 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
2393 ; CHECK-NEXT: or %s0, 0, %s3
2394 ; CHECK-NEXT: b.l.t (, %s10)
2395 %5 = icmp eq i64 %0, %1
2396 %6 = select fast i1 %5, double %2, double %3
2400 ; Function Attrs: norecurse nounwind readnone
2401 define double @select_cc_u64_double(i64 %0, i64 %1, double %2, double %3) {
2402 ; CHECK-LABEL: select_cc_u64_double:
2404 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
2405 ; CHECK-NEXT: cmov.l.eq %s3, %s2, %s0
2406 ; CHECK-NEXT: or %s0, 0, %s3
2407 ; CHECK-NEXT: b.l.t (, %s10)
2408 %5 = icmp eq i64 %0, %1
2409 %6 = select fast i1 %5, double %2, double %3
2413 ; Function Attrs: norecurse nounwind readnone
2414 define double @select_cc_i128_double(i128 %0, i128 %1, double %2, double %3) {
2415 ; CHECK-LABEL: select_cc_i128_double:
2417 ; CHECK-NEXT: xor %s1, %s1, %s3
2418 ; CHECK-NEXT: xor %s0, %s0, %s2
2419 ; CHECK-NEXT: or %s0, %s0, %s1
2420 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
2421 ; CHECK-NEXT: or %s0, 0, %s5
2422 ; CHECK-NEXT: b.l.t (, %s10)
2423 %5 = icmp eq i128 %0, %1
2424 %6 = select fast i1 %5, double %2, double %3
2428 ; Function Attrs: norecurse nounwind readnone
2429 define double @select_cc_u128_double(i128 %0, i128 %1, double %2, double %3) {
2430 ; CHECK-LABEL: select_cc_u128_double:
2432 ; CHECK-NEXT: xor %s1, %s1, %s3
2433 ; CHECK-NEXT: xor %s0, %s0, %s2
2434 ; CHECK-NEXT: or %s0, %s0, %s1
2435 ; CHECK-NEXT: cmov.l.eq %s5, %s4, %s0
2436 ; CHECK-NEXT: or %s0, 0, %s5
2437 ; CHECK-NEXT: b.l.t (, %s10)
2438 %5 = icmp eq i128 %0, %1
2439 %6 = select fast i1 %5, double %2, double %3
2443 ; Function Attrs: norecurse nounwind readnone
2444 define double @select_cc_float_double(float %0, float %1, double %2, double %3) {
2445 ; CHECK-LABEL: select_cc_float_double:
2447 ; CHECK-NEXT: fcmp.s %s0, %s0, %s1
2448 ; CHECK-NEXT: cmov.s.eq %s3, %s2, %s0
2449 ; CHECK-NEXT: or %s0, 0, %s3
2450 ; CHECK-NEXT: b.l.t (, %s10)
2451 %5 = fcmp fast oeq float %0, %1
2452 %6 = select fast i1 %5, double %2, double %3
2456 ; Function Attrs: norecurse nounwind readnone
2457 define double @select_cc_double_double(double %0, double %1, double %2, double %3) {
2458 ; CHECK-LABEL: select_cc_double_double:
2460 ; CHECK-NEXT: fcmp.d %s0, %s0, %s1
2461 ; CHECK-NEXT: cmov.d.eq %s3, %s2, %s0
2462 ; CHECK-NEXT: or %s0, 0, %s3
2463 ; CHECK-NEXT: b.l.t (, %s10)
2464 %5 = fcmp fast oeq double %0, %1
2465 %6 = select fast i1 %5, double %2, double %3
2469 ; Function Attrs: norecurse nounwind readnone
2470 define double @select_cc_quad_double(fp128 %0, fp128 %1, double %2, double %3) {
2471 ; CHECK-LABEL: select_cc_quad_double:
2473 ; CHECK-NEXT: fcmp.q %s0, %s0, %s2
2474 ; CHECK-NEXT: cmov.d.eq %s5, %s4, %s0
2475 ; CHECK-NEXT: or %s0, 0, %s5
2476 ; CHECK-NEXT: b.l.t (, %s10)
2477 %5 = fcmp fast oeq fp128 %0, %1
2478 %6 = select fast i1 %5, double %2, double %3
2482 ; Function Attrs: norecurse nounwind readnone
2483 define fp128 @select_cc_i1_quad(i1 zeroext %0, i1 zeroext %1, fp128 %2, fp128 %3) {
2484 ; CHECK-LABEL: select_cc_i1_quad:
2486 ; CHECK-NEXT: xor %s0, %s0, %s1
2487 ; CHECK-NEXT: cmov.w.ne %s2, %s4, %s0
2488 ; CHECK-NEXT: cmov.w.ne %s3, %s5, %s0
2489 ; CHECK-NEXT: or %s0, 0, %s2
2490 ; CHECK-NEXT: or %s1, 0, %s3
2491 ; CHECK-NEXT: b.l.t (, %s10)
2493 %6 = select fast i1 %5, fp128 %3, fp128 %2
2497 ; Function Attrs: norecurse nounwind readnone
2498 define fp128 @select_cc_i8_quad(i8 signext %0, i8 signext %1, fp128 %2, fp128 %3) {
2499 ; CHECK-LABEL: select_cc_i8_quad:
2501 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2502 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
2503 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
2504 ; CHECK-NEXT: or %s0, 0, %s4
2505 ; CHECK-NEXT: or %s1, 0, %s5
2506 ; CHECK-NEXT: b.l.t (, %s10)
2507 %5 = icmp eq i8 %0, %1
2508 %6 = select fast i1 %5, fp128 %2, fp128 %3
2512 ; Function Attrs: norecurse nounwind readnone
2513 define fp128 @select_cc_u8_quad(i8 zeroext %0, i8 zeroext %1, fp128 %2, fp128 %3) {
2514 ; CHECK-LABEL: select_cc_u8_quad:
2516 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2517 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
2518 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
2519 ; CHECK-NEXT: or %s0, 0, %s4
2520 ; CHECK-NEXT: or %s1, 0, %s5
2521 ; CHECK-NEXT: b.l.t (, %s10)
2522 %5 = icmp eq i8 %0, %1
2523 %6 = select fast i1 %5, fp128 %2, fp128 %3
2527 ; Function Attrs: norecurse nounwind readnone
2528 define fp128 @select_cc_i16_quad(i16 signext %0, i16 signext %1, fp128 %2, fp128 %3) {
2529 ; CHECK-LABEL: select_cc_i16_quad:
2531 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2532 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
2533 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
2534 ; CHECK-NEXT: or %s0, 0, %s4
2535 ; CHECK-NEXT: or %s1, 0, %s5
2536 ; CHECK-NEXT: b.l.t (, %s10)
2537 %5 = icmp eq i16 %0, %1
2538 %6 = select fast i1 %5, fp128 %2, fp128 %3
2542 ; Function Attrs: norecurse nounwind readnone
2543 define fp128 @select_cc_u16_quad(i16 zeroext %0, i16 zeroext %1, fp128 %2, fp128 %3) {
2544 ; CHECK-LABEL: select_cc_u16_quad:
2546 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2547 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
2548 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
2549 ; CHECK-NEXT: or %s0, 0, %s4
2550 ; CHECK-NEXT: or %s1, 0, %s5
2551 ; CHECK-NEXT: b.l.t (, %s10)
2552 %5 = icmp eq i16 %0, %1
2553 %6 = select fast i1 %5, fp128 %2, fp128 %3
2557 ; Function Attrs: norecurse nounwind readnone
2558 define fp128 @select_cc_i32_quad(i32 signext %0, i32 signext %1, fp128 %2, fp128 %3) {
2559 ; CHECK-LABEL: select_cc_i32_quad:
2561 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2562 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
2563 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
2564 ; CHECK-NEXT: or %s0, 0, %s4
2565 ; CHECK-NEXT: or %s1, 0, %s5
2566 ; CHECK-NEXT: b.l.t (, %s10)
2567 %5 = icmp eq i32 %0, %1
2568 %6 = select fast i1 %5, fp128 %2, fp128 %3
2572 ; Function Attrs: norecurse nounwind readnone
2573 define fp128 @select_cc_u32_quad(i32 zeroext %0, i32 zeroext %1, fp128 %2, fp128 %3) {
2574 ; CHECK-LABEL: select_cc_u32_quad:
2576 ; CHECK-NEXT: cmpu.w %s0, %s0, %s1
2577 ; CHECK-NEXT: cmov.w.eq %s4, %s2, %s0
2578 ; CHECK-NEXT: cmov.w.eq %s5, %s3, %s0
2579 ; CHECK-NEXT: or %s0, 0, %s4
2580 ; CHECK-NEXT: or %s1, 0, %s5
2581 ; CHECK-NEXT: b.l.t (, %s10)
2582 %5 = icmp eq i32 %0, %1
2583 %6 = select fast i1 %5, fp128 %2, fp128 %3
2587 ; Function Attrs: norecurse nounwind readnone
2588 define fp128 @select_cc_i64_quad(i64 %0, i64 %1, fp128 %2, fp128 %3) {
2589 ; CHECK-LABEL: select_cc_i64_quad:
2591 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
2592 ; CHECK-NEXT: cmov.l.eq %s4, %s2, %s0
2593 ; CHECK-NEXT: cmov.l.eq %s5, %s3, %s0
2594 ; CHECK-NEXT: or %s0, 0, %s4
2595 ; CHECK-NEXT: or %s1, 0, %s5
2596 ; CHECK-NEXT: b.l.t (, %s10)
2597 %5 = icmp eq i64 %0, %1
2598 %6 = select fast i1 %5, fp128 %2, fp128 %3
2602 ; Function Attrs: norecurse nounwind readnone
2603 define fp128 @select_cc_u64_quad(i64 %0, i64 %1, fp128 %2, fp128 %3) {
2604 ; CHECK-LABEL: select_cc_u64_quad:
2606 ; CHECK-NEXT: cmpu.l %s0, %s0, %s1
2607 ; CHECK-NEXT: cmov.l.eq %s4, %s2, %s0
2608 ; CHECK-NEXT: cmov.l.eq %s5, %s3, %s0
2609 ; CHECK-NEXT: or %s0, 0, %s4
2610 ; CHECK-NEXT: or %s1, 0, %s5
2611 ; CHECK-NEXT: b.l.t (, %s10)
2612 %5 = icmp eq i64 %0, %1
2613 %6 = select fast i1 %5, fp128 %2, fp128 %3
2617 ; Function Attrs: norecurse nounwind readnone
2618 define fp128 @select_cc_i128_quad(i128 %0, i128 %1, fp128 %2, fp128 %3) {
2619 ; CHECK-LABEL: select_cc_i128_quad:
2621 ; CHECK-NEXT: xor %s1, %s1, %s3
2622 ; CHECK-NEXT: xor %s0, %s0, %s2
2623 ; CHECK-NEXT: or %s0, %s0, %s1
2624 ; CHECK-NEXT: cmov.l.eq %s6, %s4, %s0
2625 ; CHECK-NEXT: cmov.l.eq %s7, %s5, %s0
2626 ; CHECK-NEXT: or %s0, 0, %s6
2627 ; CHECK-NEXT: or %s1, 0, %s7
2628 ; CHECK-NEXT: b.l.t (, %s10)
2629 %5 = icmp eq i128 %0, %1
2630 %6 = select fast i1 %5, fp128 %2, fp128 %3
2634 ; Function Attrs: norecurse nounwind readnone
2635 define fp128 @select_cc_u128_quad(i128 %0, i128 %1, fp128 %2, fp128 %3) {
2636 ; CHECK-LABEL: select_cc_u128_quad:
2638 ; CHECK-NEXT: xor %s1, %s1, %s3
2639 ; CHECK-NEXT: xor %s0, %s0, %s2
2640 ; CHECK-NEXT: or %s0, %s0, %s1
2641 ; CHECK-NEXT: cmov.l.eq %s6, %s4, %s0
2642 ; CHECK-NEXT: cmov.l.eq %s7, %s5, %s0
2643 ; CHECK-NEXT: or %s0, 0, %s6
2644 ; CHECK-NEXT: or %s1, 0, %s7
2645 ; CHECK-NEXT: b.l.t (, %s10)
2646 %5 = icmp eq i128 %0, %1
2647 %6 = select fast i1 %5, fp128 %2, fp128 %3
2651 ; Function Attrs: norecurse nounwind readnone
2652 define fp128 @select_cc_float_quad(float %0, float %1, fp128 %2, fp128 %3) {
2653 ; CHECK-LABEL: select_cc_float_quad:
2655 ; CHECK-NEXT: fcmp.s %s0, %s0, %s1
2656 ; CHECK-NEXT: cmov.s.eq %s4, %s2, %s0
2657 ; CHECK-NEXT: cmov.s.eq %s5, %s3, %s0
2658 ; CHECK-NEXT: or %s0, 0, %s4
2659 ; CHECK-NEXT: or %s1, 0, %s5
2660 ; CHECK-NEXT: b.l.t (, %s10)
2661 %5 = fcmp fast oeq float %0, %1
2662 %6 = select fast i1 %5, fp128 %2, fp128 %3
2666 ; Function Attrs: norecurse nounwind readnone
2667 define fp128 @select_cc_double_quad(double %0, double %1, fp128 %2, fp128 %3) {
2668 ; CHECK-LABEL: select_cc_double_quad:
2670 ; CHECK-NEXT: fcmp.d %s0, %s0, %s1
2671 ; CHECK-NEXT: cmov.d.eq %s4, %s2, %s0
2672 ; CHECK-NEXT: cmov.d.eq %s5, %s3, %s0
2673 ; CHECK-NEXT: or %s0, 0, %s4
2674 ; CHECK-NEXT: or %s1, 0, %s5
2675 ; CHECK-NEXT: b.l.t (, %s10)
2676 %5 = fcmp fast oeq double %0, %1
2677 %6 = select fast i1 %5, fp128 %2, fp128 %3
2681 ; Function Attrs: norecurse nounwind readnone
2682 define fp128 @select_cc_quad_quad(fp128 %0, fp128 %1, fp128 %2, fp128 %3) {
2683 ; CHECK-LABEL: select_cc_quad_quad:
2685 ; CHECK-NEXT: fcmp.q %s0, %s0, %s2
2686 ; CHECK-NEXT: cmov.d.eq %s6, %s4, %s0
2687 ; CHECK-NEXT: cmov.d.eq %s7, %s5, %s0
2688 ; CHECK-NEXT: or %s0, 0, %s6
2689 ; CHECK-NEXT: or %s1, 0, %s7
2690 ; CHECK-NEXT: b.l.t (, %s10)
2691 %5 = fcmp fast oeq fp128 %0, %1
2692 %6 = select fast i1 %5, fp128 %2, fp128 %3