blob: c9f7dda3dbddb37bf4b6dc84a8020be0fbfbfba8 [file] [log] [blame]
Venkatraman Govindarajuf27df332011-01-11 22:38:28 +00001; RUN: llc -march=sparc <%s | FileCheck %s
2
3
4define i32 @test_addx(i64 %a, i64 %b, i64 %c) nounwind readnone noinline {
5entry:
6; CHECK: addcc
7; CHECK-NOT: subcc
8; CHECK: addx
9 %0 = add i64 %a, %b
10 %1 = icmp ugt i64 %0, %c
11 %2 = zext i1 %1 to i32
12 ret i32 %2
13}
14
15
16define i32 @test_select_int_icc(i32 %a, i32 %b, i32 %c) nounwind readnone noinline {
17entry:
18; CHECK: test_select_int_icc
19; CHECK: subcc
20; CHECK: be
21 %0 = icmp eq i32 %a, 0
22 %1 = select i1 %0, i32 %b, i32 %c
23 ret i32 %1
24}
25
26
27define float @test_select_fp_icc(i32 %a, float %f1, float %f2) nounwind readnone noinline {
28entry:
29; CHECK: test_select_fp_icc
30; CHECK: subcc
31; CHECK: be
32 %0 = icmp eq i32 %a, 0
33 %1 = select i1 %0, float %f1, float %f2
34 ret float %1
35}
36
37define double @test_select_dfp_icc(i32 %a, double %f1, double %f2) nounwind readnone noinline {
38entry:
39; CHECK: test_select_fp_icc
40; CHECK: subcc
41; CHECK: be
42 %0 = icmp eq i32 %a, 0
43 %1 = select i1 %0, double %f1, double %f2
44 ret double %1
45}
46
47define i32 @test_select_int_fcc(float %f, i32 %a, i32 %b) nounwind readnone noinline {
48entry:
49;CHECK: test_select_int_fcc
50;CHECK: fcmps
51;CHECK: fbne
52 %0 = fcmp une float %f, 0.000000e+00
53 %a.b = select i1 %0, i32 %a, i32 %b
54 ret i32 %a.b
55}
56
57
58define float @test_select_fp_fcc(float %f, float %f1, float %f2) nounwind readnone noinline {
59entry:
60;CHECK: test_select_fp_fcc
61;CHECK: fcmps
62;CHECK: fbne
63 %0 = fcmp une float %f, 0.000000e+00
64 %1 = select i1 %0, float %f1, float %f2
65 ret float %1
66}
67
68define double @test_select_dfp_fcc(double %f, double %f1, double %f2) nounwind readnone noinline {
69entry:
70;CHECK: test_select_dfp_fcc
71;CHECK: fcmpd
72;CHECK: fbne
73 %0 = fcmp une double %f, 0.000000e+00
74 %1 = select i1 %0, double %f1, double %f2
75 ret double %1
76}