1; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-unknown \
2; RUN:   -ppc-reduce-cr-logicals=false < %s | FileCheck %s
3; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-unknown \
4; RUN:   -ppc-reduce-cr-logicals=false < %s | FileCheck %s
5
6define signext i32 @testi32slt(i32 signext %c1, i32 signext %c2, i32 signext %c3, i32 signext %c4, i32 signext %a1, i32 signext %a2) #0 {
7; CHECK-LABEL: testi32slt
8; CHECK: crorc [[REG:[0-9]+]], 2, 6
9; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
10entry:
11  %cmp1 = icmp eq i32 %c3, %c4
12  %cmp3tmp = icmp eq i32 %c1, %c2
13  %cmp3 = icmp slt i1 %cmp3tmp, %cmp1
14  br i1 %cmp3, label %iftrue, label %iffalse
15iftrue:
16  ret i32 %a1
17iffalse:
18  ret i32 %a2
19}
20
21define signext i32 @testi32ult(i32 signext %c1, i32 signext %c2, i32 signext %c3, i32 signext %c4, i32 signext %a1, i32 signext %a2) #0 {
22; CHECK-LABEL: testi32ult
23; CHECK: crorc [[REG:[0-9]+]], 6, 2
24; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
25entry:
26  %cmp1 = icmp eq i32 %c3, %c4
27  %cmp3tmp = icmp eq i32 %c1, %c2
28  %cmp3 = icmp ult i1 %cmp3tmp, %cmp1
29  br i1 %cmp3, label %iftrue, label %iffalse
30iftrue:
31  ret i32 %a1
32iffalse:
33  ret i32 %a2
34}
35
36define signext i32 @testi32sle(i32 signext %c1, i32 signext %c2, i32 signext %c3, i32 signext %c4, i32 signext %a1, i32 signext %a2) #0 {
37; CHECK-LABEL: testi32sle
38; CHECK: crandc [[REG:[0-9]+]], 2, 6
39; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
40entry:
41  %cmp1 = icmp eq i32 %c3, %c4
42  %cmp3tmp = icmp eq i32 %c1, %c2
43  %cmp3 = icmp sle i1 %cmp3tmp, %cmp1
44  br i1 %cmp3, label %iftrue, label %iffalse
45iftrue:
46  ret i32 %a1
47iffalse:
48  ret i32 %a2
49}
50
51define signext i32 @testi32ule(i32 signext %c1, i32 signext %c2, i32 signext %c3, i32 signext %c4, i32 signext %a1, i32 signext %a2) #0 {
52; CHECK-LABEL: testi32ule
53; CHECK: crandc [[REG:[0-9]+]], 6, 2
54; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
55entry:
56  %cmp1 = icmp eq i32 %c3, %c4
57  %cmp3tmp = icmp eq i32 %c1, %c2
58  %cmp3 = icmp ule i1 %cmp3tmp, %cmp1
59  br i1 %cmp3, label %iftrue, label %iffalse
60iftrue:
61  ret i32 %a1
62iffalse:
63  ret i32 %a2
64}
65
66define signext i32 @testi32eq(i32 signext %c1, i32 signext %c2, i32 signext %c3, i32 signext %c4, i32 signext %a1, i32 signext %a2) #0 {
67; CHECK-LABEL: testi32eq:
68; CHECK: crxor [[REG:[0-9]+]], 6, 2
69; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
70entry:
71  %cmp1 = icmp eq i32 %c3, %c4
72  %cmp3tmp = icmp eq i32 %c1, %c2
73  %cmp3 = icmp eq i1 %cmp3tmp, %cmp1
74  br i1 %cmp3, label %iftrue, label %iffalse
75iftrue:
76  ret i32 %a1
77iffalse:
78  ret i32 %a2
79}
80
81define signext i32 @testi32sge(i32 signext %c1, i32 signext %c2, i32 signext %c3, i32 signext %c4, i32 signext %a1, i32 signext %a2) #0 {
82; CHECK-LABEL: testi32sge:
83; CHECK: crandc [[REG:[0-9]+]], 6, 2
84; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
85entry:
86  %cmp1 = icmp eq i32 %c3, %c4
87  %cmp3tmp = icmp eq i32 %c1, %c2
88  %cmp3 = icmp sge i1 %cmp3tmp, %cmp1
89  br i1 %cmp3, label %iftrue, label %iffalse
90iftrue:
91  ret i32 %a1
92iffalse:
93  ret i32 %a2
94}
95
96define signext i32 @testi32uge(i32 signext %c1, i32 signext %c2, i32 signext %c3, i32 signext %c4, i32 signext %a1, i32 signext %a2) #0 {
97; CHECK-LABEL: testi32uge:
98; CHECK: crandc [[REG:[0-9]+]], 2, 6
99; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
100entry:
101  %cmp1 = icmp eq i32 %c3, %c4
102  %cmp3tmp = icmp eq i32 %c1, %c2
103  %cmp3 = icmp uge i1 %cmp3tmp, %cmp1
104  br i1 %cmp3, label %iftrue, label %iffalse
105iftrue:
106  ret i32 %a1
107iffalse:
108  ret i32 %a2
109}
110
111define signext i32 @testi32sgt(i32 signext %c1, i32 signext %c2, i32 signext %c3, i32 signext %c4, i32 signext %a1, i32 signext %a2) #0 {
112; CHECK-LABEL: testi32sgt:
113; CHECK: crorc [[REG:[0-9]+]], 6, 2
114; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
115entry:
116  %cmp1 = icmp eq i32 %c3, %c4
117  %cmp3tmp = icmp eq i32 %c1, %c2
118  %cmp3 = icmp sgt i1 %cmp3tmp, %cmp1
119  br i1 %cmp3, label %iftrue, label %iffalse
120iftrue:
121  ret i32 %a1
122iffalse:
123  ret i32 %a2
124}
125
126define signext i32 @testi32ugt(i32 signext %c1, i32 signext %c2, i32 signext %c3, i32 signext %c4, i32 signext %a1, i32 signext %a2) #0 {
127; CHECK-LABEL: testi32ugt:
128; CHECK: crorc [[REG:[0-9]+]], 2, 6
129; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
130entry:
131  %cmp1 = icmp eq i32 %c3, %c4
132  %cmp3tmp = icmp eq i32 %c1, %c2
133  %cmp3 = icmp ugt i1 %cmp3tmp, %cmp1
134  br i1 %cmp3, label %iftrue, label %iffalse
135iftrue:
136  ret i32 %a1
137iffalse:
138  ret i32 %a2
139}
140
141define signext i32 @testi32ne(i32 signext %c1, i32 signext %c2, i32 signext %c3, i32 signext %c4, i32 signext %a1, i32 signext %a2) #0 {
142; CHECK-LABEL: testi32ne:
143; CHECK: creqv [[REG:[0-9]+]], 6, 2
144; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
145entry:
146  %cmp1 = icmp eq i32 %c3, %c4
147  %cmp3tmp = icmp eq i32 %c1, %c2
148  %cmp3 = icmp ne i1 %cmp3tmp, %cmp1
149  br i1 %cmp3, label %iftrue, label %iffalse
150iftrue:
151  ret i32 %a1
152iffalse:
153  ret i32 %a2
154}
155
156define i64 @testi64slt(i64 %c1, i64 %c2, i64 %c3, i64 %c4, i64 %a1, i64 %a2) #0 {
157; CHECK-LABEL: testi64slt
158; CHECK: crorc [[REG:[0-9]+]], 2, 6
159; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
160entry:
161  %cmp1 = icmp eq i64 %c3, %c4
162  %cmp3tmp = icmp eq i64 %c1, %c2
163  %cmp3 = icmp slt i1 %cmp3tmp, %cmp1
164  br i1 %cmp3, label %iftrue, label %iffalse
165iftrue:
166  ret i64 %a1
167iffalse:
168  ret i64 %a2
169}
170
171define i64 @testi64ult(i64 %c1, i64 %c2, i64 %c3, i64 %c4, i64 %a1, i64 %a2) #0 {
172; CHECK-LABEL: testi64ult
173; CHECK: crorc [[REG:[0-9]+]], 6, 2
174; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
175entry:
176  %cmp1 = icmp eq i64 %c3, %c4
177  %cmp3tmp = icmp eq i64 %c1, %c2
178  %cmp3 = icmp ult i1 %cmp3tmp, %cmp1
179  br i1 %cmp3, label %iftrue, label %iffalse
180iftrue:
181  ret i64 %a1
182iffalse:
183  ret i64 %a2
184}
185
186define i64 @testi64sle(i64 %c1, i64 %c2, i64 %c3, i64 %c4, i64 %a1, i64 %a2) #0 {
187; CHECK-LABEL: testi64sle
188; CHECK: crandc [[REG:[0-9]+]], 2, 6
189; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
190entry:
191  %cmp1 = icmp eq i64 %c3, %c4
192  %cmp3tmp = icmp eq i64 %c1, %c2
193  %cmp3 = icmp sle i1 %cmp3tmp, %cmp1
194  br i1 %cmp3, label %iftrue, label %iffalse
195iftrue:
196  ret i64 %a1
197iffalse:
198  ret i64 %a2
199}
200
201define i64 @testi64ule(i64 %c1, i64 %c2, i64 %c3, i64 %c4, i64 %a1, i64 %a2) #0 {
202; CHECK-LABEL: testi64ule
203; CHECK: crandc [[REG:[0-9]+]], 6, 2
204; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
205entry:
206  %cmp1 = icmp eq i64 %c3, %c4
207  %cmp3tmp = icmp eq i64 %c1, %c2
208  %cmp3 = icmp ule i1 %cmp3tmp, %cmp1
209  br i1 %cmp3, label %iftrue, label %iffalse
210iftrue:
211  ret i64 %a1
212iffalse:
213  ret i64 %a2
214}
215
216define i64 @testi64eq(i64 %c1, i64 %c2, i64 %c3, i64 %c4, i64 %a1, i64 %a2) #0 {
217; CHECK-LABEL: testi64eq
218; CHECK: crxor [[REG:[0-9]+]], 6, 2
219; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
220entry:
221  %cmp1 = icmp eq i64 %c3, %c4
222  %cmp3tmp = icmp eq i64 %c1, %c2
223  %cmp3 = icmp eq i1 %cmp3tmp, %cmp1
224  br i1 %cmp3, label %iftrue, label %iffalse
225iftrue:
226  ret i64 %a1
227iffalse:
228  ret i64 %a2
229}
230
231define i64 @testi64sge(i64 %c1, i64 %c2, i64 %c3, i64 %c4, i64 %a1, i64 %a2) #0 {
232; CHECK-LABEL: testi64sge
233; CHECK: crandc [[REG:[0-9]+]], 6, 2
234; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
235entry:
236  %cmp1 = icmp eq i64 %c3, %c4
237  %cmp3tmp = icmp eq i64 %c1, %c2
238  %cmp3 = icmp sge i1 %cmp3tmp, %cmp1
239  br i1 %cmp3, label %iftrue, label %iffalse
240iftrue:
241  ret i64 %a1
242iffalse:
243  ret i64 %a2
244}
245
246define i64 @testi64uge(i64 %c1, i64 %c2, i64 %c3, i64 %c4, i64 %a1, i64 %a2) #0 {
247; CHECK-LABEL: testi64uge
248; CHECK: crandc [[REG:[0-9]+]], 2, 6
249; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
250entry:
251  %cmp1 = icmp eq i64 %c3, %c4
252  %cmp3tmp = icmp eq i64 %c1, %c2
253  %cmp3 = icmp uge i1 %cmp3tmp, %cmp1
254  br i1 %cmp3, label %iftrue, label %iffalse
255iftrue:
256  ret i64 %a1
257iffalse:
258  ret i64 %a2
259}
260
261define i64 @testi64sgt(i64 %c1, i64 %c2, i64 %c3, i64 %c4, i64 %a1, i64 %a2) #0 {
262; CHECK-LABEL: testi64sgt
263; CHECK: crorc [[REG:[0-9]+]], 6, 2
264; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
265entry:
266  %cmp1 = icmp eq i64 %c3, %c4
267  %cmp3tmp = icmp eq i64 %c1, %c2
268  %cmp3 = icmp sgt i1 %cmp3tmp, %cmp1
269  br i1 %cmp3, label %iftrue, label %iffalse
270iftrue:
271  ret i64 %a1
272iffalse:
273  ret i64 %a2
274}
275
276define i64 @testi64ugt(i64 %c1, i64 %c2, i64 %c3, i64 %c4, i64 %a1, i64 %a2) #0 {
277; CHECK-LABEL: testi64ugt
278; CHECK: crorc [[REG:[0-9]+]], 2, 6
279; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
280entry:
281  %cmp1 = icmp eq i64 %c3, %c4
282  %cmp3tmp = icmp eq i64 %c1, %c2
283  %cmp3 = icmp ugt i1 %cmp3tmp, %cmp1
284  br i1 %cmp3, label %iftrue, label %iffalse
285iftrue:
286  ret i64 %a1
287iffalse:
288  ret i64 %a2
289}
290
291define i64 @testi64ne(i64 %c1, i64 %c2, i64 %c3, i64 %c4, i64 %a1, i64 %a2) #0 {
292; CHECK-LABEL: testi64ne
293; CHECK: creqv [[REG:[0-9]+]], 6, 2
294; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
295entry:
296  %cmp1 = icmp eq i64 %c3, %c4
297  %cmp3tmp = icmp eq i64 %c1, %c2
298  %cmp3 = icmp ne i1 %cmp3tmp, %cmp1
299  br i1 %cmp3, label %iftrue, label %iffalse
300iftrue:
301  ret i64 %a1
302iffalse:
303  ret i64 %a2
304}
305
306define float @testfloatslt(float %c1, float %c2, float %c3, float %c4, float %a1, float %a2) #0 {
307; CHECK-LABEL: testfloatslt
308; CHECK: crorc [[REG:[0-9]+]], 2, 6
309; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
310entry:
311  %cmp1 = fcmp oeq float %c3, %c4
312  %cmp3tmp = fcmp oeq float %c1, %c2
313  %cmp3 = icmp slt i1 %cmp3tmp, %cmp1
314  br i1 %cmp3, label %iftrue, label %iffalse
315iftrue:
316  ret float %a1
317iffalse:
318  ret float %a2
319}
320
321define float @testfloatult(float %c1, float %c2, float %c3, float %c4, float %a1, float %a2) #0 {
322; CHECK-LABEL: testfloatult
323; CHECK: crorc [[REG:[0-9]+]], 6, 2
324; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
325entry:
326  %cmp1 = fcmp oeq float %c3, %c4
327  %cmp3tmp = fcmp oeq float %c1, %c2
328  %cmp3 = icmp ult i1 %cmp3tmp, %cmp1
329  br i1 %cmp3, label %iftrue, label %iffalse
330iftrue:
331  ret float %a1
332iffalse:
333  ret float %a2
334}
335
336define float @testfloatsle(float %c1, float %c2, float %c3, float %c4, float %a1, float %a2) #0 {
337; CHECK-LABEL: testfloatsle
338; CHECK: crandc [[REG:[0-9]+]], 2, 6
339; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
340entry:
341  %cmp1 = fcmp oeq float %c3, %c4
342  %cmp3tmp = fcmp oeq float %c1, %c2
343  %cmp3 = icmp sle i1 %cmp3tmp, %cmp1
344  br i1 %cmp3, label %iftrue, label %iffalse
345iftrue:
346  ret float %a1
347iffalse:
348  ret float %a2
349}
350
351define float @testfloatule(float %c1, float %c2, float %c3, float %c4, float %a1, float %a2) #0 {
352; CHECK-LABEL: testfloatule
353; CHECK: crandc [[REG:[0-9]+]], 6, 2
354; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
355entry:
356  %cmp1 = fcmp oeq float %c3, %c4
357  %cmp3tmp = fcmp oeq float %c1, %c2
358  %cmp3 = icmp ule i1 %cmp3tmp, %cmp1
359  br i1 %cmp3, label %iftrue, label %iffalse
360iftrue:
361  ret float %a1
362iffalse:
363  ret float %a2
364}
365
366define float @testfloateq(float %c1, float %c2, float %c3, float %c4, float %a1, float %a2) #0 {
367; CHECK-LABEL: testfloateq
368; CHECK: crxor [[REG:[0-9]+]], 6, 2
369; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
370entry:
371  %cmp1 = fcmp oeq float %c3, %c4
372  %cmp3tmp = fcmp oeq float %c1, %c2
373  %cmp3 = icmp eq i1 %cmp3tmp, %cmp1
374  br i1 %cmp3, label %iftrue, label %iffalse
375iftrue:
376  ret float %a1
377iffalse:
378  ret float %a2
379}
380
381define float @testfloatsge(float %c1, float %c2, float %c3, float %c4, float %a1, float %a2) #0 {
382; CHECK-LABEL: testfloatsge
383; CHECK: crandc [[REG:[0-9]+]], 6, 2
384; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
385entry:
386  %cmp1 = fcmp oeq float %c3, %c4
387  %cmp3tmp = fcmp oeq float %c1, %c2
388  %cmp3 = icmp sge i1 %cmp3tmp, %cmp1
389  br i1 %cmp3, label %iftrue, label %iffalse
390iftrue:
391  ret float %a1
392iffalse:
393  ret float %a2
394}
395
396define float @testfloatuge(float %c1, float %c2, float %c3, float %c4, float %a1, float %a2) #0 {
397; CHECK-LABEL: testfloatuge
398; CHECK: crandc [[REG:[0-9]+]], 2, 6
399; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
400entry:
401  %cmp1 = fcmp oeq float %c3, %c4
402  %cmp3tmp = fcmp oeq float %c1, %c2
403  %cmp3 = icmp uge i1 %cmp3tmp, %cmp1
404  br i1 %cmp3, label %iftrue, label %iffalse
405iftrue:
406  ret float %a1
407iffalse:
408  ret float %a2
409}
410
411define float @testfloatsgt(float %c1, float %c2, float %c3, float %c4, float %a1, float %a2) #0 {
412; CHECK-LABEL: testfloatsgt
413; CHECK: crorc [[REG:[0-9]+]], 6, 2
414; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
415entry:
416  %cmp1 = fcmp oeq float %c3, %c4
417  %cmp3tmp = fcmp oeq float %c1, %c2
418  %cmp3 = icmp sgt i1 %cmp3tmp, %cmp1
419  br i1 %cmp3, label %iftrue, label %iffalse
420iftrue:
421  ret float %a1
422iffalse:
423  ret float %a2
424}
425
426define float @testfloatugt(float %c1, float %c2, float %c3, float %c4, float %a1, float %a2) #0 {
427; CHECK-LABEL: testfloatugt
428; CHECK: crorc [[REG:[0-9]+]], 2, 6
429; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
430entry:
431  %cmp1 = fcmp oeq float %c3, %c4
432  %cmp3tmp = fcmp oeq float %c1, %c2
433  %cmp3 = icmp ugt i1 %cmp3tmp, %cmp1
434  br i1 %cmp3, label %iftrue, label %iffalse
435iftrue:
436  ret float %a1
437iffalse:
438  ret float %a2
439}
440
441define float @testfloatne(float %c1, float %c2, float %c3, float %c4, float %a1, float %a2) #0 {
442; CHECK-LABEL: testfloatne
443; CHECK: creqv [[REG:[0-9]+]], 6, 2
444; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
445entry:
446  %cmp1 = fcmp oeq float %c3, %c4
447  %cmp3tmp = fcmp oeq float %c1, %c2
448  %cmp3 = icmp ne i1 %cmp3tmp, %cmp1
449  br i1 %cmp3, label %iftrue, label %iffalse
450iftrue:
451  ret float %a1
452iffalse:
453  ret float %a2
454}
455
456define double @testdoubleslt(double %c1, double %c2, double %c3, double %c4, double %a1, double %a2) #0 {
457; CHECK-LABEL: testdoubleslt
458; CHECK: crorc [[REG:[0-9]+]], 2, 6
459; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
460entry:
461  %cmp1 = fcmp oeq double %c3, %c4
462  %cmp3tmp = fcmp oeq double %c1, %c2
463  %cmp3 = icmp slt i1 %cmp3tmp, %cmp1
464  br i1 %cmp3, label %iftrue, label %iffalse
465iftrue:
466  ret double %a1
467iffalse:
468  ret double %a2
469}
470
471define double @testdoubleult(double %c1, double %c2, double %c3, double %c4, double %a1, double %a2) #0 {
472; CHECK-LABEL: testdoubleult:
473; CHECK: crorc [[REG:[0-9]+]], 6, 2
474; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
475entry:
476  %cmp1 = fcmp oeq double %c3, %c4
477  %cmp3tmp = fcmp oeq double %c1, %c2
478  %cmp3 = icmp ult i1 %cmp3tmp, %cmp1
479  br i1 %cmp3, label %iftrue, label %iffalse
480iftrue:
481  ret double %a1
482iffalse:
483  ret double %a2
484}
485
486define double @testdoublesle(double %c1, double %c2, double %c3, double %c4, double %a1, double %a2) #0 {
487; CHECK-LABEL: testdoublesle
488; CHECK: crandc [[REG:[0-9]+]], 2, 6
489; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
490entry:
491  %cmp1 = fcmp oeq double %c3, %c4
492  %cmp3tmp = fcmp oeq double %c1, %c2
493  %cmp3 = icmp sle i1 %cmp3tmp, %cmp1
494  br i1 %cmp3, label %iftrue, label %iffalse
495iftrue:
496  ret double %a1
497iffalse:
498  ret double %a2
499}
500
501define double @testdoubleule(double %c1, double %c2, double %c3, double %c4, double %a1, double %a2) #0 {
502; CHECK-LABEL: testdoubleule:
503; CHECK: crandc [[REG:[0-9]+]], 6, 2
504; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
505entry:
506  %cmp1 = fcmp oeq double %c3, %c4
507  %cmp3tmp = fcmp oeq double %c1, %c2
508  %cmp3 = icmp ule i1 %cmp3tmp, %cmp1
509  br i1 %cmp3, label %iftrue, label %iffalse
510iftrue:
511  ret double %a1
512iffalse:
513  ret double %a2
514}
515
516define double @testdoubleeq(double %c1, double %c2, double %c3, double %c4, double %a1, double %a2) #0 {
517; CHECK-LABEL: testdoubleeq
518; CHECK: crxor [[REG:[0-9]+]], 6, 2
519; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
520entry:
521  %cmp1 = fcmp oeq double %c3, %c4
522  %cmp3tmp = fcmp oeq double %c1, %c2
523  %cmp3 = icmp eq i1 %cmp3tmp, %cmp1
524  br i1 %cmp3, label %iftrue, label %iffalse
525iftrue:
526  ret double %a1
527iffalse:
528  ret double %a2
529}
530
531define double @testdoublesge(double %c1, double %c2, double %c3, double %c4, double %a1, double %a2) #0 {
532; CHECK-LABEL: testdoublesge
533; CHECK: crandc [[REG:[0-9]+]], 6, 2
534; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
535entry:
536  %cmp1 = fcmp oeq double %c3, %c4
537  %cmp3tmp = fcmp oeq double %c1, %c2
538  %cmp3 = icmp sge i1 %cmp3tmp, %cmp1
539  br i1 %cmp3, label %iftrue, label %iffalse
540iftrue:
541  ret double %a1
542iffalse:
543  ret double %a2
544}
545
546define double @testdoubleuge(double %c1, double %c2, double %c3, double %c4, double %a1, double %a2) #0 {
547; CHECK-LABEL: testdoubleuge
548; CHECK: crandc [[REG:[0-9]+]], 2, 6
549; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
550entry:
551  %cmp1 = fcmp oeq double %c3, %c4
552  %cmp3tmp = fcmp oeq double %c1, %c2
553  %cmp3 = icmp uge i1 %cmp3tmp, %cmp1
554  br i1 %cmp3, label %iftrue, label %iffalse
555iftrue:
556  ret double %a1
557iffalse:
558  ret double %a2
559}
560
561define double @testdoublesgt(double %c1, double %c2, double %c3, double %c4, double %a1, double %a2) #0 {
562; CHECK-LABEL: testdoublesgt:
563; CHECK: crorc [[REG:[0-9]+]], 6, 2
564; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
565entry:
566  %cmp1 = fcmp oeq double %c3, %c4
567  %cmp3tmp = fcmp oeq double %c1, %c2
568  %cmp3 = icmp sgt i1 %cmp3tmp, %cmp1
569  br i1 %cmp3, label %iftrue, label %iffalse
570iftrue:
571  ret double %a1
572iffalse:
573  ret double %a2
574}
575
576define double @testdoubleugt(double %c1, double %c2, double %c3, double %c4, double %a1, double %a2) #0 {
577; CHECK-LABEL: testdoubleugt
578; CHECK: crorc [[REG:[0-9]+]], 2, 6
579; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
580entry:
581  %cmp1 = fcmp oeq double %c3, %c4
582  %cmp3tmp = fcmp oeq double %c1, %c2
583  %cmp3 = icmp ugt i1 %cmp3tmp, %cmp1
584  br i1 %cmp3, label %iftrue, label %iffalse
585iftrue:
586  ret double %a1
587iffalse:
588  ret double %a2
589}
590
591define double @testdoublene(double %c1, double %c2, double %c3, double %c4, double %a1, double %a2) #0 {
592; CHECK-LABEL: testdoublene
593; CHECK: creqv [[REG:[0-9]+]], 6, 2
594; CHECK: bc 12, [[REG]], {{\.[a-zA-Z0-9_]+}}
595entry:
596  %cmp1 = fcmp oeq double %c3, %c4
597  %cmp3tmp = fcmp oeq double %c1, %c2
598  %cmp3 = icmp ne i1 %cmp3tmp, %cmp1
599  br i1 %cmp3, label %iftrue, label %iffalse
600iftrue:
601  ret double %a1
602iffalse:
603  ret double %a2
604}
605