Eliminate LegalizeOps' LegalizedNodes map and have it just call RAUW
[oota-llvm.git] / test / CodeGen / SPARC / 2011-01-11-CC.ll
1 ; RUN: llc -march=sparc <%s | FileCheck %s -check-prefix=V8
2 ; RUN: llc -march=sparc -mattr=v9 <%s | FileCheck %s -check-prefix=V9
3
4
5 define i32 @test_addx(i64 %a, i64 %b, i64 %c) nounwind readnone noinline {
6 entry:
7 ; V8: addcc
8 ; V8-NOT: subcc
9 ; V8: addx
10 ; V9: addcc
11 ; V9-NOT: subcc
12 ; V9: addx
13 ; V9: mov{{e|ne}} %icc
14   %0 = add i64 %a, %b
15   %1 = icmp ugt i64 %0, %c
16   %2 = zext i1 %1 to i32
17   ret i32 %2
18 }
19
20
21 define i32 @test_select_int_icc(i32 %a, i32 %b, i32 %c) nounwind readnone noinline {
22 entry:
23 ; V8: test_select_int_icc
24 ; V8: subcc
25 ; V8: {{be|bne}}
26 ; V9: test_select_int_icc
27 ; V9: subcc
28 ; V9-NOT: {{be|bne}}
29 ; V9: mov{{e|ne}} %icc
30   %0 = icmp eq i32 %a, 0
31   %1 = select i1 %0, i32 %b, i32 %c
32   ret i32 %1
33 }
34
35
36 define float @test_select_fp_icc(i32 %a, float %f1, float %f2) nounwind readnone noinline {
37 entry:
38 ; V8: test_select_fp_icc
39 ; V8: subcc
40 ; V8: {{be|bne}}
41 ; V9: test_select_fp_icc
42 ; V9: subcc
43 ; V9-NOT: {{be|bne}}
44 ; V9: fmovs{{e|ne}} %icc
45   %0 = icmp eq i32 %a, 0
46   %1 = select i1 %0, float %f1, float %f2
47   ret float %1
48 }
49
50 define double @test_select_dfp_icc(i32 %a, double %f1, double %f2) nounwind readnone noinline {
51 entry:
52 ; V8: test_select_dfp_icc
53 ; V8: subcc
54 ; V8: {{be|bne}}
55 ; V9: test_select_dfp_icc
56 ; V9: subcc
57 ; V9=NOT: {{be|bne}}
58 ; V9: fmovd{{e|ne}} %icc
59   %0 = icmp eq i32 %a, 0
60   %1 = select i1 %0, double %f1, double %f2
61   ret double %1
62 }
63
64 define i32 @test_select_int_fcc(float %f, i32 %a, i32 %b) nounwind readnone noinline {
65 entry:
66 ;V8: test_select_int_fcc
67 ;V8: fcmps
68 ;V8: {{fbe|fbne}}
69 ;V9: test_select_int_fcc
70 ;V9: fcmps
71 ;V9-NOT: {{fbe|fbne}}
72 ;V9: mov{{e|ne}} %fcc0
73   %0 = fcmp une float %f, 0.000000e+00
74   %a.b = select i1 %0, i32 %a, i32 %b
75   ret i32 %a.b
76 }
77
78
79 define float @test_select_fp_fcc(float %f, float %f1, float %f2) nounwind readnone noinline {
80 entry:
81 ;V8: test_select_fp_fcc
82 ;V8: fcmps
83 ;V8: {{fbe|fbne}}
84 ;V9: test_select_fp_fcc
85 ;V9: fcmps
86 ;V9-NOT: {{fbe|fbne}}
87 ;V9: fmovs{{e|ne}} %fcc0
88   %0 = fcmp une float %f, 0.000000e+00
89   %1 = select i1 %0, float %f1, float %f2
90   ret float %1
91 }
92
93 define double @test_select_dfp_fcc(double %f, double %f1, double %f2) nounwind readnone noinline {
94 entry:
95 ;V8: test_select_dfp_fcc
96 ;V8: fcmpd
97 ;V8: {{fbne|fbe}}
98 ;V9: test_select_dfp_fcc
99 ;V9: fcmpd
100 ;V9-NOT: {{fbne|fbe}}
101 ;V9: fmovd{{e|ne}} %fcc0
102   %0 = fcmp une double %f, 0.000000e+00
103   %1 = select i1 %0, double %f1, double %f2
104   ret double %1
105 }