blob: edbcb4929ff0cd3997b4c5f99e69173543352b70 [file] [log] [blame]
Venkatraman Govindarajue105a392011-01-22 11:36:24 +00001; RUN: llc -march=sparc <%s | FileCheck %s -check-prefix=V8
2; RUN: llc -march=sparc -mattr=v9 <%s | FileCheck %s -check-prefix=V9
Venkatraman Govindarajuf27df332011-01-11 22:38:28 +00003
4
5define i32 @test_addx(i64 %a, i64 %b, i64 %c) nounwind readnone noinline {
6entry:
Venkatraman Govindarajue105a392011-01-22 11:36:24 +00007; 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
Venkatraman Govindarajuf27df332011-01-11 22:38:28 +000014 %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
21define i32 @test_select_int_icc(i32 %a, i32 %b, i32 %c) nounwind readnone noinline {
22entry:
Venkatraman Govindarajue105a392011-01-22 11:36:24 +000023; V8: test_select_int_icc
Venkatraman Govindaraju01021a82013-06-07 00:03:36 +000024; V8: cmp
Venkatraman Govindarajue105a392011-01-22 11:36:24 +000025; V8: {{be|bne}}
26; V9: test_select_int_icc
Venkatraman Govindaraju01021a82013-06-07 00:03:36 +000027; V9: cmp
Venkatraman Govindarajue105a392011-01-22 11:36:24 +000028; V9-NOT: {{be|bne}}
29; V9: mov{{e|ne}} %icc
Venkatraman Govindarajuf27df332011-01-11 22:38:28 +000030 %0 = icmp eq i32 %a, 0
31 %1 = select i1 %0, i32 %b, i32 %c
32 ret i32 %1
33}
34
35
36define float @test_select_fp_icc(i32 %a, float %f1, float %f2) nounwind readnone noinline {
37entry:
Venkatraman Govindarajue105a392011-01-22 11:36:24 +000038; V8: test_select_fp_icc
Venkatraman Govindaraju01021a82013-06-07 00:03:36 +000039; V8: cmp
Venkatraman Govindarajue105a392011-01-22 11:36:24 +000040; V8: {{be|bne}}
41; V9: test_select_fp_icc
Venkatraman Govindaraju01021a82013-06-07 00:03:36 +000042; V9: cmp
Venkatraman Govindarajue105a392011-01-22 11:36:24 +000043; V9-NOT: {{be|bne}}
44; V9: fmovs{{e|ne}} %icc
Venkatraman Govindarajuf27df332011-01-11 22:38:28 +000045 %0 = icmp eq i32 %a, 0
46 %1 = select i1 %0, float %f1, float %f2
47 ret float %1
48}
49
50define double @test_select_dfp_icc(i32 %a, double %f1, double %f2) nounwind readnone noinline {
51entry:
Venkatraman Govindarajue105a392011-01-22 11:36:24 +000052; V8: test_select_dfp_icc
Venkatraman Govindaraju01021a82013-06-07 00:03:36 +000053; V8: cmp
Venkatraman Govindarajue105a392011-01-22 11:36:24 +000054; V8: {{be|bne}}
55; V9: test_select_dfp_icc
Venkatraman Govindaraju01021a82013-06-07 00:03:36 +000056; V9: cmp
Benjamin Kramerfba80d92012-10-02 15:49:34 +000057; V9-NOT: {{be|bne}}
Venkatraman Govindarajue105a392011-01-22 11:36:24 +000058; V9: fmovd{{e|ne}} %icc
Venkatraman Govindarajuf27df332011-01-11 22:38:28 +000059 %0 = icmp eq i32 %a, 0
60 %1 = select i1 %0, double %f1, double %f2
61 ret double %1
62}
63
64define i32 @test_select_int_fcc(float %f, i32 %a, i32 %b) nounwind readnone noinline {
65entry:
Stephen Lincf2ab762013-07-18 22:47:09 +000066;V8-LABEL: test_select_int_fcc:
Venkatraman Govindarajue105a392011-01-22 11:36:24 +000067;V8: fcmps
68;V8: {{fbe|fbne}}
Stephen Lincf2ab762013-07-18 22:47:09 +000069;V9-LABEL: test_select_int_fcc:
Venkatraman Govindarajue105a392011-01-22 11:36:24 +000070;V9: fcmps
71;V9-NOT: {{fbe|fbne}}
72;V9: mov{{e|ne}} %fcc0
Venkatraman Govindarajuf27df332011-01-11 22:38:28 +000073 %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
79define float @test_select_fp_fcc(float %f, float %f1, float %f2) nounwind readnone noinline {
80entry:
Stephen Lincf2ab762013-07-18 22:47:09 +000081;V8-LABEL: test_select_fp_fcc:
Venkatraman Govindarajue105a392011-01-22 11:36:24 +000082;V8: fcmps
83;V8: {{fbe|fbne}}
Stephen Lincf2ab762013-07-18 22:47:09 +000084;V9-LABEL: test_select_fp_fcc:
Venkatraman Govindarajue105a392011-01-22 11:36:24 +000085;V9: fcmps
86;V9-NOT: {{fbe|fbne}}
87;V9: fmovs{{e|ne}} %fcc0
Venkatraman Govindarajuf27df332011-01-11 22:38:28 +000088 %0 = fcmp une float %f, 0.000000e+00
89 %1 = select i1 %0, float %f1, float %f2
90 ret float %1
91}
92
93define double @test_select_dfp_fcc(double %f, double %f1, double %f2) nounwind readnone noinline {
94entry:
Stephen Lincf2ab762013-07-18 22:47:09 +000095;V8-LABEL: test_select_dfp_fcc:
Venkatraman Govindarajue105a392011-01-22 11:36:24 +000096;V8: fcmpd
97;V8: {{fbne|fbe}}
Stephen Lincf2ab762013-07-18 22:47:09 +000098;V9-LABEL: test_select_dfp_fcc:
Venkatraman Govindarajue105a392011-01-22 11:36:24 +000099;V9: fcmpd
100;V9-NOT: {{fbne|fbe}}
101;V9: fmovd{{e|ne}} %fcc0
Venkatraman Govindarajuf27df332011-01-11 22:38:28 +0000102 %0 = fcmp une double %f, 0.000000e+00
103 %1 = select i1 %0, double %f1, double %f2
104 ret double %1
105}