1; RUN: llc < %s -mtriple=ve | FileCheck %s
2
3;;; Test all combination of input type and output type among following types.
4;;;
5;;; Types:
6;;;  i1/i8/u8/i16/u16/i32/u32/i64/u64/i128/u128/float/double/fp128
7
8; Function Attrs: norecurse nounwind readnone
9define 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:
11; CHECK:       # %bb.0:
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)
16  %5 = xor i1 %0, %1
17  %6 = select i1 %5, i1 %3, i1 %2
18  ret i1 %6
19}
20
21; Function Attrs: norecurse nounwind readnone
22define 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:
24; CHECK:       # %bb.0:
25; CHECK-NEXT:    cmps.w.sx %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
31  ret i1 %6
32}
33
34; Function Attrs: norecurse nounwind readnone
35define 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:
37; CHECK:       # %bb.0:
38; CHECK-NEXT:    cmps.w.sx %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
44  ret i1 %6
45}
46
47; Function Attrs: norecurse nounwind readnone
48define 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:
50; CHECK:       # %bb.0:
51; CHECK-NEXT:    cmps.w.sx %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
57  ret i1 %6
58}
59
60; Function Attrs: norecurse nounwind readnone
61define 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:
63; CHECK:       # %bb.0:
64; CHECK-NEXT:    cmps.w.sx %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
70  ret i1 %6
71}
72
73; Function Attrs: norecurse nounwind readnone
74define 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:
76; CHECK:       # %bb.0:
77; CHECK-NEXT:    cmps.w.sx %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
83  ret i1 %6
84}
85
86; Function Attrs: norecurse nounwind readnone
87define 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:
89; CHECK:       # %bb.0:
90; CHECK-NEXT:    cmps.w.sx %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
96  ret i1 %6
97}
98
99; Function Attrs: norecurse nounwind readnone
100define zeroext i1 @select_cc_i64_i1(i64 %0, i64 %1, i1 zeroext %2, i1 zeroext %3) {
101; CHECK-LABEL: select_cc_i64_i1:
102; CHECK:       # %bb.0:
103; CHECK-NEXT:    cmps.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
109  ret i1 %6
110}
111
112; Function Attrs: norecurse nounwind readnone
113define zeroext i1 @select_cc_u64_i1(i64 %0, i64 %1, i1 zeroext %2, i1 zeroext %3) {
114; CHECK-LABEL: select_cc_u64_i1:
115; CHECK:       # %bb.0:
116; CHECK-NEXT:    cmps.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
122  ret i1 %6
123}
124
125; Function Attrs: norecurse nounwind readnone
126define zeroext i1 @select_cc_i128_i1(i128 %0, i128 %1, i1 zeroext %2, i1 zeroext %3) {
127; CHECK-LABEL: select_cc_i128_i1:
128; CHECK:       # %bb.0:
129; CHECK-NEXT:    xor %s1, %s1, %s3
130; CHECK-NEXT:    xor %s0, %s0, %s2
131; CHECK-NEXT:    or %s0, %s0, %s1
132; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
133; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
134; CHECK-NEXT:    adds.w.zx %s0, %s5, (0)1
135; CHECK-NEXT:    b.l.t (, %s10)
136  %5 = icmp eq i128 %0, %1
137  %6 = select i1 %5, i1 %2, i1 %3
138  ret i1 %6
139}
140
141; Function Attrs: norecurse nounwind readnone
142define zeroext i1 @select_cc_u128_i1(i128 %0, i128 %1, i1 zeroext %2, i1 zeroext %3) {
143; CHECK-LABEL: select_cc_u128_i1:
144; CHECK:       # %bb.0:
145; CHECK-NEXT:    xor %s1, %s1, %s3
146; CHECK-NEXT:    xor %s0, %s0, %s2
147; CHECK-NEXT:    or %s0, %s0, %s1
148; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
149; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
150; CHECK-NEXT:    adds.w.zx %s0, %s5, (0)1
151; CHECK-NEXT:    b.l.t (, %s10)
152  %5 = icmp eq i128 %0, %1
153  %6 = select i1 %5, i1 %2, i1 %3
154  ret i1 %6
155}
156
157; Function Attrs: norecurse nounwind readnone
158define zeroext i1 @select_cc_float_i1(float %0, float %1, i1 zeroext %2, i1 zeroext %3) {
159; CHECK-LABEL: select_cc_float_i1:
160; CHECK:       # %bb.0:
161; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
162; CHECK-NEXT:    cmov.s.eq %s3, %s2, %s0
163; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
164; CHECK-NEXT:    b.l.t (, %s10)
165  %5 = fcmp fast oeq float %0, %1
166  %6 = select i1 %5, i1 %2, i1 %3
167  ret i1 %6
168}
169
170; Function Attrs: norecurse nounwind readnone
171define zeroext i1 @select_cc_double_i1(double %0, double %1, i1 zeroext %2, i1 zeroext %3) {
172; CHECK-LABEL: select_cc_double_i1:
173; CHECK:       # %bb.0:
174; CHECK-NEXT:    fcmp.d %s0, %s0, %s1
175; CHECK-NEXT:    cmov.d.eq %s3, %s2, %s0
176; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
177; CHECK-NEXT:    b.l.t (, %s10)
178  %5 = fcmp fast oeq double %0, %1
179  %6 = select i1 %5, i1 %2, i1 %3
180  ret i1 %6
181}
182
183; Function Attrs: norecurse nounwind readnone
184define zeroext i1 @select_cc_quad_i1(fp128 %0, fp128 %1, i1 zeroext %2, i1 zeroext %3) {
185; CHECK-LABEL: select_cc_quad_i1:
186; CHECK:       # %bb.0:
187; CHECK-NEXT:    fcmp.q %s0, %s0, %s2
188; CHECK-NEXT:    cmov.d.eq %s5, %s4, %s0
189; CHECK-NEXT:    adds.w.zx %s0, %s5, (0)1
190; CHECK-NEXT:    b.l.t (, %s10)
191  %5 = fcmp fast oeq fp128 %0, %1
192  %6 = select i1 %5, i1 %2, i1 %3
193  ret i1 %6
194}
195
196; Function Attrs: norecurse nounwind readnone
197define signext i8 @select_cc_i1_i8(i1 zeroext %0, i1 zeroext %1, i8 signext %2, i8 signext %3) {
198; CHECK-LABEL: select_cc_i1_i8:
199; CHECK:       # %bb.0:
200; CHECK-NEXT:    xor %s0, %s0, %s1
201; CHECK-NEXT:    cmov.w.ne %s2, %s3, %s0
202; CHECK-NEXT:    adds.w.sx %s0, %s2, (0)1
203; CHECK-NEXT:    b.l.t (, %s10)
204  %5 = xor i1 %0, %1
205  %6 = select i1 %5, i8 %3, i8 %2
206  ret i8 %6
207}
208
209; Function Attrs: norecurse nounwind readnone
210define signext i8 @select_cc_i8_i8(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
211; CHECK-LABEL: select_cc_i8_i8:
212; CHECK:       # %bb.0:
213; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
214; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
215; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
216; CHECK-NEXT:    b.l.t (, %s10)
217  %5 = icmp eq i8 %0, %1
218  %6 = select i1 %5, i8 %2, i8 %3
219  ret i8 %6
220}
221
222; Function Attrs: norecurse nounwind readnone
223define signext i8 @select_cc_u8_i8(i8 zeroext %0, i8 zeroext %1, i8 signext %2, i8 signext %3) {
224; CHECK-LABEL: select_cc_u8_i8:
225; CHECK:       # %bb.0:
226; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
227; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
228; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
229; CHECK-NEXT:    b.l.t (, %s10)
230  %5 = icmp eq i8 %0, %1
231  %6 = select i1 %5, i8 %2, i8 %3
232  ret i8 %6
233}
234
235; Function Attrs: norecurse nounwind readnone
236define signext i8 @select_cc_i16_i8(i16 signext %0, i16 signext %1, i8 signext %2, i8 signext %3) {
237; CHECK-LABEL: select_cc_i16_i8:
238; CHECK:       # %bb.0:
239; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
240; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
241; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
242; CHECK-NEXT:    b.l.t (, %s10)
243  %5 = icmp eq i16 %0, %1
244  %6 = select i1 %5, i8 %2, i8 %3
245  ret i8 %6
246}
247
248; Function Attrs: norecurse nounwind readnone
249define signext i8 @select_cc_u16_i8(i16 zeroext %0, i16 zeroext %1, i8 signext %2, i8 signext %3) {
250; CHECK-LABEL: select_cc_u16_i8:
251; CHECK:       # %bb.0:
252; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
253; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
254; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
255; CHECK-NEXT:    b.l.t (, %s10)
256  %5 = icmp eq i16 %0, %1
257  %6 = select i1 %5, i8 %2, i8 %3
258  ret i8 %6
259}
260
261; Function Attrs: norecurse nounwind readnone
262define signext i8 @select_cc_i32_i8(i32 signext %0, i32 signext %1, i8 signext %2, i8 signext %3) {
263; CHECK-LABEL: select_cc_i32_i8:
264; CHECK:       # %bb.0:
265; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
266; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
267; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
268; CHECK-NEXT:    b.l.t (, %s10)
269  %5 = icmp eq i32 %0, %1
270  %6 = select i1 %5, i8 %2, i8 %3
271  ret i8 %6
272}
273
274; Function Attrs: norecurse nounwind readnone
275define signext i8 @select_cc_u32_i8(i32 zeroext %0, i32 zeroext %1, i8 signext %2, i8 signext %3) {
276; CHECK-LABEL: select_cc_u32_i8:
277; CHECK:       # %bb.0:
278; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
279; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
280; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
281; CHECK-NEXT:    b.l.t (, %s10)
282  %5 = icmp eq i32 %0, %1
283  %6 = select i1 %5, i8 %2, i8 %3
284  ret i8 %6
285}
286
287; Function Attrs: norecurse nounwind readnone
288define signext i8 @select_cc_i64_i8(i64 %0, i64 %1, i8 signext %2, i8 signext %3) {
289; CHECK-LABEL: select_cc_i64_i8:
290; CHECK:       # %bb.0:
291; CHECK-NEXT:    cmps.l %s0, %s0, %s1
292; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
293; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
294; CHECK-NEXT:    b.l.t (, %s10)
295  %5 = icmp eq i64 %0, %1
296  %6 = select i1 %5, i8 %2, i8 %3
297  ret i8 %6
298}
299
300; Function Attrs: norecurse nounwind readnone
301define signext i8 @select_cc_u64_i8(i64 %0, i64 %1, i8 signext %2, i8 signext %3) {
302; CHECK-LABEL: select_cc_u64_i8:
303; CHECK:       # %bb.0:
304; CHECK-NEXT:    cmps.l %s0, %s0, %s1
305; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
306; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
307; CHECK-NEXT:    b.l.t (, %s10)
308  %5 = icmp eq i64 %0, %1
309  %6 = select i1 %5, i8 %2, i8 %3
310  ret i8 %6
311}
312
313; Function Attrs: norecurse nounwind readnone
314define signext i8 @select_cc_i128_i8(i128 %0, i128 %1, i8 signext %2, i8 signext %3) {
315; CHECK-LABEL: select_cc_i128_i8:
316; CHECK:       # %bb.0:
317; CHECK-NEXT:    xor %s1, %s1, %s3
318; CHECK-NEXT:    xor %s0, %s0, %s2
319; CHECK-NEXT:    or %s0, %s0, %s1
320; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
321; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
322; CHECK-NEXT:    adds.w.sx %s0, %s5, (0)1
323; CHECK-NEXT:    b.l.t (, %s10)
324  %5 = icmp eq i128 %0, %1
325  %6 = select i1 %5, i8 %2, i8 %3
326  ret i8 %6
327}
328
329; Function Attrs: norecurse nounwind readnone
330define signext i8 @select_cc_u128_i8(i128 %0, i128 %1, i8 signext %2, i8 signext %3) {
331; CHECK-LABEL: select_cc_u128_i8:
332; CHECK:       # %bb.0:
333; CHECK-NEXT:    xor %s1, %s1, %s3
334; CHECK-NEXT:    xor %s0, %s0, %s2
335; CHECK-NEXT:    or %s0, %s0, %s1
336; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
337; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
338; CHECK-NEXT:    adds.w.sx %s0, %s5, (0)1
339; CHECK-NEXT:    b.l.t (, %s10)
340  %5 = icmp eq i128 %0, %1
341  %6 = select i1 %5, i8 %2, i8 %3
342  ret i8 %6
343}
344
345; Function Attrs: norecurse nounwind readnone
346define signext i8 @select_cc_float_i8(float %0, float %1, i8 signext %2, i8 signext %3) {
347; CHECK-LABEL: select_cc_float_i8:
348; CHECK:       # %bb.0:
349; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
350; CHECK-NEXT:    cmov.s.eq %s3, %s2, %s0
351; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
352; CHECK-NEXT:    b.l.t (, %s10)
353  %5 = fcmp fast oeq float %0, %1
354  %6 = select i1 %5, i8 %2, i8 %3
355  ret i8 %6
356}
357
358; Function Attrs: norecurse nounwind readnone
359define signext i8 @select_cc_double_i8(double %0, double %1, i8 signext %2, i8 signext %3) {
360; CHECK-LABEL: select_cc_double_i8:
361; CHECK:       # %bb.0:
362; CHECK-NEXT:    fcmp.d %s0, %s0, %s1
363; CHECK-NEXT:    cmov.d.eq %s3, %s2, %s0
364; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
365; CHECK-NEXT:    b.l.t (, %s10)
366  %5 = fcmp fast oeq double %0, %1
367  %6 = select i1 %5, i8 %2, i8 %3
368  ret i8 %6
369}
370
371; Function Attrs: norecurse nounwind readnone
372define signext i8 @select_cc_quad_i8(fp128 %0, fp128 %1, i8 signext %2, i8 signext %3) {
373; CHECK-LABEL: select_cc_quad_i8:
374; CHECK:       # %bb.0:
375; CHECK-NEXT:    fcmp.q %s0, %s0, %s2
376; CHECK-NEXT:    cmov.d.eq %s5, %s4, %s0
377; CHECK-NEXT:    adds.w.sx %s0, %s5, (0)1
378; CHECK-NEXT:    b.l.t (, %s10)
379  %5 = fcmp fast oeq fp128 %0, %1
380  %6 = select i1 %5, i8 %2, i8 %3
381  ret i8 %6
382}
383
384; Function Attrs: norecurse nounwind readnone
385define zeroext i8 @select_cc_i1_u8(i1 zeroext %0, i1 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
386; CHECK-LABEL: select_cc_i1_u8:
387; CHECK:       # %bb.0:
388; CHECK-NEXT:    xor %s0, %s0, %s1
389; CHECK-NEXT:    cmov.w.ne %s2, %s3, %s0
390; CHECK-NEXT:    adds.w.zx %s0, %s2, (0)1
391; CHECK-NEXT:    b.l.t (, %s10)
392  %5 = xor i1 %0, %1
393  %6 = select i1 %5, i8 %3, i8 %2
394  ret i8 %6
395}
396
397; Function Attrs: norecurse nounwind readnone
398define zeroext i8 @select_cc_i8_u8(i8 signext %0, i8 signext %1, i8 zeroext %2, i8 zeroext %3) {
399; CHECK-LABEL: select_cc_i8_u8:
400; CHECK:       # %bb.0:
401; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
402; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
403; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
404; CHECK-NEXT:    b.l.t (, %s10)
405  %5 = icmp eq i8 %0, %1
406  %6 = select i1 %5, i8 %2, i8 %3
407  ret i8 %6
408}
409
410; Function Attrs: norecurse nounwind readnone
411define zeroext i8 @select_cc_u8_u8(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
412; CHECK-LABEL: select_cc_u8_u8:
413; CHECK:       # %bb.0:
414; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
415; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
416; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
417; CHECK-NEXT:    b.l.t (, %s10)
418  %5 = icmp eq i8 %0, %1
419  %6 = select i1 %5, i8 %2, i8 %3
420  ret i8 %6
421}
422
423; Function Attrs: norecurse nounwind readnone
424define zeroext i8 @select_cc_i16_u8(i16 signext %0, i16 signext %1, i8 zeroext %2, i8 zeroext %3) {
425; CHECK-LABEL: select_cc_i16_u8:
426; CHECK:       # %bb.0:
427; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
428; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
429; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
430; CHECK-NEXT:    b.l.t (, %s10)
431  %5 = icmp eq i16 %0, %1
432  %6 = select i1 %5, i8 %2, i8 %3
433  ret i8 %6
434}
435
436; Function Attrs: norecurse nounwind readnone
437define zeroext i8 @select_cc_u16_u8(i16 zeroext %0, i16 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
438; CHECK-LABEL: select_cc_u16_u8:
439; CHECK:       # %bb.0:
440; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
441; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
442; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
443; CHECK-NEXT:    b.l.t (, %s10)
444  %5 = icmp eq i16 %0, %1
445  %6 = select i1 %5, i8 %2, i8 %3
446  ret i8 %6
447}
448
449; Function Attrs: norecurse nounwind readnone
450define zeroext i8 @select_cc_i32_u8(i32 signext %0, i32 signext %1, i8 zeroext %2, i8 zeroext %3) {
451; CHECK-LABEL: select_cc_i32_u8:
452; CHECK:       # %bb.0:
453; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
454; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
455; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
456; CHECK-NEXT:    b.l.t (, %s10)
457  %5 = icmp eq i32 %0, %1
458  %6 = select i1 %5, i8 %2, i8 %3
459  ret i8 %6
460}
461
462; Function Attrs: norecurse nounwind readnone
463define zeroext i8 @select_cc_u32_u8(i32 zeroext %0, i32 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
464; CHECK-LABEL: select_cc_u32_u8:
465; CHECK:       # %bb.0:
466; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
467; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
468; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
469; CHECK-NEXT:    b.l.t (, %s10)
470  %5 = icmp eq i32 %0, %1
471  %6 = select i1 %5, i8 %2, i8 %3
472  ret i8 %6
473}
474
475; Function Attrs: norecurse nounwind readnone
476define zeroext i8 @select_cc_i64_u8(i64 %0, i64 %1, i8 zeroext %2, i8 zeroext %3) {
477; CHECK-LABEL: select_cc_i64_u8:
478; CHECK:       # %bb.0:
479; CHECK-NEXT:    cmps.l %s0, %s0, %s1
480; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
481; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
482; CHECK-NEXT:    b.l.t (, %s10)
483  %5 = icmp eq i64 %0, %1
484  %6 = select i1 %5, i8 %2, i8 %3
485  ret i8 %6
486}
487
488; Function Attrs: norecurse nounwind readnone
489define zeroext i8 @select_cc_u64_u8(i64 %0, i64 %1, i8 zeroext %2, i8 zeroext %3) {
490; CHECK-LABEL: select_cc_u64_u8:
491; CHECK:       # %bb.0:
492; CHECK-NEXT:    cmps.l %s0, %s0, %s1
493; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
494; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
495; CHECK-NEXT:    b.l.t (, %s10)
496  %5 = icmp eq i64 %0, %1
497  %6 = select i1 %5, i8 %2, i8 %3
498  ret i8 %6
499}
500
501; Function Attrs: norecurse nounwind readnone
502define zeroext i8 @select_cc_i128_u8(i128 %0, i128 %1, i8 zeroext %2, i8 zeroext %3) {
503; CHECK-LABEL: select_cc_i128_u8:
504; CHECK:       # %bb.0:
505; CHECK-NEXT:    xor %s1, %s1, %s3
506; CHECK-NEXT:    xor %s0, %s0, %s2
507; CHECK-NEXT:    or %s0, %s0, %s1
508; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
509; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
510; CHECK-NEXT:    adds.w.zx %s0, %s5, (0)1
511; CHECK-NEXT:    b.l.t (, %s10)
512  %5 = icmp eq i128 %0, %1
513  %6 = select i1 %5, i8 %2, i8 %3
514  ret i8 %6
515}
516
517; Function Attrs: norecurse nounwind readnone
518define zeroext i8 @select_cc_u128_u8(i128 %0, i128 %1, i8 zeroext %2, i8 zeroext %3) {
519; CHECK-LABEL: select_cc_u128_u8:
520; CHECK:       # %bb.0:
521; CHECK-NEXT:    xor %s1, %s1, %s3
522; CHECK-NEXT:    xor %s0, %s0, %s2
523; CHECK-NEXT:    or %s0, %s0, %s1
524; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
525; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
526; CHECK-NEXT:    adds.w.zx %s0, %s5, (0)1
527; CHECK-NEXT:    b.l.t (, %s10)
528  %5 = icmp eq i128 %0, %1
529  %6 = select i1 %5, i8 %2, i8 %3
530  ret i8 %6
531}
532
533; Function Attrs: norecurse nounwind readnone
534define zeroext i8 @select_cc_float_u8(float %0, float %1, i8 zeroext %2, i8 zeroext %3) {
535; CHECK-LABEL: select_cc_float_u8:
536; CHECK:       # %bb.0:
537; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
538; CHECK-NEXT:    cmov.s.eq %s3, %s2, %s0
539; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
540; CHECK-NEXT:    b.l.t (, %s10)
541  %5 = fcmp fast oeq float %0, %1
542  %6 = select i1 %5, i8 %2, i8 %3
543  ret i8 %6
544}
545
546; Function Attrs: norecurse nounwind readnone
547define zeroext i8 @select_cc_double_u8(double %0, double %1, i8 zeroext %2, i8 zeroext %3) {
548; CHECK-LABEL: select_cc_double_u8:
549; CHECK:       # %bb.0:
550; CHECK-NEXT:    fcmp.d %s0, %s0, %s1
551; CHECK-NEXT:    cmov.d.eq %s3, %s2, %s0
552; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
553; CHECK-NEXT:    b.l.t (, %s10)
554  %5 = fcmp fast oeq double %0, %1
555  %6 = select i1 %5, i8 %2, i8 %3
556  ret i8 %6
557}
558
559; Function Attrs: norecurse nounwind readnone
560define zeroext i8 @select_cc_quad_u8(fp128 %0, fp128 %1, i8 zeroext %2, i8 zeroext %3) {
561; CHECK-LABEL: select_cc_quad_u8:
562; CHECK:       # %bb.0:
563; CHECK-NEXT:    fcmp.q %s0, %s0, %s2
564; CHECK-NEXT:    cmov.d.eq %s5, %s4, %s0
565; CHECK-NEXT:    adds.w.zx %s0, %s5, (0)1
566; CHECK-NEXT:    b.l.t (, %s10)
567  %5 = fcmp fast oeq fp128 %0, %1
568  %6 = select i1 %5, i8 %2, i8 %3
569  ret i8 %6
570}
571
572; Function Attrs: norecurse nounwind readnone
573define signext i16 @select_cc_i1_i16(i1 zeroext %0, i1 zeroext %1, i16 signext %2, i16 signext %3) {
574; CHECK-LABEL: select_cc_i1_i16:
575; CHECK:       # %bb.0:
576; CHECK-NEXT:    xor %s0, %s0, %s1
577; CHECK-NEXT:    cmov.w.ne %s2, %s3, %s0
578; CHECK-NEXT:    adds.w.sx %s0, %s2, (0)1
579; CHECK-NEXT:    b.l.t (, %s10)
580  %5 = xor i1 %0, %1
581  %6 = select i1 %5, i16 %3, i16 %2
582  ret i16 %6
583}
584
585; Function Attrs: norecurse nounwind readnone
586define signext i16 @select_cc_i8_i16(i8 signext %0, i8 signext %1, i16 signext %2, i16 signext %3) {
587; CHECK-LABEL: select_cc_i8_i16:
588; CHECK:       # %bb.0:
589; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
590; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
591; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
592; CHECK-NEXT:    b.l.t (, %s10)
593  %5 = icmp eq i8 %0, %1
594  %6 = select i1 %5, i16 %2, i16 %3
595  ret i16 %6
596}
597
598; Function Attrs: norecurse nounwind readnone
599define signext i16 @select_cc_u8_i16(i8 zeroext %0, i8 zeroext %1, i16 signext %2, i16 signext %3) {
600; CHECK-LABEL: select_cc_u8_i16:
601; CHECK:       # %bb.0:
602; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
603; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
604; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
605; CHECK-NEXT:    b.l.t (, %s10)
606  %5 = icmp eq i8 %0, %1
607  %6 = select i1 %5, i16 %2, i16 %3
608  ret i16 %6
609}
610
611; Function Attrs: norecurse nounwind readnone
612define signext i16 @select_cc_i16_i16(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
613; CHECK-LABEL: select_cc_i16_i16:
614; CHECK:       # %bb.0:
615; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
616; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
617; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
618; CHECK-NEXT:    b.l.t (, %s10)
619  %5 = icmp eq i16 %0, %1
620  %6 = select i1 %5, i16 %2, i16 %3
621  ret i16 %6
622}
623
624; Function Attrs: norecurse nounwind readnone
625define signext i16 @select_cc_u16_i16(i16 zeroext %0, i16 zeroext %1, i16 signext %2, i16 signext %3) {
626; CHECK-LABEL: select_cc_u16_i16:
627; CHECK:       # %bb.0:
628; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
629; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
630; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
631; CHECK-NEXT:    b.l.t (, %s10)
632  %5 = icmp eq i16 %0, %1
633  %6 = select i1 %5, i16 %2, i16 %3
634  ret i16 %6
635}
636
637; Function Attrs: norecurse nounwind readnone
638define signext i16 @select_cc_i32_i16(i32 signext %0, i32 signext %1, i16 signext %2, i16 signext %3) {
639; CHECK-LABEL: select_cc_i32_i16:
640; CHECK:       # %bb.0:
641; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
642; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
643; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
644; CHECK-NEXT:    b.l.t (, %s10)
645  %5 = icmp eq i32 %0, %1
646  %6 = select i1 %5, i16 %2, i16 %3
647  ret i16 %6
648}
649
650; Function Attrs: norecurse nounwind readnone
651define signext i16 @select_cc_u32_i16(i32 zeroext %0, i32 zeroext %1, i16 signext %2, i16 signext %3) {
652; CHECK-LABEL: select_cc_u32_i16:
653; CHECK:       # %bb.0:
654; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
655; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
656; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
657; CHECK-NEXT:    b.l.t (, %s10)
658  %5 = icmp eq i32 %0, %1
659  %6 = select i1 %5, i16 %2, i16 %3
660  ret i16 %6
661}
662
663; Function Attrs: norecurse nounwind readnone
664define signext i16 @select_cc_i64_i16(i64 %0, i64 %1, i16 signext %2, i16 signext %3) {
665; CHECK-LABEL: select_cc_i64_i16:
666; CHECK:       # %bb.0:
667; CHECK-NEXT:    cmps.l %s0, %s0, %s1
668; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
669; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
670; CHECK-NEXT:    b.l.t (, %s10)
671  %5 = icmp eq i64 %0, %1
672  %6 = select i1 %5, i16 %2, i16 %3
673  ret i16 %6
674}
675
676; Function Attrs: norecurse nounwind readnone
677define signext i16 @select_cc_u64_i16(i64 %0, i64 %1, i16 signext %2, i16 signext %3) {
678; CHECK-LABEL: select_cc_u64_i16:
679; CHECK:       # %bb.0:
680; CHECK-NEXT:    cmps.l %s0, %s0, %s1
681; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
682; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
683; CHECK-NEXT:    b.l.t (, %s10)
684  %5 = icmp eq i64 %0, %1
685  %6 = select i1 %5, i16 %2, i16 %3
686  ret i16 %6
687}
688
689; Function Attrs: norecurse nounwind readnone
690define signext i16 @select_cc_i128_i16(i128 %0, i128 %1, i16 signext %2, i16 signext %3) {
691; CHECK-LABEL: select_cc_i128_i16:
692; CHECK:       # %bb.0:
693; CHECK-NEXT:    xor %s1, %s1, %s3
694; CHECK-NEXT:    xor %s0, %s0, %s2
695; CHECK-NEXT:    or %s0, %s0, %s1
696; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
697; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
698; CHECK-NEXT:    adds.w.sx %s0, %s5, (0)1
699; CHECK-NEXT:    b.l.t (, %s10)
700  %5 = icmp eq i128 %0, %1
701  %6 = select i1 %5, i16 %2, i16 %3
702  ret i16 %6
703}
704
705; Function Attrs: norecurse nounwind readnone
706define signext i16 @select_cc_u128_i16(i128 %0, i128 %1, i16 signext %2, i16 signext %3) {
707; CHECK-LABEL: select_cc_u128_i16:
708; CHECK:       # %bb.0:
709; CHECK-NEXT:    xor %s1, %s1, %s3
710; CHECK-NEXT:    xor %s0, %s0, %s2
711; CHECK-NEXT:    or %s0, %s0, %s1
712; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
713; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
714; CHECK-NEXT:    adds.w.sx %s0, %s5, (0)1
715; CHECK-NEXT:    b.l.t (, %s10)
716  %5 = icmp eq i128 %0, %1
717  %6 = select i1 %5, i16 %2, i16 %3
718  ret i16 %6
719}
720
721; Function Attrs: norecurse nounwind readnone
722define signext i16 @select_cc_float_i16(float %0, float %1, i16 signext %2, i16 signext %3) {
723; CHECK-LABEL: select_cc_float_i16:
724; CHECK:       # %bb.0:
725; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
726; CHECK-NEXT:    cmov.s.eq %s3, %s2, %s0
727; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
728; CHECK-NEXT:    b.l.t (, %s10)
729  %5 = fcmp fast oeq float %0, %1
730  %6 = select i1 %5, i16 %2, i16 %3
731  ret i16 %6
732}
733
734; Function Attrs: norecurse nounwind readnone
735define signext i16 @select_cc_double_i16(double %0, double %1, i16 signext %2, i16 signext %3) {
736; CHECK-LABEL: select_cc_double_i16:
737; CHECK:       # %bb.0:
738; CHECK-NEXT:    fcmp.d %s0, %s0, %s1
739; CHECK-NEXT:    cmov.d.eq %s3, %s2, %s0
740; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
741; CHECK-NEXT:    b.l.t (, %s10)
742  %5 = fcmp fast oeq double %0, %1
743  %6 = select i1 %5, i16 %2, i16 %3
744  ret i16 %6
745}
746
747; Function Attrs: norecurse nounwind readnone
748define signext i16 @select_cc_quad_i16(fp128 %0, fp128 %1, i16 signext %2, i16 signext %3) {
749; CHECK-LABEL: select_cc_quad_i16:
750; CHECK:       # %bb.0:
751; CHECK-NEXT:    fcmp.q %s0, %s0, %s2
752; CHECK-NEXT:    cmov.d.eq %s5, %s4, %s0
753; CHECK-NEXT:    adds.w.sx %s0, %s5, (0)1
754; CHECK-NEXT:    b.l.t (, %s10)
755  %5 = fcmp fast oeq fp128 %0, %1
756  %6 = select i1 %5, i16 %2, i16 %3
757  ret i16 %6
758}
759
760; Function Attrs: norecurse nounwind readnone
761define zeroext i16 @select_cc_i1_u16(i1 zeroext %0, i1 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
762; CHECK-LABEL: select_cc_i1_u16:
763; CHECK:       # %bb.0:
764; CHECK-NEXT:    xor %s0, %s0, %s1
765; CHECK-NEXT:    cmov.w.ne %s2, %s3, %s0
766; CHECK-NEXT:    adds.w.zx %s0, %s2, (0)1
767; CHECK-NEXT:    b.l.t (, %s10)
768  %5 = xor i1 %0, %1
769  %6 = select i1 %5, i16 %3, i16 %2
770  ret i16 %6
771}
772
773; Function Attrs: norecurse nounwind readnone
774define zeroext i16 @select_cc_i8_u16(i8 signext %0, i8 signext %1, i16 zeroext %2, i16 zeroext %3) {
775; CHECK-LABEL: select_cc_i8_u16:
776; CHECK:       # %bb.0:
777; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
778; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
779; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
780; CHECK-NEXT:    b.l.t (, %s10)
781  %5 = icmp eq i8 %0, %1
782  %6 = select i1 %5, i16 %2, i16 %3
783  ret i16 %6
784}
785
786; Function Attrs: norecurse nounwind readnone
787define zeroext i16 @select_cc_u8_u16(i8 zeroext %0, i8 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
788; CHECK-LABEL: select_cc_u8_u16:
789; CHECK:       # %bb.0:
790; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
791; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
792; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
793; CHECK-NEXT:    b.l.t (, %s10)
794  %5 = icmp eq i8 %0, %1
795  %6 = select i1 %5, i16 %2, i16 %3
796  ret i16 %6
797}
798
799; Function Attrs: norecurse nounwind readnone
800define zeroext i16 @select_cc_i16_u16(i16 signext %0, i16 signext %1, i16 zeroext %2, i16 zeroext %3) {
801; CHECK-LABEL: select_cc_i16_u16:
802; CHECK:       # %bb.0:
803; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
804; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
805; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
806; CHECK-NEXT:    b.l.t (, %s10)
807  %5 = icmp eq i16 %0, %1
808  %6 = select i1 %5, i16 %2, i16 %3
809  ret i16 %6
810}
811
812; Function Attrs: norecurse nounwind readnone
813define zeroext i16 @select_cc_u16_u16(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
814; CHECK-LABEL: select_cc_u16_u16:
815; CHECK:       # %bb.0:
816; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
817; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
818; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
819; CHECK-NEXT:    b.l.t (, %s10)
820  %5 = icmp eq i16 %0, %1
821  %6 = select i1 %5, i16 %2, i16 %3
822  ret i16 %6
823}
824
825; Function Attrs: norecurse nounwind readnone
826define zeroext i16 @select_cc_i32_u16(i32 signext %0, i32 signext %1, i16 zeroext %2, i16 zeroext %3) {
827; CHECK-LABEL: select_cc_i32_u16:
828; CHECK:       # %bb.0:
829; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
830; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
831; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
832; CHECK-NEXT:    b.l.t (, %s10)
833  %5 = icmp eq i32 %0, %1
834  %6 = select i1 %5, i16 %2, i16 %3
835  ret i16 %6
836}
837
838; Function Attrs: norecurse nounwind readnone
839define zeroext i16 @select_cc_u32_u16(i32 zeroext %0, i32 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
840; CHECK-LABEL: select_cc_u32_u16:
841; CHECK:       # %bb.0:
842; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
843; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
844; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
845; CHECK-NEXT:    b.l.t (, %s10)
846  %5 = icmp eq i32 %0, %1
847  %6 = select i1 %5, i16 %2, i16 %3
848  ret i16 %6
849}
850
851; Function Attrs: norecurse nounwind readnone
852define zeroext i16 @select_cc_i64_u16(i64 %0, i64 %1, i16 zeroext %2, i16 zeroext %3) {
853; CHECK-LABEL: select_cc_i64_u16:
854; CHECK:       # %bb.0:
855; CHECK-NEXT:    cmps.l %s0, %s0, %s1
856; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
857; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
858; CHECK-NEXT:    b.l.t (, %s10)
859  %5 = icmp eq i64 %0, %1
860  %6 = select i1 %5, i16 %2, i16 %3
861  ret i16 %6
862}
863
864; Function Attrs: norecurse nounwind readnone
865define zeroext i16 @select_cc_u64_u16(i64 %0, i64 %1, i16 zeroext %2, i16 zeroext %3) {
866; CHECK-LABEL: select_cc_u64_u16:
867; CHECK:       # %bb.0:
868; CHECK-NEXT:    cmps.l %s0, %s0, %s1
869; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
870; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
871; CHECK-NEXT:    b.l.t (, %s10)
872  %5 = icmp eq i64 %0, %1
873  %6 = select i1 %5, i16 %2, i16 %3
874  ret i16 %6
875}
876
877; Function Attrs: norecurse nounwind readnone
878define zeroext i16 @select_cc_i128_u16(i128 %0, i128 %1, i16 zeroext %2, i16 zeroext %3) {
879; CHECK-LABEL: select_cc_i128_u16:
880; CHECK:       # %bb.0:
881; CHECK-NEXT:    xor %s1, %s1, %s3
882; CHECK-NEXT:    xor %s0, %s0, %s2
883; CHECK-NEXT:    or %s0, %s0, %s1
884; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
885; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
886; CHECK-NEXT:    adds.w.zx %s0, %s5, (0)1
887; CHECK-NEXT:    b.l.t (, %s10)
888  %5 = icmp eq i128 %0, %1
889  %6 = select i1 %5, i16 %2, i16 %3
890  ret i16 %6
891}
892
893; Function Attrs: norecurse nounwind readnone
894define zeroext i16 @select_cc_u128_u16(i128 %0, i128 %1, i16 zeroext %2, i16 zeroext %3) {
895; CHECK-LABEL: select_cc_u128_u16:
896; CHECK:       # %bb.0:
897; CHECK-NEXT:    xor %s1, %s1, %s3
898; CHECK-NEXT:    xor %s0, %s0, %s2
899; CHECK-NEXT:    or %s0, %s0, %s1
900; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
901; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
902; CHECK-NEXT:    adds.w.zx %s0, %s5, (0)1
903; CHECK-NEXT:    b.l.t (, %s10)
904  %5 = icmp eq i128 %0, %1
905  %6 = select i1 %5, i16 %2, i16 %3
906  ret i16 %6
907}
908
909; Function Attrs: norecurse nounwind readnone
910define zeroext i16 @select_cc_float_u16(float %0, float %1, i16 zeroext %2, i16 zeroext %3) {
911; CHECK-LABEL: select_cc_float_u16:
912; CHECK:       # %bb.0:
913; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
914; CHECK-NEXT:    cmov.s.eq %s3, %s2, %s0
915; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
916; CHECK-NEXT:    b.l.t (, %s10)
917  %5 = fcmp fast oeq float %0, %1
918  %6 = select i1 %5, i16 %2, i16 %3
919  ret i16 %6
920}
921
922; Function Attrs: norecurse nounwind readnone
923define zeroext i16 @select_cc_double_u16(double %0, double %1, i16 zeroext %2, i16 zeroext %3) {
924; CHECK-LABEL: select_cc_double_u16:
925; CHECK:       # %bb.0:
926; CHECK-NEXT:    fcmp.d %s0, %s0, %s1
927; CHECK-NEXT:    cmov.d.eq %s3, %s2, %s0
928; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
929; CHECK-NEXT:    b.l.t (, %s10)
930  %5 = fcmp fast oeq double %0, %1
931  %6 = select i1 %5, i16 %2, i16 %3
932  ret i16 %6
933}
934
935; Function Attrs: norecurse nounwind readnone
936define zeroext i16 @select_cc_quad_u16(fp128 %0, fp128 %1, i16 zeroext %2, i16 zeroext %3) {
937; CHECK-LABEL: select_cc_quad_u16:
938; CHECK:       # %bb.0:
939; CHECK-NEXT:    fcmp.q %s0, %s0, %s2
940; CHECK-NEXT:    cmov.d.eq %s5, %s4, %s0
941; CHECK-NEXT:    adds.w.zx %s0, %s5, (0)1
942; CHECK-NEXT:    b.l.t (, %s10)
943  %5 = fcmp fast oeq fp128 %0, %1
944  %6 = select i1 %5, i16 %2, i16 %3
945  ret i16 %6
946}
947
948; Function Attrs: norecurse nounwind readnone
949define signext i32 @select_cc_i1_i32(i1 zeroext %0, i1 zeroext %1, i32 signext %2, i32 signext %3) {
950; CHECK-LABEL: select_cc_i1_i32:
951; CHECK:       # %bb.0:
952; CHECK-NEXT:    xor %s0, %s0, %s1
953; CHECK-NEXT:    cmov.w.ne %s2, %s3, %s0
954; CHECK-NEXT:    adds.w.sx %s0, %s2, (0)1
955; CHECK-NEXT:    b.l.t (, %s10)
956  %5 = xor i1 %0, %1
957  %6 = select i1 %5, i32 %3, i32 %2
958  ret i32 %6
959}
960
961; Function Attrs: norecurse nounwind readnone
962define signext i32 @select_cc_i8_i32(i8 signext %0, i8 signext %1, i32 signext %2, i32 signext %3) {
963; CHECK-LABEL: select_cc_i8_i32:
964; CHECK:       # %bb.0:
965; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
966; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
967; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
968; CHECK-NEXT:    b.l.t (, %s10)
969  %5 = icmp eq i8 %0, %1
970  %6 = select i1 %5, i32 %2, i32 %3
971  ret i32 %6
972}
973
974; Function Attrs: norecurse nounwind readnone
975define signext i32 @select_cc_u8_i32(i8 zeroext %0, i8 zeroext %1, i32 signext %2, i32 signext %3) {
976; CHECK-LABEL: select_cc_u8_i32:
977; CHECK:       # %bb.0:
978; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
979; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
980; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
981; CHECK-NEXT:    b.l.t (, %s10)
982  %5 = icmp eq i8 %0, %1
983  %6 = select i1 %5, i32 %2, i32 %3
984  ret i32 %6
985}
986
987; Function Attrs: norecurse nounwind readnone
988define signext i32 @select_cc_i16_i32(i16 signext %0, i16 signext %1, i32 signext %2, i32 signext %3) {
989; CHECK-LABEL: select_cc_i16_i32:
990; CHECK:       # %bb.0:
991; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
992; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
993; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
994; CHECK-NEXT:    b.l.t (, %s10)
995  %5 = icmp eq i16 %0, %1
996  %6 = select i1 %5, i32 %2, i32 %3
997  ret i32 %6
998}
999
1000; Function Attrs: norecurse nounwind readnone
1001define signext i32 @select_cc_u16_i32(i16 zeroext %0, i16 zeroext %1, i32 signext %2, i32 signext %3) {
1002; CHECK-LABEL: select_cc_u16_i32:
1003; CHECK:       # %bb.0:
1004; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1005; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1006; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
1007; CHECK-NEXT:    b.l.t (, %s10)
1008  %5 = icmp eq i16 %0, %1
1009  %6 = select i1 %5, i32 %2, i32 %3
1010  ret i32 %6
1011}
1012
1013; Function Attrs: norecurse nounwind readnone
1014define signext i32 @select_cc_i32_i32(i32 signext %0, i32 signext %1, i32 signext %2, i32 signext %3) {
1015; CHECK-LABEL: select_cc_i32_i32:
1016; CHECK:       # %bb.0:
1017; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1018; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1019; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
1020; CHECK-NEXT:    b.l.t (, %s10)
1021  %5 = icmp eq i32 %0, %1
1022  %6 = select i1 %5, i32 %2, i32 %3
1023  ret i32 %6
1024}
1025
1026; Function Attrs: norecurse nounwind readnone
1027define signext i32 @select_cc_u32_i32(i32 zeroext %0, i32 zeroext %1, i32 signext %2, i32 signext %3) {
1028; CHECK-LABEL: select_cc_u32_i32:
1029; CHECK:       # %bb.0:
1030; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1031; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1032; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
1033; CHECK-NEXT:    b.l.t (, %s10)
1034  %5 = icmp eq i32 %0, %1
1035  %6 = select i1 %5, i32 %2, i32 %3
1036  ret i32 %6
1037}
1038
1039; Function Attrs: norecurse nounwind readnone
1040define signext i32 @select_cc_i64_i32(i64 %0, i64 %1, i32 signext %2, i32 signext %3) {
1041; CHECK-LABEL: select_cc_i64_i32:
1042; CHECK:       # %bb.0:
1043; CHECK-NEXT:    cmps.l %s0, %s0, %s1
1044; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
1045; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
1046; CHECK-NEXT:    b.l.t (, %s10)
1047  %5 = icmp eq i64 %0, %1
1048  %6 = select i1 %5, i32 %2, i32 %3
1049  ret i32 %6
1050}
1051
1052; Function Attrs: norecurse nounwind readnone
1053define signext i32 @select_cc_u64_i32(i64 %0, i64 %1, i32 signext %2, i32 signext %3) {
1054; CHECK-LABEL: select_cc_u64_i32:
1055; CHECK:       # %bb.0:
1056; CHECK-NEXT:    cmps.l %s0, %s0, %s1
1057; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
1058; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
1059; CHECK-NEXT:    b.l.t (, %s10)
1060  %5 = icmp eq i64 %0, %1
1061  %6 = select i1 %5, i32 %2, i32 %3
1062  ret i32 %6
1063}
1064
1065; Function Attrs: norecurse nounwind readnone
1066define signext i32 @select_cc_i128_i32(i128 %0, i128 %1, i32 signext %2, i32 signext %3) {
1067; CHECK-LABEL: select_cc_i128_i32:
1068; CHECK:       # %bb.0:
1069; CHECK-NEXT:    xor %s1, %s1, %s3
1070; CHECK-NEXT:    xor %s0, %s0, %s2
1071; CHECK-NEXT:    or %s0, %s0, %s1
1072; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
1073; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
1074; CHECK-NEXT:    adds.w.sx %s0, %s5, (0)1
1075; CHECK-NEXT:    b.l.t (, %s10)
1076  %5 = icmp eq i128 %0, %1
1077  %6 = select i1 %5, i32 %2, i32 %3
1078  ret i32 %6
1079}
1080
1081; Function Attrs: norecurse nounwind readnone
1082define signext i32 @select_cc_u128_i32(i128 %0, i128 %1, i32 signext %2, i32 signext %3) {
1083; CHECK-LABEL: select_cc_u128_i32:
1084; CHECK:       # %bb.0:
1085; CHECK-NEXT:    xor %s1, %s1, %s3
1086; CHECK-NEXT:    xor %s0, %s0, %s2
1087; CHECK-NEXT:    or %s0, %s0, %s1
1088; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
1089; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
1090; CHECK-NEXT:    adds.w.sx %s0, %s5, (0)1
1091; CHECK-NEXT:    b.l.t (, %s10)
1092  %5 = icmp eq i128 %0, %1
1093  %6 = select i1 %5, i32 %2, i32 %3
1094  ret i32 %6
1095}
1096
1097; Function Attrs: norecurse nounwind readnone
1098define signext i32 @select_cc_float_i32(float %0, float %1, i32 signext %2, i32 signext %3) {
1099; CHECK-LABEL: select_cc_float_i32:
1100; CHECK:       # %bb.0:
1101; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
1102; CHECK-NEXT:    cmov.s.eq %s3, %s2, %s0
1103; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
1104; CHECK-NEXT:    b.l.t (, %s10)
1105  %5 = fcmp fast oeq float %0, %1
1106  %6 = select i1 %5, i32 %2, i32 %3
1107  ret i32 %6
1108}
1109
1110; Function Attrs: norecurse nounwind readnone
1111define signext i32 @select_cc_double_i32(double %0, double %1, i32 signext %2, i32 signext %3) {
1112; CHECK-LABEL: select_cc_double_i32:
1113; CHECK:       # %bb.0:
1114; CHECK-NEXT:    fcmp.d %s0, %s0, %s1
1115; CHECK-NEXT:    cmov.d.eq %s3, %s2, %s0
1116; CHECK-NEXT:    adds.w.sx %s0, %s3, (0)1
1117; CHECK-NEXT:    b.l.t (, %s10)
1118  %5 = fcmp fast oeq double %0, %1
1119  %6 = select i1 %5, i32 %2, i32 %3
1120  ret i32 %6
1121}
1122
1123; Function Attrs: norecurse nounwind readnone
1124define signext i32 @select_cc_quad_i32(fp128 %0, fp128 %1, i32 signext %2, i32 signext %3) {
1125; CHECK-LABEL: select_cc_quad_i32:
1126; CHECK:       # %bb.0:
1127; CHECK-NEXT:    fcmp.q %s0, %s0, %s2
1128; CHECK-NEXT:    cmov.d.eq %s5, %s4, %s0
1129; CHECK-NEXT:    adds.w.sx %s0, %s5, (0)1
1130; CHECK-NEXT:    b.l.t (, %s10)
1131  %5 = fcmp fast oeq fp128 %0, %1
1132  %6 = select i1 %5, i32 %2, i32 %3
1133  ret i32 %6
1134}
1135
1136; Function Attrs: norecurse nounwind readnone
1137define zeroext i32 @select_cc_i1_u32(i1 zeroext %0, i1 zeroext %1, i32 zeroext %2, i32 zeroext %3) {
1138; CHECK-LABEL: select_cc_i1_u32:
1139; CHECK:       # %bb.0:
1140; CHECK-NEXT:    xor %s0, %s0, %s1
1141; CHECK-NEXT:    cmov.w.ne %s2, %s3, %s0
1142; CHECK-NEXT:    adds.w.zx %s0, %s2, (0)1
1143; CHECK-NEXT:    b.l.t (, %s10)
1144  %5 = xor i1 %0, %1
1145  %6 = select i1 %5, i32 %3, i32 %2
1146  ret i32 %6
1147}
1148
1149; Function Attrs: norecurse nounwind readnone
1150define zeroext i32 @select_cc_i8_u32(i8 signext %0, i8 signext %1, i32 zeroext %2, i32 zeroext %3) {
1151; CHECK-LABEL: select_cc_i8_u32:
1152; CHECK:       # %bb.0:
1153; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1154; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1155; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
1156; CHECK-NEXT:    b.l.t (, %s10)
1157  %5 = icmp eq i8 %0, %1
1158  %6 = select i1 %5, i32 %2, i32 %3
1159  ret i32 %6
1160}
1161
1162; Function Attrs: norecurse nounwind readnone
1163define zeroext i32 @select_cc_u8_u32(i8 zeroext %0, i8 zeroext %1, i32 zeroext %2, i32 zeroext %3) {
1164; CHECK-LABEL: select_cc_u8_u32:
1165; CHECK:       # %bb.0:
1166; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1167; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1168; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
1169; CHECK-NEXT:    b.l.t (, %s10)
1170  %5 = icmp eq i8 %0, %1
1171  %6 = select i1 %5, i32 %2, i32 %3
1172  ret i32 %6
1173}
1174
1175; Function Attrs: norecurse nounwind readnone
1176define zeroext i32 @select_cc_i16_u32(i16 signext %0, i16 signext %1, i32 zeroext %2, i32 zeroext %3) {
1177; CHECK-LABEL: select_cc_i16_u32:
1178; CHECK:       # %bb.0:
1179; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1180; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1181; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
1182; CHECK-NEXT:    b.l.t (, %s10)
1183  %5 = icmp eq i16 %0, %1
1184  %6 = select i1 %5, i32 %2, i32 %3
1185  ret i32 %6
1186}
1187
1188; Function Attrs: norecurse nounwind readnone
1189define zeroext i32 @select_cc_u16_u32(i16 zeroext %0, i16 zeroext %1, i32 zeroext %2, i32 zeroext %3) {
1190; CHECK-LABEL: select_cc_u16_u32:
1191; CHECK:       # %bb.0:
1192; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1193; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1194; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
1195; CHECK-NEXT:    b.l.t (, %s10)
1196  %5 = icmp eq i16 %0, %1
1197  %6 = select i1 %5, i32 %2, i32 %3
1198  ret i32 %6
1199}
1200
1201; Function Attrs: norecurse nounwind readnone
1202define zeroext i32 @select_cc_i32_u32(i32 signext %0, i32 signext %1, i32 zeroext %2, i32 zeroext %3) {
1203; CHECK-LABEL: select_cc_i32_u32:
1204; CHECK:       # %bb.0:
1205; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1206; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1207; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
1208; CHECK-NEXT:    b.l.t (, %s10)
1209  %5 = icmp eq i32 %0, %1
1210  %6 = select i1 %5, i32 %2, i32 %3
1211  ret i32 %6
1212}
1213
1214; Function Attrs: norecurse nounwind readnone
1215define zeroext i32 @select_cc_u32_u32(i32 zeroext %0, i32 zeroext %1, i32 zeroext %2, i32 zeroext %3) {
1216; CHECK-LABEL: select_cc_u32_u32:
1217; CHECK:       # %bb.0:
1218; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1219; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1220; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
1221; CHECK-NEXT:    b.l.t (, %s10)
1222  %5 = icmp eq i32 %0, %1
1223  %6 = select i1 %5, i32 %2, i32 %3
1224  ret i32 %6
1225}
1226
1227; Function Attrs: norecurse nounwind readnone
1228define zeroext i32 @select_cc_i64_u32(i64 %0, i64 %1, i32 zeroext %2, i32 zeroext %3) {
1229; CHECK-LABEL: select_cc_i64_u32:
1230; CHECK:       # %bb.0:
1231; CHECK-NEXT:    cmps.l %s0, %s0, %s1
1232; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
1233; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
1234; CHECK-NEXT:    b.l.t (, %s10)
1235  %5 = icmp eq i64 %0, %1
1236  %6 = select i1 %5, i32 %2, i32 %3
1237  ret i32 %6
1238}
1239
1240; Function Attrs: norecurse nounwind readnone
1241define zeroext i32 @select_cc_u64_u32(i64 %0, i64 %1, i32 zeroext %2, i32 zeroext %3) {
1242; CHECK-LABEL: select_cc_u64_u32:
1243; CHECK:       # %bb.0:
1244; CHECK-NEXT:    cmps.l %s0, %s0, %s1
1245; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
1246; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
1247; CHECK-NEXT:    b.l.t (, %s10)
1248  %5 = icmp eq i64 %0, %1
1249  %6 = select i1 %5, i32 %2, i32 %3
1250  ret i32 %6
1251}
1252
1253; Function Attrs: norecurse nounwind readnone
1254define zeroext i32 @select_cc_i128_u32(i128 %0, i128 %1, i32 zeroext %2, i32 zeroext %3) {
1255; CHECK-LABEL: select_cc_i128_u32:
1256; CHECK:       # %bb.0:
1257; CHECK-NEXT:    xor %s1, %s1, %s3
1258; CHECK-NEXT:    xor %s0, %s0, %s2
1259; CHECK-NEXT:    or %s0, %s0, %s1
1260; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
1261; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
1262; CHECK-NEXT:    adds.w.zx %s0, %s5, (0)1
1263; CHECK-NEXT:    b.l.t (, %s10)
1264  %5 = icmp eq i128 %0, %1
1265  %6 = select i1 %5, i32 %2, i32 %3
1266  ret i32 %6
1267}
1268
1269; Function Attrs: norecurse nounwind readnone
1270define zeroext i32 @select_cc_u128_u32(i128 %0, i128 %1, i32 zeroext %2, i32 zeroext %3) {
1271; CHECK-LABEL: select_cc_u128_u32:
1272; CHECK:       # %bb.0:
1273; CHECK-NEXT:    xor %s1, %s1, %s3
1274; CHECK-NEXT:    xor %s0, %s0, %s2
1275; CHECK-NEXT:    or %s0, %s0, %s1
1276; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
1277; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
1278; CHECK-NEXT:    adds.w.zx %s0, %s5, (0)1
1279; CHECK-NEXT:    b.l.t (, %s10)
1280  %5 = icmp eq i128 %0, %1
1281  %6 = select i1 %5, i32 %2, i32 %3
1282  ret i32 %6
1283}
1284
1285; Function Attrs: norecurse nounwind readnone
1286define zeroext i32 @select_cc_float_u32(float %0, float %1, i32 zeroext %2, i32 zeroext %3) {
1287; CHECK-LABEL: select_cc_float_u32:
1288; CHECK:       # %bb.0:
1289; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
1290; CHECK-NEXT:    cmov.s.eq %s3, %s2, %s0
1291; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
1292; CHECK-NEXT:    b.l.t (, %s10)
1293  %5 = fcmp fast oeq float %0, %1
1294  %6 = select i1 %5, i32 %2, i32 %3
1295  ret i32 %6
1296}
1297
1298; Function Attrs: norecurse nounwind readnone
1299define zeroext i32 @select_cc_double_u32(double %0, double %1, i32 zeroext %2, i32 zeroext %3) {
1300; CHECK-LABEL: select_cc_double_u32:
1301; CHECK:       # %bb.0:
1302; CHECK-NEXT:    fcmp.d %s0, %s0, %s1
1303; CHECK-NEXT:    cmov.d.eq %s3, %s2, %s0
1304; CHECK-NEXT:    adds.w.zx %s0, %s3, (0)1
1305; CHECK-NEXT:    b.l.t (, %s10)
1306  %5 = fcmp fast oeq double %0, %1
1307  %6 = select i1 %5, i32 %2, i32 %3
1308  ret i32 %6
1309}
1310
1311; Function Attrs: norecurse nounwind readnone
1312define zeroext i32 @select_cc_quad_u32(fp128 %0, fp128 %1, i32 zeroext %2, i32 zeroext %3) {
1313; CHECK-LABEL: select_cc_quad_u32:
1314; CHECK:       # %bb.0:
1315; CHECK-NEXT:    fcmp.q %s0, %s0, %s2
1316; CHECK-NEXT:    cmov.d.eq %s5, %s4, %s0
1317; CHECK-NEXT:    adds.w.zx %s0, %s5, (0)1
1318; CHECK-NEXT:    b.l.t (, %s10)
1319  %5 = fcmp fast oeq fp128 %0, %1
1320  %6 = select i1 %5, i32 %2, i32 %3
1321  ret i32 %6
1322}
1323
1324; Function Attrs: norecurse nounwind readnone
1325define i64 @select_cc_i1_i64(i1 zeroext %0, i1 zeroext %1, i64 %2, i64 %3) {
1326; CHECK-LABEL: select_cc_i1_i64:
1327; CHECK:       # %bb.0:
1328; CHECK-NEXT:    xor %s0, %s0, %s1
1329; CHECK-NEXT:    and %s0, %s0, (32)0
1330; CHECK-NEXT:    cmov.w.ne %s2, %s3, %s0
1331; CHECK-NEXT:    or %s0, 0, %s2
1332; CHECK-NEXT:    b.l.t (, %s10)
1333  %5 = xor i1 %0, %1
1334  %6 = select i1 %5, i64 %3, i64 %2
1335  ret i64 %6
1336}
1337
1338; Function Attrs: norecurse nounwind readnone
1339define i64 @select_cc_i8_i64(i8 signext %0, i8 signext %1, i64 %2, i64 %3) {
1340; CHECK-LABEL: select_cc_i8_i64:
1341; CHECK:       # %bb.0:
1342; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1343; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1344; CHECK-NEXT:    or %s0, 0, %s3
1345; CHECK-NEXT:    b.l.t (, %s10)
1346  %5 = icmp eq i8 %0, %1
1347  %6 = select i1 %5, i64 %2, i64 %3
1348  ret i64 %6
1349}
1350
1351; Function Attrs: norecurse nounwind readnone
1352define i64 @select_cc_u8_i64(i8 zeroext %0, i8 zeroext %1, i64 %2, i64 %3) {
1353; CHECK-LABEL: select_cc_u8_i64:
1354; CHECK:       # %bb.0:
1355; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1356; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1357; CHECK-NEXT:    or %s0, 0, %s3
1358; CHECK-NEXT:    b.l.t (, %s10)
1359  %5 = icmp eq i8 %0, %1
1360  %6 = select i1 %5, i64 %2, i64 %3
1361  ret i64 %6
1362}
1363
1364; Function Attrs: norecurse nounwind readnone
1365define i64 @select_cc_i16_i64(i16 signext %0, i16 signext %1, i64 %2, i64 %3) {
1366; CHECK-LABEL: select_cc_i16_i64:
1367; CHECK:       # %bb.0:
1368; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1369; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1370; CHECK-NEXT:    or %s0, 0, %s3
1371; CHECK-NEXT:    b.l.t (, %s10)
1372  %5 = icmp eq i16 %0, %1
1373  %6 = select i1 %5, i64 %2, i64 %3
1374  ret i64 %6
1375}
1376
1377; Function Attrs: norecurse nounwind readnone
1378define i64 @select_cc_u16_i64(i16 zeroext %0, i16 zeroext %1, i64 %2, i64 %3) {
1379; CHECK-LABEL: select_cc_u16_i64:
1380; CHECK:       # %bb.0:
1381; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1382; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1383; CHECK-NEXT:    or %s0, 0, %s3
1384; CHECK-NEXT:    b.l.t (, %s10)
1385  %5 = icmp eq i16 %0, %1
1386  %6 = select i1 %5, i64 %2, i64 %3
1387  ret i64 %6
1388}
1389
1390; Function Attrs: norecurse nounwind readnone
1391define i64 @select_cc_i32_i64(i32 signext %0, i32 signext %1, i64 %2, i64 %3) {
1392; CHECK-LABEL: select_cc_i32_i64:
1393; CHECK:       # %bb.0:
1394; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1395; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1396; CHECK-NEXT:    or %s0, 0, %s3
1397; CHECK-NEXT:    b.l.t (, %s10)
1398  %5 = icmp eq i32 %0, %1
1399  %6 = select i1 %5, i64 %2, i64 %3
1400  ret i64 %6
1401}
1402
1403; Function Attrs: norecurse nounwind readnone
1404define i64 @select_cc_u32_i64(i32 zeroext %0, i32 zeroext %1, i64 %2, i64 %3) {
1405; CHECK-LABEL: select_cc_u32_i64:
1406; CHECK:       # %bb.0:
1407; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1408; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1409; CHECK-NEXT:    or %s0, 0, %s3
1410; CHECK-NEXT:    b.l.t (, %s10)
1411  %5 = icmp eq i32 %0, %1
1412  %6 = select i1 %5, i64 %2, i64 %3
1413  ret i64 %6
1414}
1415
1416; Function Attrs: norecurse nounwind readnone
1417define i64 @select_cc_i64_i64(i64 %0, i64 %1, i64 %2, i64 %3) {
1418; CHECK-LABEL: select_cc_i64_i64:
1419; CHECK:       # %bb.0:
1420; CHECK-NEXT:    cmps.l %s0, %s0, %s1
1421; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
1422; CHECK-NEXT:    or %s0, 0, %s3
1423; CHECK-NEXT:    b.l.t (, %s10)
1424  %5 = icmp eq i64 %0, %1
1425  %6 = select i1 %5, i64 %2, i64 %3
1426  ret i64 %6
1427}
1428
1429; Function Attrs: norecurse nounwind readnone
1430define i64 @select_cc_u64_i64(i64 %0, i64 %1, i64 %2, i64 %3) {
1431; CHECK-LABEL: select_cc_u64_i64:
1432; CHECK:       # %bb.0:
1433; CHECK-NEXT:    cmps.l %s0, %s0, %s1
1434; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
1435; CHECK-NEXT:    or %s0, 0, %s3
1436; CHECK-NEXT:    b.l.t (, %s10)
1437  %5 = icmp eq i64 %0, %1
1438  %6 = select i1 %5, i64 %2, i64 %3
1439  ret i64 %6
1440}
1441
1442; Function Attrs: norecurse nounwind readnone
1443define i64 @select_cc_i128_i64(i128 %0, i128 %1, i64 %2, i64 %3) {
1444; CHECK-LABEL: select_cc_i128_i64:
1445; CHECK:       # %bb.0:
1446; CHECK-NEXT:    xor %s1, %s1, %s3
1447; CHECK-NEXT:    xor %s0, %s0, %s2
1448; CHECK-NEXT:    or %s0, %s0, %s1
1449; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
1450; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
1451; CHECK-NEXT:    or %s0, 0, %s5
1452; CHECK-NEXT:    b.l.t (, %s10)
1453  %5 = icmp eq i128 %0, %1
1454  %6 = select i1 %5, i64 %2, i64 %3
1455  ret i64 %6
1456}
1457
1458; Function Attrs: norecurse nounwind readnone
1459define i64 @select_cc_u128_i64(i128 %0, i128 %1, i64 %2, i64 %3) {
1460; CHECK-LABEL: select_cc_u128_i64:
1461; CHECK:       # %bb.0:
1462; CHECK-NEXT:    xor %s1, %s1, %s3
1463; CHECK-NEXT:    xor %s0, %s0, %s2
1464; CHECK-NEXT:    or %s0, %s0, %s1
1465; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
1466; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
1467; CHECK-NEXT:    or %s0, 0, %s5
1468; CHECK-NEXT:    b.l.t (, %s10)
1469  %5 = icmp eq i128 %0, %1
1470  %6 = select i1 %5, i64 %2, i64 %3
1471  ret i64 %6
1472}
1473
1474; Function Attrs: norecurse nounwind readnone
1475define i64 @select_cc_float_i64(float %0, float %1, i64 %2, i64 %3) {
1476; CHECK-LABEL: select_cc_float_i64:
1477; CHECK:       # %bb.0:
1478; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
1479; CHECK-NEXT:    cmov.s.eq %s3, %s2, %s0
1480; CHECK-NEXT:    or %s0, 0, %s3
1481; CHECK-NEXT:    b.l.t (, %s10)
1482  %5 = fcmp fast oeq float %0, %1
1483  %6 = select i1 %5, i64 %2, i64 %3
1484  ret i64 %6
1485}
1486
1487; Function Attrs: norecurse nounwind readnone
1488define i64 @select_cc_double_i64(double %0, double %1, i64 %2, i64 %3) {
1489; CHECK-LABEL: select_cc_double_i64:
1490; CHECK:       # %bb.0:
1491; CHECK-NEXT:    fcmp.d %s0, %s0, %s1
1492; CHECK-NEXT:    cmov.d.eq %s3, %s2, %s0
1493; CHECK-NEXT:    or %s0, 0, %s3
1494; CHECK-NEXT:    b.l.t (, %s10)
1495  %5 = fcmp fast oeq double %0, %1
1496  %6 = select i1 %5, i64 %2, i64 %3
1497  ret i64 %6
1498}
1499
1500; Function Attrs: norecurse nounwind readnone
1501define i64 @select_cc_quad_i64(fp128 %0, fp128 %1, i64 %2, i64 %3) {
1502; CHECK-LABEL: select_cc_quad_i64:
1503; CHECK:       # %bb.0:
1504; CHECK-NEXT:    fcmp.q %s0, %s0, %s2
1505; CHECK-NEXT:    cmov.d.eq %s5, %s4, %s0
1506; CHECK-NEXT:    or %s0, 0, %s5
1507; CHECK-NEXT:    b.l.t (, %s10)
1508  %5 = fcmp fast oeq fp128 %0, %1
1509  %6 = select i1 %5, i64 %2, i64 %3
1510  ret i64 %6
1511}
1512
1513; Function Attrs: norecurse nounwind readnone
1514define i64 @select_cc_i1_u64(i1 zeroext %0, i1 zeroext %1, i64 %2, i64 %3) {
1515; CHECK-LABEL: select_cc_i1_u64:
1516; CHECK:       # %bb.0:
1517; CHECK-NEXT:    xor %s0, %s0, %s1
1518; CHECK-NEXT:    and %s0, %s0, (32)0
1519; CHECK-NEXT:    cmov.w.ne %s2, %s3, %s0
1520; CHECK-NEXT:    or %s0, 0, %s2
1521; CHECK-NEXT:    b.l.t (, %s10)
1522  %5 = xor i1 %0, %1
1523  %6 = select i1 %5, i64 %3, i64 %2
1524  ret i64 %6
1525}
1526
1527; Function Attrs: norecurse nounwind readnone
1528define i64 @select_cc_i8_u64(i8 signext %0, i8 signext %1, i64 %2, i64 %3) {
1529; CHECK-LABEL: select_cc_i8_u64:
1530; CHECK:       # %bb.0:
1531; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1532; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1533; CHECK-NEXT:    or %s0, 0, %s3
1534; CHECK-NEXT:    b.l.t (, %s10)
1535  %5 = icmp eq i8 %0, %1
1536  %6 = select i1 %5, i64 %2, i64 %3
1537  ret i64 %6
1538}
1539
1540; Function Attrs: norecurse nounwind readnone
1541define i64 @select_cc_u8_u64(i8 zeroext %0, i8 zeroext %1, i64 %2, i64 %3) {
1542; CHECK-LABEL: select_cc_u8_u64:
1543; CHECK:       # %bb.0:
1544; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1545; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1546; CHECK-NEXT:    or %s0, 0, %s3
1547; CHECK-NEXT:    b.l.t (, %s10)
1548  %5 = icmp eq i8 %0, %1
1549  %6 = select i1 %5, i64 %2, i64 %3
1550  ret i64 %6
1551}
1552
1553; Function Attrs: norecurse nounwind readnone
1554define i64 @select_cc_i16_u64(i16 signext %0, i16 signext %1, i64 %2, i64 %3) {
1555; CHECK-LABEL: select_cc_i16_u64:
1556; CHECK:       # %bb.0:
1557; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1558; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1559; CHECK-NEXT:    or %s0, 0, %s3
1560; CHECK-NEXT:    b.l.t (, %s10)
1561  %5 = icmp eq i16 %0, %1
1562  %6 = select i1 %5, i64 %2, i64 %3
1563  ret i64 %6
1564}
1565
1566; Function Attrs: norecurse nounwind readnone
1567define i64 @select_cc_u16_u64(i16 zeroext %0, i16 zeroext %1, i64 %2, i64 %3) {
1568; CHECK-LABEL: select_cc_u16_u64:
1569; CHECK:       # %bb.0:
1570; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1571; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1572; CHECK-NEXT:    or %s0, 0, %s3
1573; CHECK-NEXT:    b.l.t (, %s10)
1574  %5 = icmp eq i16 %0, %1
1575  %6 = select i1 %5, i64 %2, i64 %3
1576  ret i64 %6
1577}
1578
1579; Function Attrs: norecurse nounwind readnone
1580define i64 @select_cc_i32_u64(i32 signext %0, i32 signext %1, i64 %2, i64 %3) {
1581; CHECK-LABEL: select_cc_i32_u64:
1582; CHECK:       # %bb.0:
1583; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1584; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1585; CHECK-NEXT:    or %s0, 0, %s3
1586; CHECK-NEXT:    b.l.t (, %s10)
1587  %5 = icmp eq i32 %0, %1
1588  %6 = select i1 %5, i64 %2, i64 %3
1589  ret i64 %6
1590}
1591
1592; Function Attrs: norecurse nounwind readnone
1593define i64 @select_cc_u32_u64(i32 zeroext %0, i32 zeroext %1, i64 %2, i64 %3) {
1594; CHECK-LABEL: select_cc_u32_u64:
1595; CHECK:       # %bb.0:
1596; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1597; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
1598; CHECK-NEXT:    or %s0, 0, %s3
1599; CHECK-NEXT:    b.l.t (, %s10)
1600  %5 = icmp eq i32 %0, %1
1601  %6 = select i1 %5, i64 %2, i64 %3
1602  ret i64 %6
1603}
1604
1605; Function Attrs: norecurse nounwind readnone
1606define i64 @select_cc_i64_u64(i64 %0, i64 %1, i64 %2, i64 %3) {
1607; CHECK-LABEL: select_cc_i64_u64:
1608; CHECK:       # %bb.0:
1609; CHECK-NEXT:    cmps.l %s0, %s0, %s1
1610; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
1611; CHECK-NEXT:    or %s0, 0, %s3
1612; CHECK-NEXT:    b.l.t (, %s10)
1613  %5 = icmp eq i64 %0, %1
1614  %6 = select i1 %5, i64 %2, i64 %3
1615  ret i64 %6
1616}
1617
1618; Function Attrs: norecurse nounwind readnone
1619define i64 @select_cc_u64_u64(i64 %0, i64 %1, i64 %2, i64 %3) {
1620; CHECK-LABEL: select_cc_u64_u64:
1621; CHECK:       # %bb.0:
1622; CHECK-NEXT:    cmps.l %s0, %s0, %s1
1623; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
1624; CHECK-NEXT:    or %s0, 0, %s3
1625; CHECK-NEXT:    b.l.t (, %s10)
1626  %5 = icmp eq i64 %0, %1
1627  %6 = select i1 %5, i64 %2, i64 %3
1628  ret i64 %6
1629}
1630
1631; Function Attrs: norecurse nounwind readnone
1632define i64 @select_cc_i128_u64(i128 %0, i128 %1, i64 %2, i64 %3) {
1633; CHECK-LABEL: select_cc_i128_u64:
1634; CHECK:       # %bb.0:
1635; CHECK-NEXT:    xor %s1, %s1, %s3
1636; CHECK-NEXT:    xor %s0, %s0, %s2
1637; CHECK-NEXT:    or %s0, %s0, %s1
1638; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
1639; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
1640; CHECK-NEXT:    or %s0, 0, %s5
1641; CHECK-NEXT:    b.l.t (, %s10)
1642  %5 = icmp eq i128 %0, %1
1643  %6 = select i1 %5, i64 %2, i64 %3
1644  ret i64 %6
1645}
1646
1647; Function Attrs: norecurse nounwind readnone
1648define i64 @select_cc_u128_u64(i128 %0, i128 %1, i64 %2, i64 %3) {
1649; CHECK-LABEL: select_cc_u128_u64:
1650; CHECK:       # %bb.0:
1651; CHECK-NEXT:    xor %s1, %s1, %s3
1652; CHECK-NEXT:    xor %s0, %s0, %s2
1653; CHECK-NEXT:    or %s0, %s0, %s1
1654; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
1655; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
1656; CHECK-NEXT:    or %s0, 0, %s5
1657; CHECK-NEXT:    b.l.t (, %s10)
1658  %5 = icmp eq i128 %0, %1
1659  %6 = select i1 %5, i64 %2, i64 %3
1660  ret i64 %6
1661}
1662
1663; Function Attrs: norecurse nounwind readnone
1664define i64 @select_cc_float_u64(float %0, float %1, i64 %2, i64 %3) {
1665; CHECK-LABEL: select_cc_float_u64:
1666; CHECK:       # %bb.0:
1667; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
1668; CHECK-NEXT:    cmov.s.eq %s3, %s2, %s0
1669; CHECK-NEXT:    or %s0, 0, %s3
1670; CHECK-NEXT:    b.l.t (, %s10)
1671  %5 = fcmp fast oeq float %0, %1
1672  %6 = select i1 %5, i64 %2, i64 %3
1673  ret i64 %6
1674}
1675
1676; Function Attrs: norecurse nounwind readnone
1677define i64 @select_cc_double_u64(double %0, double %1, i64 %2, i64 %3) {
1678; CHECK-LABEL: select_cc_double_u64:
1679; CHECK:       # %bb.0:
1680; CHECK-NEXT:    fcmp.d %s0, %s0, %s1
1681; CHECK-NEXT:    cmov.d.eq %s3, %s2, %s0
1682; CHECK-NEXT:    or %s0, 0, %s3
1683; CHECK-NEXT:    b.l.t (, %s10)
1684  %5 = fcmp fast oeq double %0, %1
1685  %6 = select i1 %5, i64 %2, i64 %3
1686  ret i64 %6
1687}
1688
1689; Function Attrs: norecurse nounwind readnone
1690define i64 @select_cc_quad_u64(fp128 %0, fp128 %1, i64 %2, i64 %3) {
1691; CHECK-LABEL: select_cc_quad_u64:
1692; CHECK:       # %bb.0:
1693; CHECK-NEXT:    fcmp.q %s0, %s0, %s2
1694; CHECK-NEXT:    cmov.d.eq %s5, %s4, %s0
1695; CHECK-NEXT:    or %s0, 0, %s5
1696; CHECK-NEXT:    b.l.t (, %s10)
1697  %5 = fcmp fast oeq fp128 %0, %1
1698  %6 = select i1 %5, i64 %2, i64 %3
1699  ret i64 %6
1700}
1701
1702; Function Attrs: norecurse nounwind readnone
1703define i128 @select_cc_i1_i128(i1 zeroext %0, i1 zeroext %1, i128 %2, i128 %3) {
1704; CHECK-LABEL: select_cc_i1_i128:
1705; CHECK:       # %bb.0:
1706; CHECK-NEXT:    xor %s0, %s0, %s1
1707; CHECK-NEXT:    and %s0, %s0, (32)0
1708; CHECK-NEXT:    cmov.w.ne %s2, %s4, %s0
1709; CHECK-NEXT:    cmov.w.ne %s3, %s5, %s0
1710; CHECK-NEXT:    or %s0, 0, %s2
1711; CHECK-NEXT:    or %s1, 0, %s3
1712; CHECK-NEXT:    b.l.t (, %s10)
1713  %5 = xor i1 %0, %1
1714  %6 = select i1 %5, i128 %3, i128 %2
1715  ret i128 %6
1716}
1717
1718; Function Attrs: norecurse nounwind readnone
1719define i128 @select_cc_i8_i128(i8 signext %0, i8 signext %1, i128 %2, i128 %3) {
1720; CHECK-LABEL: select_cc_i8_i128:
1721; CHECK:       # %bb.0:
1722; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1723; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
1724; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
1725; CHECK-NEXT:    or %s0, 0, %s4
1726; CHECK-NEXT:    or %s1, 0, %s5
1727; CHECK-NEXT:    b.l.t (, %s10)
1728  %5 = icmp eq i8 %0, %1
1729  %6 = select i1 %5, i128 %2, i128 %3
1730  ret i128 %6
1731}
1732
1733; Function Attrs: norecurse nounwind readnone
1734define i128 @select_cc_u8_i128(i8 zeroext %0, i8 zeroext %1, i128 %2, i128 %3) {
1735; CHECK-LABEL: select_cc_u8_i128:
1736; CHECK:       # %bb.0:
1737; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1738; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
1739; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
1740; CHECK-NEXT:    or %s0, 0, %s4
1741; CHECK-NEXT:    or %s1, 0, %s5
1742; CHECK-NEXT:    b.l.t (, %s10)
1743  %5 = icmp eq i8 %0, %1
1744  %6 = select i1 %5, i128 %2, i128 %3
1745  ret i128 %6
1746}
1747
1748; Function Attrs: norecurse nounwind readnone
1749define i128 @select_cc_i16_i128(i16 signext %0, i16 signext %1, i128 %2, i128 %3) {
1750; CHECK-LABEL: select_cc_i16_i128:
1751; CHECK:       # %bb.0:
1752; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1753; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
1754; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
1755; CHECK-NEXT:    or %s0, 0, %s4
1756; CHECK-NEXT:    or %s1, 0, %s5
1757; CHECK-NEXT:    b.l.t (, %s10)
1758  %5 = icmp eq i16 %0, %1
1759  %6 = select i1 %5, i128 %2, i128 %3
1760  ret i128 %6
1761}
1762
1763; Function Attrs: norecurse nounwind readnone
1764define i128 @select_cc_u16_i128(i16 zeroext %0, i16 zeroext %1, i128 %2, i128 %3) {
1765; CHECK-LABEL: select_cc_u16_i128:
1766; CHECK:       # %bb.0:
1767; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1768; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
1769; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
1770; CHECK-NEXT:    or %s0, 0, %s4
1771; CHECK-NEXT:    or %s1, 0, %s5
1772; CHECK-NEXT:    b.l.t (, %s10)
1773  %5 = icmp eq i16 %0, %1
1774  %6 = select i1 %5, i128 %2, i128 %3
1775  ret i128 %6
1776}
1777
1778; Function Attrs: norecurse nounwind readnone
1779define i128 @select_cc_i32_i128(i32 signext %0, i32 signext %1, i128 %2, i128 %3) {
1780; CHECK-LABEL: select_cc_i32_i128:
1781; CHECK:       # %bb.0:
1782; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1783; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
1784; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
1785; CHECK-NEXT:    or %s0, 0, %s4
1786; CHECK-NEXT:    or %s1, 0, %s5
1787; CHECK-NEXT:    b.l.t (, %s10)
1788  %5 = icmp eq i32 %0, %1
1789  %6 = select i1 %5, i128 %2, i128 %3
1790  ret i128 %6
1791}
1792
1793; Function Attrs: norecurse nounwind readnone
1794define i128 @select_cc_u32_i128(i32 zeroext %0, i32 zeroext %1, i128 %2, i128 %3) {
1795; CHECK-LABEL: select_cc_u32_i128:
1796; CHECK:       # %bb.0:
1797; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1798; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
1799; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
1800; CHECK-NEXT:    or %s0, 0, %s4
1801; CHECK-NEXT:    or %s1, 0, %s5
1802; CHECK-NEXT:    b.l.t (, %s10)
1803  %5 = icmp eq i32 %0, %1
1804  %6 = select i1 %5, i128 %2, i128 %3
1805  ret i128 %6
1806}
1807
1808; Function Attrs: norecurse nounwind readnone
1809define i128 @select_cc_i64_i128(i64 %0, i64 %1, i128 %2, i128 %3) {
1810; CHECK-LABEL: select_cc_i64_i128:
1811; CHECK:       # %bb.0:
1812; CHECK-NEXT:    cmps.l %s0, %s0, %s1
1813; CHECK-NEXT:    cmov.l.eq %s4, %s2, %s0
1814; CHECK-NEXT:    cmov.l.eq %s5, %s3, %s0
1815; CHECK-NEXT:    or %s0, 0, %s4
1816; CHECK-NEXT:    or %s1, 0, %s5
1817; CHECK-NEXT:    b.l.t (, %s10)
1818  %5 = icmp eq i64 %0, %1
1819  %6 = select i1 %5, i128 %2, i128 %3
1820  ret i128 %6
1821}
1822
1823; Function Attrs: norecurse nounwind readnone
1824define i128 @select_cc_u64_i128(i64 %0, i64 %1, i128 %2, i128 %3) {
1825; CHECK-LABEL: select_cc_u64_i128:
1826; CHECK:       # %bb.0:
1827; CHECK-NEXT:    cmps.l %s0, %s0, %s1
1828; CHECK-NEXT:    cmov.l.eq %s4, %s2, %s0
1829; CHECK-NEXT:    cmov.l.eq %s5, %s3, %s0
1830; CHECK-NEXT:    or %s0, 0, %s4
1831; CHECK-NEXT:    or %s1, 0, %s5
1832; CHECK-NEXT:    b.l.t (, %s10)
1833  %5 = icmp eq i64 %0, %1
1834  %6 = select i1 %5, i128 %2, i128 %3
1835  ret i128 %6
1836}
1837
1838; Function Attrs: norecurse nounwind readnone
1839define i128 @select_cc_i128_i128(i128 %0, i128 %1, i128 %2, i128 %3) {
1840; CHECK-LABEL: select_cc_i128_i128:
1841; CHECK:       # %bb.0:
1842; CHECK-NEXT:    xor %s1, %s1, %s3
1843; CHECK-NEXT:    xor %s0, %s0, %s2
1844; CHECK-NEXT:    or %s0, %s0, %s1
1845; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
1846; CHECK-NEXT:    cmov.l.eq %s6, %s4, %s0
1847; CHECK-NEXT:    cmov.l.eq %s7, %s5, %s0
1848; CHECK-NEXT:    or %s0, 0, %s6
1849; CHECK-NEXT:    or %s1, 0, %s7
1850; CHECK-NEXT:    b.l.t (, %s10)
1851  %5 = icmp eq i128 %0, %1
1852  %6 = select i1 %5, i128 %2, i128 %3
1853  ret i128 %6
1854}
1855
1856; Function Attrs: norecurse nounwind readnone
1857define i128 @select_cc_u128_i128(i128 %0, i128 %1, i128 %2, i128 %3) {
1858; CHECK-LABEL: select_cc_u128_i128:
1859; CHECK:       # %bb.0:
1860; CHECK-NEXT:    xor %s1, %s1, %s3
1861; CHECK-NEXT:    xor %s0, %s0, %s2
1862; CHECK-NEXT:    or %s0, %s0, %s1
1863; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
1864; CHECK-NEXT:    cmov.l.eq %s6, %s4, %s0
1865; CHECK-NEXT:    cmov.l.eq %s7, %s5, %s0
1866; CHECK-NEXT:    or %s0, 0, %s6
1867; CHECK-NEXT:    or %s1, 0, %s7
1868; CHECK-NEXT:    b.l.t (, %s10)
1869  %5 = icmp eq i128 %0, %1
1870  %6 = select i1 %5, i128 %2, i128 %3
1871  ret i128 %6
1872}
1873
1874; Function Attrs: norecurse nounwind readnone
1875define i128 @select_cc_float_i128(float %0, float %1, i128 %2, i128 %3) {
1876; CHECK-LABEL: select_cc_float_i128:
1877; CHECK:       # %bb.0:
1878; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
1879; CHECK-NEXT:    cmov.s.eq %s4, %s2, %s0
1880; CHECK-NEXT:    cmov.s.eq %s5, %s3, %s0
1881; CHECK-NEXT:    or %s0, 0, %s4
1882; CHECK-NEXT:    or %s1, 0, %s5
1883; CHECK-NEXT:    b.l.t (, %s10)
1884  %5 = fcmp fast oeq float %0, %1
1885  %6 = select i1 %5, i128 %2, i128 %3
1886  ret i128 %6
1887}
1888
1889; Function Attrs: norecurse nounwind readnone
1890define i128 @select_cc_double_i128(double %0, double %1, i128 %2, i128 %3) {
1891; CHECK-LABEL: select_cc_double_i128:
1892; CHECK:       # %bb.0:
1893; CHECK-NEXT:    fcmp.d %s0, %s0, %s1
1894; CHECK-NEXT:    cmov.d.eq %s4, %s2, %s0
1895; CHECK-NEXT:    cmov.d.eq %s5, %s3, %s0
1896; CHECK-NEXT:    or %s0, 0, %s4
1897; CHECK-NEXT:    or %s1, 0, %s5
1898; CHECK-NEXT:    b.l.t (, %s10)
1899  %5 = fcmp fast oeq double %0, %1
1900  %6 = select i1 %5, i128 %2, i128 %3
1901  ret i128 %6
1902}
1903
1904; Function Attrs: norecurse nounwind readnone
1905define i128 @select_cc_quad_i128(fp128 %0, fp128 %1, i128 %2, i128 %3) {
1906; CHECK-LABEL: select_cc_quad_i128:
1907; CHECK:       # %bb.0:
1908; CHECK-NEXT:    fcmp.q %s0, %s0, %s2
1909; CHECK-NEXT:    cmov.d.eq %s6, %s4, %s0
1910; CHECK-NEXT:    cmov.d.eq %s7, %s5, %s0
1911; CHECK-NEXT:    or %s0, 0, %s6
1912; CHECK-NEXT:    or %s1, 0, %s7
1913; CHECK-NEXT:    b.l.t (, %s10)
1914  %5 = fcmp fast oeq fp128 %0, %1
1915  %6 = select i1 %5, i128 %2, i128 %3
1916  ret i128 %6
1917}
1918
1919; Function Attrs: norecurse nounwind readnone
1920define i128 @select_cc_i1_u128(i1 zeroext %0, i1 zeroext %1, i128 %2, i128 %3) {
1921; CHECK-LABEL: select_cc_i1_u128:
1922; CHECK:       # %bb.0:
1923; CHECK-NEXT:    xor %s0, %s0, %s1
1924; CHECK-NEXT:    and %s0, %s0, (32)0
1925; CHECK-NEXT:    cmov.w.ne %s2, %s4, %s0
1926; CHECK-NEXT:    cmov.w.ne %s3, %s5, %s0
1927; CHECK-NEXT:    or %s0, 0, %s2
1928; CHECK-NEXT:    or %s1, 0, %s3
1929; CHECK-NEXT:    b.l.t (, %s10)
1930  %5 = xor i1 %0, %1
1931  %6 = select i1 %5, i128 %3, i128 %2
1932  ret i128 %6
1933}
1934
1935; Function Attrs: norecurse nounwind readnone
1936define i128 @select_cc_i8_u128(i8 signext %0, i8 signext %1, i128 %2, i128 %3) {
1937; CHECK-LABEL: select_cc_i8_u128:
1938; CHECK:       # %bb.0:
1939; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1940; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
1941; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
1942; CHECK-NEXT:    or %s0, 0, %s4
1943; CHECK-NEXT:    or %s1, 0, %s5
1944; CHECK-NEXT:    b.l.t (, %s10)
1945  %5 = icmp eq i8 %0, %1
1946  %6 = select i1 %5, i128 %2, i128 %3
1947  ret i128 %6
1948}
1949
1950; Function Attrs: norecurse nounwind readnone
1951define i128 @select_cc_u8_u128(i8 zeroext %0, i8 zeroext %1, i128 %2, i128 %3) {
1952; CHECK-LABEL: select_cc_u8_u128:
1953; CHECK:       # %bb.0:
1954; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1955; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
1956; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
1957; CHECK-NEXT:    or %s0, 0, %s4
1958; CHECK-NEXT:    or %s1, 0, %s5
1959; CHECK-NEXT:    b.l.t (, %s10)
1960  %5 = icmp eq i8 %0, %1
1961  %6 = select i1 %5, i128 %2, i128 %3
1962  ret i128 %6
1963}
1964
1965; Function Attrs: norecurse nounwind readnone
1966define i128 @select_cc_i16_u128(i16 signext %0, i16 signext %1, i128 %2, i128 %3) {
1967; CHECK-LABEL: select_cc_i16_u128:
1968; CHECK:       # %bb.0:
1969; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1970; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
1971; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
1972; CHECK-NEXT:    or %s0, 0, %s4
1973; CHECK-NEXT:    or %s1, 0, %s5
1974; CHECK-NEXT:    b.l.t (, %s10)
1975  %5 = icmp eq i16 %0, %1
1976  %6 = select i1 %5, i128 %2, i128 %3
1977  ret i128 %6
1978}
1979
1980; Function Attrs: norecurse nounwind readnone
1981define i128 @select_cc_u16_u128(i16 zeroext %0, i16 zeroext %1, i128 %2, i128 %3) {
1982; CHECK-LABEL: select_cc_u16_u128:
1983; CHECK:       # %bb.0:
1984; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
1985; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
1986; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
1987; CHECK-NEXT:    or %s0, 0, %s4
1988; CHECK-NEXT:    or %s1, 0, %s5
1989; CHECK-NEXT:    b.l.t (, %s10)
1990  %5 = icmp eq i16 %0, %1
1991  %6 = select i1 %5, i128 %2, i128 %3
1992  ret i128 %6
1993}
1994
1995; Function Attrs: norecurse nounwind readnone
1996define i128 @select_cc_i32_u128(i32 signext %0, i32 signext %1, i128 %2, i128 %3) {
1997; CHECK-LABEL: select_cc_i32_u128:
1998; CHECK:       # %bb.0:
1999; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2000; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
2001; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
2002; CHECK-NEXT:    or %s0, 0, %s4
2003; CHECK-NEXT:    or %s1, 0, %s5
2004; CHECK-NEXT:    b.l.t (, %s10)
2005  %5 = icmp eq i32 %0, %1
2006  %6 = select i1 %5, i128 %2, i128 %3
2007  ret i128 %6
2008}
2009
2010; Function Attrs: norecurse nounwind readnone
2011define i128 @select_cc_u32_u128(i32 zeroext %0, i32 zeroext %1, i128 %2, i128 %3) {
2012; CHECK-LABEL: select_cc_u32_u128:
2013; CHECK:       # %bb.0:
2014; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2015; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
2016; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
2017; CHECK-NEXT:    or %s0, 0, %s4
2018; CHECK-NEXT:    or %s1, 0, %s5
2019; CHECK-NEXT:    b.l.t (, %s10)
2020  %5 = icmp eq i32 %0, %1
2021  %6 = select i1 %5, i128 %2, i128 %3
2022  ret i128 %6
2023}
2024
2025; Function Attrs: norecurse nounwind readnone
2026define i128 @select_cc_i64_u128(i64 %0, i64 %1, i128 %2, i128 %3) {
2027; CHECK-LABEL: select_cc_i64_u128:
2028; CHECK:       # %bb.0:
2029; CHECK-NEXT:    cmps.l %s0, %s0, %s1
2030; CHECK-NEXT:    cmov.l.eq %s4, %s2, %s0
2031; CHECK-NEXT:    cmov.l.eq %s5, %s3, %s0
2032; CHECK-NEXT:    or %s0, 0, %s4
2033; CHECK-NEXT:    or %s1, 0, %s5
2034; CHECK-NEXT:    b.l.t (, %s10)
2035  %5 = icmp eq i64 %0, %1
2036  %6 = select i1 %5, i128 %2, i128 %3
2037  ret i128 %6
2038}
2039
2040; Function Attrs: norecurse nounwind readnone
2041define i128 @select_cc_u64_u128(i64 %0, i64 %1, i128 %2, i128 %3) {
2042; CHECK-LABEL: select_cc_u64_u128:
2043; CHECK:       # %bb.0:
2044; CHECK-NEXT:    cmps.l %s0, %s0, %s1
2045; CHECK-NEXT:    cmov.l.eq %s4, %s2, %s0
2046; CHECK-NEXT:    cmov.l.eq %s5, %s3, %s0
2047; CHECK-NEXT:    or %s0, 0, %s4
2048; CHECK-NEXT:    or %s1, 0, %s5
2049; CHECK-NEXT:    b.l.t (, %s10)
2050  %5 = icmp eq i64 %0, %1
2051  %6 = select i1 %5, i128 %2, i128 %3
2052  ret i128 %6
2053}
2054
2055; Function Attrs: norecurse nounwind readnone
2056define i128 @select_cc_i128_u128(i128 %0, i128 %1, i128 %2, i128 %3) {
2057; CHECK-LABEL: select_cc_i128_u128:
2058; CHECK:       # %bb.0:
2059; CHECK-NEXT:    xor %s1, %s1, %s3
2060; CHECK-NEXT:    xor %s0, %s0, %s2
2061; CHECK-NEXT:    or %s0, %s0, %s1
2062; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
2063; CHECK-NEXT:    cmov.l.eq %s6, %s4, %s0
2064; CHECK-NEXT:    cmov.l.eq %s7, %s5, %s0
2065; CHECK-NEXT:    or %s0, 0, %s6
2066; CHECK-NEXT:    or %s1, 0, %s7
2067; CHECK-NEXT:    b.l.t (, %s10)
2068  %5 = icmp eq i128 %0, %1
2069  %6 = select i1 %5, i128 %2, i128 %3
2070  ret i128 %6
2071}
2072
2073; Function Attrs: norecurse nounwind readnone
2074define i128 @select_cc_u128_u128(i128 %0, i128 %1, i128 %2, i128 %3) {
2075; CHECK-LABEL: select_cc_u128_u128:
2076; CHECK:       # %bb.0:
2077; CHECK-NEXT:    xor %s1, %s1, %s3
2078; CHECK-NEXT:    xor %s0, %s0, %s2
2079; CHECK-NEXT:    or %s0, %s0, %s1
2080; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
2081; CHECK-NEXT:    cmov.l.eq %s6, %s4, %s0
2082; CHECK-NEXT:    cmov.l.eq %s7, %s5, %s0
2083; CHECK-NEXT:    or %s0, 0, %s6
2084; CHECK-NEXT:    or %s1, 0, %s7
2085; CHECK-NEXT:    b.l.t (, %s10)
2086  %5 = icmp eq i128 %0, %1
2087  %6 = select i1 %5, i128 %2, i128 %3
2088  ret i128 %6
2089}
2090
2091; Function Attrs: norecurse nounwind readnone
2092define i128 @select_cc_float_u128(float %0, float %1, i128 %2, i128 %3) {
2093; CHECK-LABEL: select_cc_float_u128:
2094; CHECK:       # %bb.0:
2095; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
2096; CHECK-NEXT:    cmov.s.eq %s4, %s2, %s0
2097; CHECK-NEXT:    cmov.s.eq %s5, %s3, %s0
2098; CHECK-NEXT:    or %s0, 0, %s4
2099; CHECK-NEXT:    or %s1, 0, %s5
2100; CHECK-NEXT:    b.l.t (, %s10)
2101  %5 = fcmp fast oeq float %0, %1
2102  %6 = select i1 %5, i128 %2, i128 %3
2103  ret i128 %6
2104}
2105
2106; Function Attrs: norecurse nounwind readnone
2107define i128 @select_cc_double_u128(double %0, double %1, i128 %2, i128 %3) {
2108; CHECK-LABEL: select_cc_double_u128:
2109; CHECK:       # %bb.0:
2110; CHECK-NEXT:    fcmp.d %s0, %s0, %s1
2111; CHECK-NEXT:    cmov.d.eq %s4, %s2, %s0
2112; CHECK-NEXT:    cmov.d.eq %s5, %s3, %s0
2113; CHECK-NEXT:    or %s0, 0, %s4
2114; CHECK-NEXT:    or %s1, 0, %s5
2115; CHECK-NEXT:    b.l.t (, %s10)
2116  %5 = fcmp fast oeq double %0, %1
2117  %6 = select i1 %5, i128 %2, i128 %3
2118  ret i128 %6
2119}
2120
2121; Function Attrs: norecurse nounwind readnone
2122define i128 @select_cc_quad_u128(fp128 %0, fp128 %1, i128 %2, i128 %3) {
2123; CHECK-LABEL: select_cc_quad_u128:
2124; CHECK:       # %bb.0:
2125; CHECK-NEXT:    fcmp.q %s0, %s0, %s2
2126; CHECK-NEXT:    cmov.d.eq %s6, %s4, %s0
2127; CHECK-NEXT:    cmov.d.eq %s7, %s5, %s0
2128; CHECK-NEXT:    or %s0, 0, %s6
2129; CHECK-NEXT:    or %s1, 0, %s7
2130; CHECK-NEXT:    b.l.t (, %s10)
2131  %5 = fcmp fast oeq fp128 %0, %1
2132  %6 = select i1 %5, i128 %2, i128 %3
2133  ret i128 %6
2134}
2135
2136; Function Attrs: norecurse nounwind readnone
2137define float @select_cc_i1_float(i1 zeroext %0, i1 zeroext %1, float %2, float %3) {
2138; CHECK-LABEL: select_cc_i1_float:
2139; CHECK:       # %bb.0:
2140; CHECK-NEXT:    xor %s0, %s0, %s1
2141; CHECK-NEXT:    and %s0, %s0, (32)0
2142; CHECK-NEXT:    cmov.w.ne %s2, %s3, %s0
2143; CHECK-NEXT:    or %s0, 0, %s2
2144; CHECK-NEXT:    b.l.t (, %s10)
2145  %5 = xor i1 %0, %1
2146  %6 = select fast i1 %5, float %3, float %2
2147  ret float %6
2148}
2149
2150; Function Attrs: norecurse nounwind readnone
2151define float @select_cc_i8_float(i8 signext %0, i8 signext %1, float %2, float %3) {
2152; CHECK-LABEL: select_cc_i8_float:
2153; CHECK:       # %bb.0:
2154; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2155; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
2156; CHECK-NEXT:    or %s0, 0, %s3
2157; CHECK-NEXT:    b.l.t (, %s10)
2158  %5 = icmp eq i8 %0, %1
2159  %6 = select fast i1 %5, float %2, float %3
2160  ret float %6
2161}
2162
2163; Function Attrs: norecurse nounwind readnone
2164define float @select_cc_u8_float(i8 zeroext %0, i8 zeroext %1, float %2, float %3) {
2165; CHECK-LABEL: select_cc_u8_float:
2166; CHECK:       # %bb.0:
2167; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2168; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
2169; CHECK-NEXT:    or %s0, 0, %s3
2170; CHECK-NEXT:    b.l.t (, %s10)
2171  %5 = icmp eq i8 %0, %1
2172  %6 = select fast i1 %5, float %2, float %3
2173  ret float %6
2174}
2175
2176; Function Attrs: norecurse nounwind readnone
2177define float @select_cc_i16_float(i16 signext %0, i16 signext %1, float %2, float %3) {
2178; CHECK-LABEL: select_cc_i16_float:
2179; CHECK:       # %bb.0:
2180; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2181; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
2182; CHECK-NEXT:    or %s0, 0, %s3
2183; CHECK-NEXT:    b.l.t (, %s10)
2184  %5 = icmp eq i16 %0, %1
2185  %6 = select fast i1 %5, float %2, float %3
2186  ret float %6
2187}
2188
2189; Function Attrs: norecurse nounwind readnone
2190define float @select_cc_u16_float(i16 zeroext %0, i16 zeroext %1, float %2, float %3) {
2191; CHECK-LABEL: select_cc_u16_float:
2192; CHECK:       # %bb.0:
2193; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2194; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
2195; CHECK-NEXT:    or %s0, 0, %s3
2196; CHECK-NEXT:    b.l.t (, %s10)
2197  %5 = icmp eq i16 %0, %1
2198  %6 = select fast i1 %5, float %2, float %3
2199  ret float %6
2200}
2201
2202; Function Attrs: norecurse nounwind readnone
2203define float @select_cc_i32_float(i32 signext %0, i32 signext %1, float %2, float %3) {
2204; CHECK-LABEL: select_cc_i32_float:
2205; CHECK:       # %bb.0:
2206; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2207; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
2208; CHECK-NEXT:    or %s0, 0, %s3
2209; CHECK-NEXT:    b.l.t (, %s10)
2210  %5 = icmp eq i32 %0, %1
2211  %6 = select fast i1 %5, float %2, float %3
2212  ret float %6
2213}
2214
2215; Function Attrs: norecurse nounwind readnone
2216define float @select_cc_u32_float(i32 zeroext %0, i32 zeroext %1, float %2, float %3) {
2217; CHECK-LABEL: select_cc_u32_float:
2218; CHECK:       # %bb.0:
2219; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2220; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
2221; CHECK-NEXT:    or %s0, 0, %s3
2222; CHECK-NEXT:    b.l.t (, %s10)
2223  %5 = icmp eq i32 %0, %1
2224  %6 = select fast i1 %5, float %2, float %3
2225  ret float %6
2226}
2227
2228; Function Attrs: norecurse nounwind readnone
2229define float @select_cc_i64_float(i64 %0, i64 %1, float %2, float %3) {
2230; CHECK-LABEL: select_cc_i64_float:
2231; CHECK:       # %bb.0:
2232; CHECK-NEXT:    cmps.l %s0, %s0, %s1
2233; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
2234; CHECK-NEXT:    or %s0, 0, %s3
2235; CHECK-NEXT:    b.l.t (, %s10)
2236  %5 = icmp eq i64 %0, %1
2237  %6 = select fast i1 %5, float %2, float %3
2238  ret float %6
2239}
2240
2241; Function Attrs: norecurse nounwind readnone
2242define float @select_cc_u64_float(i64 %0, i64 %1, float %2, float %3) {
2243; CHECK-LABEL: select_cc_u64_float:
2244; CHECK:       # %bb.0:
2245; CHECK-NEXT:    cmps.l %s0, %s0, %s1
2246; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
2247; CHECK-NEXT:    or %s0, 0, %s3
2248; CHECK-NEXT:    b.l.t (, %s10)
2249  %5 = icmp eq i64 %0, %1
2250  %6 = select fast i1 %5, float %2, float %3
2251  ret float %6
2252}
2253
2254; Function Attrs: norecurse nounwind readnone
2255define float @select_cc_i128_float(i128 %0, i128 %1, float %2, float %3) {
2256; CHECK-LABEL: select_cc_i128_float:
2257; CHECK:       # %bb.0:
2258; CHECK-NEXT:    xor %s1, %s1, %s3
2259; CHECK-NEXT:    xor %s0, %s0, %s2
2260; CHECK-NEXT:    or %s0, %s0, %s1
2261; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
2262; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
2263; CHECK-NEXT:    or %s0, 0, %s5
2264; CHECK-NEXT:    b.l.t (, %s10)
2265  %5 = icmp eq i128 %0, %1
2266  %6 = select fast i1 %5, float %2, float %3
2267  ret float %6
2268}
2269
2270; Function Attrs: norecurse nounwind readnone
2271define float @select_cc_u128_float(i128 %0, i128 %1, float %2, float %3) {
2272; CHECK-LABEL: select_cc_u128_float:
2273; CHECK:       # %bb.0:
2274; CHECK-NEXT:    xor %s1, %s1, %s3
2275; CHECK-NEXT:    xor %s0, %s0, %s2
2276; CHECK-NEXT:    or %s0, %s0, %s1
2277; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
2278; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
2279; CHECK-NEXT:    or %s0, 0, %s5
2280; CHECK-NEXT:    b.l.t (, %s10)
2281  %5 = icmp eq i128 %0, %1
2282  %6 = select fast i1 %5, float %2, float %3
2283  ret float %6
2284}
2285
2286; Function Attrs: norecurse nounwind readnone
2287define float @select_cc_float_float(float %0, float %1, float %2, float %3) {
2288; CHECK-LABEL: select_cc_float_float:
2289; CHECK:       # %bb.0:
2290; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
2291; CHECK-NEXT:    cmov.s.eq %s3, %s2, %s0
2292; CHECK-NEXT:    or %s0, 0, %s3
2293; CHECK-NEXT:    b.l.t (, %s10)
2294  %5 = fcmp fast oeq float %0, %1
2295  %6 = select fast i1 %5, float %2, float %3
2296  ret float %6
2297}
2298
2299; Function Attrs: norecurse nounwind readnone
2300define float @select_cc_double_float(double %0, double %1, float %2, float %3) {
2301; CHECK-LABEL: select_cc_double_float:
2302; CHECK:       # %bb.0:
2303; CHECK-NEXT:    fcmp.d %s0, %s0, %s1
2304; CHECK-NEXT:    cmov.d.eq %s3, %s2, %s0
2305; CHECK-NEXT:    or %s0, 0, %s3
2306; CHECK-NEXT:    b.l.t (, %s10)
2307  %5 = fcmp fast oeq double %0, %1
2308  %6 = select fast i1 %5, float %2, float %3
2309  ret float %6
2310}
2311
2312; Function Attrs: norecurse nounwind readnone
2313define float @select_cc_quad_float(fp128 %0, fp128 %1, float %2, float %3) {
2314; CHECK-LABEL: select_cc_quad_float:
2315; CHECK:       # %bb.0:
2316; CHECK-NEXT:    fcmp.q %s0, %s0, %s2
2317; CHECK-NEXT:    cmov.d.eq %s5, %s4, %s0
2318; CHECK-NEXT:    or %s0, 0, %s5
2319; CHECK-NEXT:    b.l.t (, %s10)
2320  %5 = fcmp fast oeq fp128 %0, %1
2321  %6 = select fast i1 %5, float %2, float %3
2322  ret float %6
2323}
2324
2325; Function Attrs: norecurse nounwind readnone
2326define double @select_cc_i1_double(i1 zeroext %0, i1 zeroext %1, double %2, double %3) {
2327; CHECK-LABEL: select_cc_i1_double:
2328; CHECK:       # %bb.0:
2329; CHECK-NEXT:    xor %s0, %s0, %s1
2330; CHECK-NEXT:    and %s0, %s0, (32)0
2331; CHECK-NEXT:    cmov.w.ne %s2, %s3, %s0
2332; CHECK-NEXT:    or %s0, 0, %s2
2333; CHECK-NEXT:    b.l.t (, %s10)
2334  %5 = xor i1 %0, %1
2335  %6 = select fast i1 %5, double %3, double %2
2336  ret double %6
2337}
2338
2339; Function Attrs: norecurse nounwind readnone
2340define double @select_cc_i8_double(i8 signext %0, i8 signext %1, double %2, double %3) {
2341; CHECK-LABEL: select_cc_i8_double:
2342; CHECK:       # %bb.0:
2343; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2344; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
2345; CHECK-NEXT:    or %s0, 0, %s3
2346; CHECK-NEXT:    b.l.t (, %s10)
2347  %5 = icmp eq i8 %0, %1
2348  %6 = select fast i1 %5, double %2, double %3
2349  ret double %6
2350}
2351
2352; Function Attrs: norecurse nounwind readnone
2353define double @select_cc_u8_double(i8 zeroext %0, i8 zeroext %1, double %2, double %3) {
2354; CHECK-LABEL: select_cc_u8_double:
2355; CHECK:       # %bb.0:
2356; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2357; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
2358; CHECK-NEXT:    or %s0, 0, %s3
2359; CHECK-NEXT:    b.l.t (, %s10)
2360  %5 = icmp eq i8 %0, %1
2361  %6 = select fast i1 %5, double %2, double %3
2362  ret double %6
2363}
2364
2365; Function Attrs: norecurse nounwind readnone
2366define double @select_cc_i16_double(i16 signext %0, i16 signext %1, double %2, double %3) {
2367; CHECK-LABEL: select_cc_i16_double:
2368; CHECK:       # %bb.0:
2369; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2370; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
2371; CHECK-NEXT:    or %s0, 0, %s3
2372; CHECK-NEXT:    b.l.t (, %s10)
2373  %5 = icmp eq i16 %0, %1
2374  %6 = select fast i1 %5, double %2, double %3
2375  ret double %6
2376}
2377
2378; Function Attrs: norecurse nounwind readnone
2379define double @select_cc_u16_double(i16 zeroext %0, i16 zeroext %1, double %2, double %3) {
2380; CHECK-LABEL: select_cc_u16_double:
2381; CHECK:       # %bb.0:
2382; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2383; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
2384; CHECK-NEXT:    or %s0, 0, %s3
2385; CHECK-NEXT:    b.l.t (, %s10)
2386  %5 = icmp eq i16 %0, %1
2387  %6 = select fast i1 %5, double %2, double %3
2388  ret double %6
2389}
2390
2391; Function Attrs: norecurse nounwind readnone
2392define double @select_cc_i32_double(i32 signext %0, i32 signext %1, double %2, double %3) {
2393; CHECK-LABEL: select_cc_i32_double:
2394; CHECK:       # %bb.0:
2395; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2396; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
2397; CHECK-NEXT:    or %s0, 0, %s3
2398; CHECK-NEXT:    b.l.t (, %s10)
2399  %5 = icmp eq i32 %0, %1
2400  %6 = select fast i1 %5, double %2, double %3
2401  ret double %6
2402}
2403
2404; Function Attrs: norecurse nounwind readnone
2405define double @select_cc_u32_double(i32 zeroext %0, i32 zeroext %1, double %2, double %3) {
2406; CHECK-LABEL: select_cc_u32_double:
2407; CHECK:       # %bb.0:
2408; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2409; CHECK-NEXT:    cmov.w.eq %s3, %s2, %s0
2410; CHECK-NEXT:    or %s0, 0, %s3
2411; CHECK-NEXT:    b.l.t (, %s10)
2412  %5 = icmp eq i32 %0, %1
2413  %6 = select fast i1 %5, double %2, double %3
2414  ret double %6
2415}
2416
2417; Function Attrs: norecurse nounwind readnone
2418define double @select_cc_i64_double(i64 %0, i64 %1, double %2, double %3) {
2419; CHECK-LABEL: select_cc_i64_double:
2420; CHECK:       # %bb.0:
2421; CHECK-NEXT:    cmps.l %s0, %s0, %s1
2422; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
2423; CHECK-NEXT:    or %s0, 0, %s3
2424; CHECK-NEXT:    b.l.t (, %s10)
2425  %5 = icmp eq i64 %0, %1
2426  %6 = select fast i1 %5, double %2, double %3
2427  ret double %6
2428}
2429
2430; Function Attrs: norecurse nounwind readnone
2431define double @select_cc_u64_double(i64 %0, i64 %1, double %2, double %3) {
2432; CHECK-LABEL: select_cc_u64_double:
2433; CHECK:       # %bb.0:
2434; CHECK-NEXT:    cmps.l %s0, %s0, %s1
2435; CHECK-NEXT:    cmov.l.eq %s3, %s2, %s0
2436; CHECK-NEXT:    or %s0, 0, %s3
2437; CHECK-NEXT:    b.l.t (, %s10)
2438  %5 = icmp eq i64 %0, %1
2439  %6 = select fast i1 %5, double %2, double %3
2440  ret double %6
2441}
2442
2443; Function Attrs: norecurse nounwind readnone
2444define double @select_cc_i128_double(i128 %0, i128 %1, double %2, double %3) {
2445; CHECK-LABEL: select_cc_i128_double:
2446; CHECK:       # %bb.0:
2447; CHECK-NEXT:    xor %s1, %s1, %s3
2448; CHECK-NEXT:    xor %s0, %s0, %s2
2449; CHECK-NEXT:    or %s0, %s0, %s1
2450; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
2451; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
2452; CHECK-NEXT:    or %s0, 0, %s5
2453; CHECK-NEXT:    b.l.t (, %s10)
2454  %5 = icmp eq i128 %0, %1
2455  %6 = select fast i1 %5, double %2, double %3
2456  ret double %6
2457}
2458
2459; Function Attrs: norecurse nounwind readnone
2460define double @select_cc_u128_double(i128 %0, i128 %1, double %2, double %3) {
2461; CHECK-LABEL: select_cc_u128_double:
2462; CHECK:       # %bb.0:
2463; CHECK-NEXT:    xor %s1, %s1, %s3
2464; CHECK-NEXT:    xor %s0, %s0, %s2
2465; CHECK-NEXT:    or %s0, %s0, %s1
2466; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
2467; CHECK-NEXT:    cmov.l.eq %s5, %s4, %s0
2468; CHECK-NEXT:    or %s0, 0, %s5
2469; CHECK-NEXT:    b.l.t (, %s10)
2470  %5 = icmp eq i128 %0, %1
2471  %6 = select fast i1 %5, double %2, double %3
2472  ret double %6
2473}
2474
2475; Function Attrs: norecurse nounwind readnone
2476define double @select_cc_float_double(float %0, float %1, double %2, double %3) {
2477; CHECK-LABEL: select_cc_float_double:
2478; CHECK:       # %bb.0:
2479; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
2480; CHECK-NEXT:    cmov.s.eq %s3, %s2, %s0
2481; CHECK-NEXT:    or %s0, 0, %s3
2482; CHECK-NEXT:    b.l.t (, %s10)
2483  %5 = fcmp fast oeq float %0, %1
2484  %6 = select fast i1 %5, double %2, double %3
2485  ret double %6
2486}
2487
2488; Function Attrs: norecurse nounwind readnone
2489define double @select_cc_double_double(double %0, double %1, double %2, double %3) {
2490; CHECK-LABEL: select_cc_double_double:
2491; CHECK:       # %bb.0:
2492; CHECK-NEXT:    fcmp.d %s0, %s0, %s1
2493; CHECK-NEXT:    cmov.d.eq %s3, %s2, %s0
2494; CHECK-NEXT:    or %s0, 0, %s3
2495; CHECK-NEXT:    b.l.t (, %s10)
2496  %5 = fcmp fast oeq double %0, %1
2497  %6 = select fast i1 %5, double %2, double %3
2498  ret double %6
2499}
2500
2501; Function Attrs: norecurse nounwind readnone
2502define double @select_cc_quad_double(fp128 %0, fp128 %1, double %2, double %3) {
2503; CHECK-LABEL: select_cc_quad_double:
2504; CHECK:       # %bb.0:
2505; CHECK-NEXT:    fcmp.q %s0, %s0, %s2
2506; CHECK-NEXT:    cmov.d.eq %s5, %s4, %s0
2507; CHECK-NEXT:    or %s0, 0, %s5
2508; CHECK-NEXT:    b.l.t (, %s10)
2509  %5 = fcmp fast oeq fp128 %0, %1
2510  %6 = select fast i1 %5, double %2, double %3
2511  ret double %6
2512}
2513
2514; Function Attrs: norecurse nounwind readnone
2515define fp128 @select_cc_i1_quad(i1 zeroext %0, i1 zeroext %1, fp128 %2, fp128 %3) {
2516; CHECK-LABEL: select_cc_i1_quad:
2517; CHECK:       # %bb.0:
2518; CHECK-NEXT:    xor %s0, %s0, %s1
2519; CHECK-NEXT:    and %s0, %s0, (32)0
2520; CHECK-NEXT:    cmov.w.ne %s2, %s4, %s0
2521; CHECK-NEXT:    cmov.w.ne %s3, %s5, %s0
2522; CHECK-NEXT:    or %s0, 0, %s2
2523; CHECK-NEXT:    or %s1, 0, %s3
2524; CHECK-NEXT:    b.l.t (, %s10)
2525  %5 = xor i1 %0, %1
2526  %6 = select fast i1 %5, fp128 %3, fp128 %2
2527  ret fp128 %6
2528}
2529
2530; Function Attrs: norecurse nounwind readnone
2531define fp128 @select_cc_i8_quad(i8 signext %0, i8 signext %1, fp128 %2, fp128 %3) {
2532; CHECK-LABEL: select_cc_i8_quad:
2533; CHECK:       # %bb.0:
2534; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2535; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
2536; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
2537; CHECK-NEXT:    or %s0, 0, %s4
2538; CHECK-NEXT:    or %s1, 0, %s5
2539; CHECK-NEXT:    b.l.t (, %s10)
2540  %5 = icmp eq i8 %0, %1
2541  %6 = select fast i1 %5, fp128 %2, fp128 %3
2542  ret fp128 %6
2543}
2544
2545; Function Attrs: norecurse nounwind readnone
2546define fp128 @select_cc_u8_quad(i8 zeroext %0, i8 zeroext %1, fp128 %2, fp128 %3) {
2547; CHECK-LABEL: select_cc_u8_quad:
2548; CHECK:       # %bb.0:
2549; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2550; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
2551; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
2552; CHECK-NEXT:    or %s0, 0, %s4
2553; CHECK-NEXT:    or %s1, 0, %s5
2554; CHECK-NEXT:    b.l.t (, %s10)
2555  %5 = icmp eq i8 %0, %1
2556  %6 = select fast i1 %5, fp128 %2, fp128 %3
2557  ret fp128 %6
2558}
2559
2560; Function Attrs: norecurse nounwind readnone
2561define fp128 @select_cc_i16_quad(i16 signext %0, i16 signext %1, fp128 %2, fp128 %3) {
2562; CHECK-LABEL: select_cc_i16_quad:
2563; CHECK:       # %bb.0:
2564; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2565; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
2566; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
2567; CHECK-NEXT:    or %s0, 0, %s4
2568; CHECK-NEXT:    or %s1, 0, %s5
2569; CHECK-NEXT:    b.l.t (, %s10)
2570  %5 = icmp eq i16 %0, %1
2571  %6 = select fast i1 %5, fp128 %2, fp128 %3
2572  ret fp128 %6
2573}
2574
2575; Function Attrs: norecurse nounwind readnone
2576define fp128 @select_cc_u16_quad(i16 zeroext %0, i16 zeroext %1, fp128 %2, fp128 %3) {
2577; CHECK-LABEL: select_cc_u16_quad:
2578; CHECK:       # %bb.0:
2579; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2580; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
2581; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
2582; CHECK-NEXT:    or %s0, 0, %s4
2583; CHECK-NEXT:    or %s1, 0, %s5
2584; CHECK-NEXT:    b.l.t (, %s10)
2585  %5 = icmp eq i16 %0, %1
2586  %6 = select fast i1 %5, fp128 %2, fp128 %3
2587  ret fp128 %6
2588}
2589
2590; Function Attrs: norecurse nounwind readnone
2591define fp128 @select_cc_i32_quad(i32 signext %0, i32 signext %1, fp128 %2, fp128 %3) {
2592; CHECK-LABEL: select_cc_i32_quad:
2593; CHECK:       # %bb.0:
2594; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2595; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
2596; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
2597; CHECK-NEXT:    or %s0, 0, %s4
2598; CHECK-NEXT:    or %s1, 0, %s5
2599; CHECK-NEXT:    b.l.t (, %s10)
2600  %5 = icmp eq i32 %0, %1
2601  %6 = select fast i1 %5, fp128 %2, fp128 %3
2602  ret fp128 %6
2603}
2604
2605; Function Attrs: norecurse nounwind readnone
2606define fp128 @select_cc_u32_quad(i32 zeroext %0, i32 zeroext %1, fp128 %2, fp128 %3) {
2607; CHECK-LABEL: select_cc_u32_quad:
2608; CHECK:       # %bb.0:
2609; CHECK-NEXT:    cmps.w.sx %s0, %s0, %s1
2610; CHECK-NEXT:    cmov.w.eq %s4, %s2, %s0
2611; CHECK-NEXT:    cmov.w.eq %s5, %s3, %s0
2612; CHECK-NEXT:    or %s0, 0, %s4
2613; CHECK-NEXT:    or %s1, 0, %s5
2614; CHECK-NEXT:    b.l.t (, %s10)
2615  %5 = icmp eq i32 %0, %1
2616  %6 = select fast i1 %5, fp128 %2, fp128 %3
2617  ret fp128 %6
2618}
2619
2620; Function Attrs: norecurse nounwind readnone
2621define fp128 @select_cc_i64_quad(i64 %0, i64 %1, fp128 %2, fp128 %3) {
2622; CHECK-LABEL: select_cc_i64_quad:
2623; CHECK:       # %bb.0:
2624; CHECK-NEXT:    cmps.l %s0, %s0, %s1
2625; CHECK-NEXT:    cmov.l.eq %s4, %s2, %s0
2626; CHECK-NEXT:    cmov.l.eq %s5, %s3, %s0
2627; CHECK-NEXT:    or %s0, 0, %s4
2628; CHECK-NEXT:    or %s1, 0, %s5
2629; CHECK-NEXT:    b.l.t (, %s10)
2630  %5 = icmp eq i64 %0, %1
2631  %6 = select fast i1 %5, fp128 %2, fp128 %3
2632  ret fp128 %6
2633}
2634
2635; Function Attrs: norecurse nounwind readnone
2636define fp128 @select_cc_u64_quad(i64 %0, i64 %1, fp128 %2, fp128 %3) {
2637; CHECK-LABEL: select_cc_u64_quad:
2638; CHECK:       # %bb.0:
2639; CHECK-NEXT:    cmps.l %s0, %s0, %s1
2640; CHECK-NEXT:    cmov.l.eq %s4, %s2, %s0
2641; CHECK-NEXT:    cmov.l.eq %s5, %s3, %s0
2642; CHECK-NEXT:    or %s0, 0, %s4
2643; CHECK-NEXT:    or %s1, 0, %s5
2644; CHECK-NEXT:    b.l.t (, %s10)
2645  %5 = icmp eq i64 %0, %1
2646  %6 = select fast i1 %5, fp128 %2, fp128 %3
2647  ret fp128 %6
2648}
2649
2650; Function Attrs: norecurse nounwind readnone
2651define fp128 @select_cc_i128_quad(i128 %0, i128 %1, fp128 %2, fp128 %3) {
2652; CHECK-LABEL: select_cc_i128_quad:
2653; CHECK:       # %bb.0:
2654; CHECK-NEXT:    xor %s1, %s1, %s3
2655; CHECK-NEXT:    xor %s0, %s0, %s2
2656; CHECK-NEXT:    or %s0, %s0, %s1
2657; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
2658; CHECK-NEXT:    cmov.l.eq %s6, %s4, %s0
2659; CHECK-NEXT:    cmov.l.eq %s7, %s5, %s0
2660; CHECK-NEXT:    or %s0, 0, %s6
2661; CHECK-NEXT:    or %s1, 0, %s7
2662; CHECK-NEXT:    b.l.t (, %s10)
2663  %5 = icmp eq i128 %0, %1
2664  %6 = select fast i1 %5, fp128 %2, fp128 %3
2665  ret fp128 %6
2666}
2667
2668; Function Attrs: norecurse nounwind readnone
2669define fp128 @select_cc_u128_quad(i128 %0, i128 %1, fp128 %2, fp128 %3) {
2670; CHECK-LABEL: select_cc_u128_quad:
2671; CHECK:       # %bb.0:
2672; CHECK-NEXT:    xor %s1, %s1, %s3
2673; CHECK-NEXT:    xor %s0, %s0, %s2
2674; CHECK-NEXT:    or %s0, %s0, %s1
2675; CHECK-NEXT:    cmps.l %s0, %s0, (0)1
2676; CHECK-NEXT:    cmov.l.eq %s6, %s4, %s0
2677; CHECK-NEXT:    cmov.l.eq %s7, %s5, %s0
2678; CHECK-NEXT:    or %s0, 0, %s6
2679; CHECK-NEXT:    or %s1, 0, %s7
2680; CHECK-NEXT:    b.l.t (, %s10)
2681  %5 = icmp eq i128 %0, %1
2682  %6 = select fast i1 %5, fp128 %2, fp128 %3
2683  ret fp128 %6
2684}
2685
2686; Function Attrs: norecurse nounwind readnone
2687define fp128 @select_cc_float_quad(float %0, float %1, fp128 %2, fp128 %3) {
2688; CHECK-LABEL: select_cc_float_quad:
2689; CHECK:       # %bb.0:
2690; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
2691; CHECK-NEXT:    cmov.s.eq %s4, %s2, %s0
2692; CHECK-NEXT:    cmov.s.eq %s5, %s3, %s0
2693; CHECK-NEXT:    or %s0, 0, %s4
2694; CHECK-NEXT:    or %s1, 0, %s5
2695; CHECK-NEXT:    b.l.t (, %s10)
2696  %5 = fcmp fast oeq float %0, %1
2697  %6 = select fast i1 %5, fp128 %2, fp128 %3
2698  ret fp128 %6
2699}
2700
2701; Function Attrs: norecurse nounwind readnone
2702define fp128 @select_cc_double_quad(double %0, double %1, fp128 %2, fp128 %3) {
2703; CHECK-LABEL: select_cc_double_quad:
2704; CHECK:       # %bb.0:
2705; CHECK-NEXT:    fcmp.d %s0, %s0, %s1
2706; CHECK-NEXT:    cmov.d.eq %s4, %s2, %s0
2707; CHECK-NEXT:    cmov.d.eq %s5, %s3, %s0
2708; CHECK-NEXT:    or %s0, 0, %s4
2709; CHECK-NEXT:    or %s1, 0, %s5
2710; CHECK-NEXT:    b.l.t (, %s10)
2711  %5 = fcmp fast oeq double %0, %1
2712  %6 = select fast i1 %5, fp128 %2, fp128 %3
2713  ret fp128 %6
2714}
2715
2716; Function Attrs: norecurse nounwind readnone
2717define fp128 @select_cc_quad_quad(fp128 %0, fp128 %1, fp128 %2, fp128 %3) {
2718; CHECK-LABEL: select_cc_quad_quad:
2719; CHECK:       # %bb.0:
2720; CHECK-NEXT:    fcmp.q %s0, %s0, %s2
2721; CHECK-NEXT:    cmov.d.eq %s6, %s4, %s0
2722; CHECK-NEXT:    cmov.d.eq %s7, %s5, %s0
2723; CHECK-NEXT:    or %s0, 0, %s6
2724; CHECK-NEXT:    or %s1, 0, %s7
2725; CHECK-NEXT:    b.l.t (, %s10)
2726  %5 = fcmp fast oeq fp128 %0, %1
2727  %6 = select fast i1 %5, fp128 %2, fp128 %3
2728  ret fp128 %6
2729}
2730