1; RUN: llc < %s -mtriple=ve-unknown-unknown | FileCheck %s
2
3define float @selectccaf(float, float, float, float) {
4; CHECK-LABEL: selectccaf:
5; CHECK:       # %bb.0:
6; CHECK-NEXT:    or %s0, 0, %s3
7; CHECK-NEXT:    b.l.t (, %s10)
8  %5 = fcmp false float %0, 0.0
9  %6 = select i1 %5, float %2, float %3
10  ret float %6
11}
12
13define float @selectccat(float, float, float, float) {
14; CHECK-LABEL: selectccat:
15; CHECK:       # %bb.0:
16; CHECK-NEXT:    or %s0, 0, %s2
17; CHECK-NEXT:    b.l.t (, %s10)
18  %5 = fcmp true float %0, 0.0
19  %6 = select i1 %5, float %2, float %3
20  ret float %6
21}
22
23define float @selectccoeq(float, float, float, float) {
24; CHECK-LABEL: selectccoeq:
25; CHECK:       # %bb.0:
26; CHECK-NEXT:    lea.sl %s1, 0
27; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
28; CHECK-NEXT:    cmov.s.eq %s3, %s2, %s0
29; CHECK-NEXT:    or %s0, 0, %s3
30; CHECK-NEXT:    b.l.t (, %s10)
31  %5 = fcmp oeq float %0, 0.0
32  %6 = select i1 %5, float %2, float %3
33  ret float %6
34}
35
36define float @selectccone(float, float, float, float) {
37; CHECK-LABEL: selectccone:
38; CHECK:       # %bb.0:
39; CHECK-NEXT:    lea.sl %s1, 0
40; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
41; CHECK-NEXT:    cmov.s.ne %s3, %s2, %s0
42; CHECK-NEXT:    or %s0, 0, %s3
43; CHECK-NEXT:    b.l.t (, %s10)
44  %5 = fcmp one float %0, 0.0
45  %6 = select i1 %5, float %2, float %3
46  ret float %6
47}
48
49define float @selectccogt(float, float, float, float) {
50; CHECK-LABEL: selectccogt:
51; CHECK:       # %bb.0:
52; CHECK-NEXT:    lea.sl %s1, 0
53; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
54; CHECK-NEXT:    cmov.s.gt %s3, %s2, %s0
55; CHECK-NEXT:    or %s0, 0, %s3
56; CHECK-NEXT:    b.l.t (, %s10)
57  %5 = fcmp ogt float %0, 0.0
58  %6 = select i1 %5, float %2, float %3
59  ret float %6
60}
61
62define float @selectccoge(float, float, float, float) {
63; CHECK-LABEL: selectccoge:
64; CHECK:       # %bb.0:
65; CHECK-NEXT:    lea.sl %s1, 0
66; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
67; CHECK-NEXT:    cmov.s.ge %s3, %s2, %s0
68; CHECK-NEXT:    or %s0, 0, %s3
69; CHECK-NEXT:    b.l.t (, %s10)
70  %5 = fcmp oge float %0, 0.0
71  %6 = select i1 %5, float %2, float %3
72  ret float %6
73}
74
75define float @selectccolt(float, float, float, float) {
76; CHECK-LABEL: selectccolt:
77; CHECK:       # %bb.0:
78; CHECK-NEXT:    lea.sl %s1, 0
79; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
80; CHECK-NEXT:    cmov.s.lt %s3, %s2, %s0
81; CHECK-NEXT:    or %s0, 0, %s3
82; CHECK-NEXT:    b.l.t (, %s10)
83  %5 = fcmp olt float %0, 0.0
84  %6 = select i1 %5, float %2, float %3
85  ret float %6
86}
87
88define float @selectccole(float, float, float, float) {
89; CHECK-LABEL: selectccole:
90; CHECK:       # %bb.0:
91; CHECK-NEXT:    lea.sl %s1, 0
92; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
93; CHECK-NEXT:    cmov.s.le %s3, %s2, %s0
94; CHECK-NEXT:    or %s0, 0, %s3
95; CHECK-NEXT:    b.l.t (, %s10)
96  %5 = fcmp ole float %0, 0.0
97  %6 = select i1 %5, float %2, float %3
98  ret float %6
99}
100
101define float @selectccord(float, float, float, float) {
102; CHECK-LABEL: selectccord:
103; CHECK:       # %bb.0:
104; CHECK-NEXT:    fcmp.s %s0, %s0, %s0
105; CHECK-NEXT:    cmov.s.num %s3, %s2, %s0
106; CHECK-NEXT:    or %s0, 0, %s3
107; CHECK-NEXT:    b.l.t (, %s10)
108  %5 = fcmp ord float %0, 0.0
109  %6 = select i1 %5, float %2, float %3
110  ret float %6
111}
112
113define float @selectccuno(float, float, float, float) {
114; CHECK-LABEL: selectccuno:
115; CHECK:       # %bb.0:
116; CHECK-NEXT:    fcmp.s %s0, %s0, %s0
117; CHECK-NEXT:    cmov.s.nan %s3, %s2, %s0
118; CHECK-NEXT:    or %s0, 0, %s3
119; CHECK-NEXT:    b.l.t (, %s10)
120  %5 = fcmp uno float %0, 0.0
121  %6 = select i1 %5, float %2, float %3
122  ret float %6
123}
124
125define float @selectccueq(float, float, float, float) {
126; CHECK-LABEL: selectccueq:
127; CHECK:       # %bb.0:
128; CHECK-NEXT:    lea.sl %s1, 0
129; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
130; CHECK-NEXT:    cmov.s.eqnan %s3, %s2, %s0
131; CHECK-NEXT:    or %s0, 0, %s3
132; CHECK-NEXT:    b.l.t (, %s10)
133  %5 = fcmp ueq float %0, 0.0
134  %6 = select i1 %5, float %2, float %3
135  ret float %6
136}
137
138define float @selectccune(float, float, float, float) {
139; CHECK-LABEL: selectccune:
140; CHECK:       # %bb.0:
141; CHECK-NEXT:    lea.sl %s1, 0
142; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
143; CHECK-NEXT:    cmov.s.nenan %s3, %s2, %s0
144; CHECK-NEXT:    or %s0, 0, %s3
145; CHECK-NEXT:    b.l.t (, %s10)
146  %5 = fcmp une float %0, 0.0
147  %6 = select i1 %5, float %2, float %3
148  ret float %6
149}
150
151define float @selectccugt(float, float, float, float) {
152; CHECK-LABEL: selectccugt:
153; CHECK:       # %bb.0:
154; CHECK-NEXT:    lea.sl %s1, 0
155; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
156; CHECK-NEXT:    cmov.s.gtnan %s3, %s2, %s0
157; CHECK-NEXT:    or %s0, 0, %s3
158; CHECK-NEXT:    b.l.t (, %s10)
159  %5 = fcmp ugt float %0, 0.0
160  %6 = select i1 %5, float %2, float %3
161  ret float %6
162}
163
164define float @selectccuge(float, float, float, float) {
165; CHECK-LABEL: selectccuge:
166; CHECK:       # %bb.0:
167; CHECK-NEXT:    lea.sl %s1, 0
168; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
169; CHECK-NEXT:    cmov.s.genan %s3, %s2, %s0
170; CHECK-NEXT:    or %s0, 0, %s3
171; CHECK-NEXT:    b.l.t (, %s10)
172  %5 = fcmp uge float %0, 0.0
173  %6 = select i1 %5, float %2, float %3
174  ret float %6
175}
176
177define float @selectccult(float, float, float, float) {
178; CHECK-LABEL: selectccult:
179; CHECK:       # %bb.0:
180; CHECK-NEXT:    lea.sl %s1, 0
181; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
182; CHECK-NEXT:    cmov.s.ltnan %s3, %s2, %s0
183; CHECK-NEXT:    or %s0, 0, %s3
184; CHECK-NEXT:    b.l.t (, %s10)
185  %5 = fcmp ult float %0, 0.0
186  %6 = select i1 %5, float %2, float %3
187  ret float %6
188}
189
190define float @selectccule(float, float, float, float) {
191; CHECK-LABEL: selectccule:
192; CHECK:       # %bb.0:
193; CHECK-NEXT:    lea.sl %s1, 0
194; CHECK-NEXT:    fcmp.s %s0, %s0, %s1
195; CHECK-NEXT:    cmov.s.lenan %s3, %s2, %s0
196; CHECK-NEXT:    or %s0, 0, %s3
197; CHECK-NEXT:    b.l.t (, %s10)
198  %5 = fcmp ule float %0, 0.0
199  %6 = select i1 %5, float %2, float %3
200  ret float %6
201}
202