1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d -verify-machineinstrs < %s \
3 ; RUN: -target-abi=ilp32d | FileCheck %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+d -verify-machineinstrs < %s \
5 ; RUN: -target-abi=lp64d | FileCheck %s
6 ; RUN: llc -mtriple=riscv32 -mattr=+zdinx -verify-machineinstrs < %s \
7 ; RUN: -target-abi=ilp32 | FileCheck --check-prefix=CHECKRV32ZDINX %s
8 ; RUN: llc -mtriple=riscv64 -mattr=+zdinx -verify-machineinstrs < %s \
9 ; RUN: -target-abi=lp64 | FileCheck --check-prefix=CHECKRV64ZDINX %s
11 define double @select_fcmp_false(double %a, double %b) nounwind {
12 ; CHECK-LABEL: select_fcmp_false:
14 ; CHECK-NEXT: fmv.d fa0, fa1
17 ; CHECKRV32ZDINX-LABEL: select_fcmp_false:
18 ; CHECKRV32ZDINX: # %bb.0:
19 ; CHECKRV32ZDINX-NEXT: mv a1, a3
20 ; CHECKRV32ZDINX-NEXT: mv a0, a2
21 ; CHECKRV32ZDINX-NEXT: ret
23 ; CHECKRV64ZDINX-LABEL: select_fcmp_false:
24 ; CHECKRV64ZDINX: # %bb.0:
25 ; CHECKRV64ZDINX-NEXT: mv a0, a1
26 ; CHECKRV64ZDINX-NEXT: ret
27 %1 = fcmp false double %a, %b
28 %2 = select i1 %1, double %a, double %b
32 define double @select_fcmp_oeq(double %a, double %b) nounwind {
33 ; CHECK-LABEL: select_fcmp_oeq:
35 ; CHECK-NEXT: feq.d a0, fa0, fa1
36 ; CHECK-NEXT: bnez a0, .LBB1_2
37 ; CHECK-NEXT: # %bb.1:
38 ; CHECK-NEXT: fmv.d fa0, fa1
39 ; CHECK-NEXT: .LBB1_2:
42 ; CHECKRV32ZDINX-LABEL: select_fcmp_oeq:
43 ; CHECKRV32ZDINX: # %bb.0:
44 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
45 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
46 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
47 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
48 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
49 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
50 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
51 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
52 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
53 ; CHECKRV32ZDINX-NEXT: feq.d a4, a0, a2
54 ; CHECKRV32ZDINX-NEXT: bnez a4, .LBB1_2
55 ; CHECKRV32ZDINX-NEXT: # %bb.1:
56 ; CHECKRV32ZDINX-NEXT: mv a0, a2
57 ; CHECKRV32ZDINX-NEXT: mv a1, a3
58 ; CHECKRV32ZDINX-NEXT: .LBB1_2:
59 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
60 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
61 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
62 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
63 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
64 ; CHECKRV32ZDINX-NEXT: ret
66 ; CHECKRV64ZDINX-LABEL: select_fcmp_oeq:
67 ; CHECKRV64ZDINX: # %bb.0:
68 ; CHECKRV64ZDINX-NEXT: feq.d a2, a0, a1
69 ; CHECKRV64ZDINX-NEXT: bnez a2, .LBB1_2
70 ; CHECKRV64ZDINX-NEXT: # %bb.1:
71 ; CHECKRV64ZDINX-NEXT: mv a0, a1
72 ; CHECKRV64ZDINX-NEXT: .LBB1_2:
73 ; CHECKRV64ZDINX-NEXT: ret
74 %1 = fcmp oeq double %a, %b
75 %2 = select i1 %1, double %a, double %b
79 define double @select_fcmp_ogt(double %a, double %b) nounwind {
80 ; CHECK-LABEL: select_fcmp_ogt:
82 ; CHECK-NEXT: flt.d a0, fa1, fa0
83 ; CHECK-NEXT: bnez a0, .LBB2_2
84 ; CHECK-NEXT: # %bb.1:
85 ; CHECK-NEXT: fmv.d fa0, fa1
86 ; CHECK-NEXT: .LBB2_2:
89 ; CHECKRV32ZDINX-LABEL: select_fcmp_ogt:
90 ; CHECKRV32ZDINX: # %bb.0:
91 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
92 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
93 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
94 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
95 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
96 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
97 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
98 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
99 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
100 ; CHECKRV32ZDINX-NEXT: flt.d a4, a2, a0
101 ; CHECKRV32ZDINX-NEXT: bnez a4, .LBB2_2
102 ; CHECKRV32ZDINX-NEXT: # %bb.1:
103 ; CHECKRV32ZDINX-NEXT: mv a0, a2
104 ; CHECKRV32ZDINX-NEXT: mv a1, a3
105 ; CHECKRV32ZDINX-NEXT: .LBB2_2:
106 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
107 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
108 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
109 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
110 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
111 ; CHECKRV32ZDINX-NEXT: ret
113 ; CHECKRV64ZDINX-LABEL: select_fcmp_ogt:
114 ; CHECKRV64ZDINX: # %bb.0:
115 ; CHECKRV64ZDINX-NEXT: flt.d a2, a1, a0
116 ; CHECKRV64ZDINX-NEXT: bnez a2, .LBB2_2
117 ; CHECKRV64ZDINX-NEXT: # %bb.1:
118 ; CHECKRV64ZDINX-NEXT: mv a0, a1
119 ; CHECKRV64ZDINX-NEXT: .LBB2_2:
120 ; CHECKRV64ZDINX-NEXT: ret
121 %1 = fcmp ogt double %a, %b
122 %2 = select i1 %1, double %a, double %b
126 define double @select_fcmp_oge(double %a, double %b) nounwind {
127 ; CHECK-LABEL: select_fcmp_oge:
129 ; CHECK-NEXT: fle.d a0, fa1, fa0
130 ; CHECK-NEXT: bnez a0, .LBB3_2
131 ; CHECK-NEXT: # %bb.1:
132 ; CHECK-NEXT: fmv.d fa0, fa1
133 ; CHECK-NEXT: .LBB3_2:
136 ; CHECKRV32ZDINX-LABEL: select_fcmp_oge:
137 ; CHECKRV32ZDINX: # %bb.0:
138 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
139 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
140 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
141 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
142 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
143 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
144 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
145 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
146 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
147 ; CHECKRV32ZDINX-NEXT: fle.d a4, a2, a0
148 ; CHECKRV32ZDINX-NEXT: bnez a4, .LBB3_2
149 ; CHECKRV32ZDINX-NEXT: # %bb.1:
150 ; CHECKRV32ZDINX-NEXT: mv a0, a2
151 ; CHECKRV32ZDINX-NEXT: mv a1, a3
152 ; CHECKRV32ZDINX-NEXT: .LBB3_2:
153 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
154 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
155 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
156 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
157 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
158 ; CHECKRV32ZDINX-NEXT: ret
160 ; CHECKRV64ZDINX-LABEL: select_fcmp_oge:
161 ; CHECKRV64ZDINX: # %bb.0:
162 ; CHECKRV64ZDINX-NEXT: fle.d a2, a1, a0
163 ; CHECKRV64ZDINX-NEXT: bnez a2, .LBB3_2
164 ; CHECKRV64ZDINX-NEXT: # %bb.1:
165 ; CHECKRV64ZDINX-NEXT: mv a0, a1
166 ; CHECKRV64ZDINX-NEXT: .LBB3_2:
167 ; CHECKRV64ZDINX-NEXT: ret
168 %1 = fcmp oge double %a, %b
169 %2 = select i1 %1, double %a, double %b
173 define double @select_fcmp_olt(double %a, double %b) nounwind {
174 ; CHECK-LABEL: select_fcmp_olt:
176 ; CHECK-NEXT: flt.d a0, fa0, fa1
177 ; CHECK-NEXT: bnez a0, .LBB4_2
178 ; CHECK-NEXT: # %bb.1:
179 ; CHECK-NEXT: fmv.d fa0, fa1
180 ; CHECK-NEXT: .LBB4_2:
183 ; CHECKRV32ZDINX-LABEL: select_fcmp_olt:
184 ; CHECKRV32ZDINX: # %bb.0:
185 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
186 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
187 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
188 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
189 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
190 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
191 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
192 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
193 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
194 ; CHECKRV32ZDINX-NEXT: flt.d a4, a0, a2
195 ; CHECKRV32ZDINX-NEXT: bnez a4, .LBB4_2
196 ; CHECKRV32ZDINX-NEXT: # %bb.1:
197 ; CHECKRV32ZDINX-NEXT: mv a0, a2
198 ; CHECKRV32ZDINX-NEXT: mv a1, a3
199 ; CHECKRV32ZDINX-NEXT: .LBB4_2:
200 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
201 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
202 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
203 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
204 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
205 ; CHECKRV32ZDINX-NEXT: ret
207 ; CHECKRV64ZDINX-LABEL: select_fcmp_olt:
208 ; CHECKRV64ZDINX: # %bb.0:
209 ; CHECKRV64ZDINX-NEXT: flt.d a2, a0, a1
210 ; CHECKRV64ZDINX-NEXT: bnez a2, .LBB4_2
211 ; CHECKRV64ZDINX-NEXT: # %bb.1:
212 ; CHECKRV64ZDINX-NEXT: mv a0, a1
213 ; CHECKRV64ZDINX-NEXT: .LBB4_2:
214 ; CHECKRV64ZDINX-NEXT: ret
215 %1 = fcmp olt double %a, %b
216 %2 = select i1 %1, double %a, double %b
220 define double @select_fcmp_ole(double %a, double %b) nounwind {
221 ; CHECK-LABEL: select_fcmp_ole:
223 ; CHECK-NEXT: fle.d a0, fa0, fa1
224 ; CHECK-NEXT: bnez a0, .LBB5_2
225 ; CHECK-NEXT: # %bb.1:
226 ; CHECK-NEXT: fmv.d fa0, fa1
227 ; CHECK-NEXT: .LBB5_2:
230 ; CHECKRV32ZDINX-LABEL: select_fcmp_ole:
231 ; CHECKRV32ZDINX: # %bb.0:
232 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
233 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
234 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
235 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
236 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
237 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
238 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
239 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
240 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
241 ; CHECKRV32ZDINX-NEXT: fle.d a4, a0, a2
242 ; CHECKRV32ZDINX-NEXT: bnez a4, .LBB5_2
243 ; CHECKRV32ZDINX-NEXT: # %bb.1:
244 ; CHECKRV32ZDINX-NEXT: mv a0, a2
245 ; CHECKRV32ZDINX-NEXT: mv a1, a3
246 ; CHECKRV32ZDINX-NEXT: .LBB5_2:
247 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
248 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
249 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
250 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
251 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
252 ; CHECKRV32ZDINX-NEXT: ret
254 ; CHECKRV64ZDINX-LABEL: select_fcmp_ole:
255 ; CHECKRV64ZDINX: # %bb.0:
256 ; CHECKRV64ZDINX-NEXT: fle.d a2, a0, a1
257 ; CHECKRV64ZDINX-NEXT: bnez a2, .LBB5_2
258 ; CHECKRV64ZDINX-NEXT: # %bb.1:
259 ; CHECKRV64ZDINX-NEXT: mv a0, a1
260 ; CHECKRV64ZDINX-NEXT: .LBB5_2:
261 ; CHECKRV64ZDINX-NEXT: ret
262 %1 = fcmp ole double %a, %b
263 %2 = select i1 %1, double %a, double %b
267 define double @select_fcmp_one(double %a, double %b) nounwind {
268 ; CHECK-LABEL: select_fcmp_one:
270 ; CHECK-NEXT: flt.d a0, fa0, fa1
271 ; CHECK-NEXT: flt.d a1, fa1, fa0
272 ; CHECK-NEXT: or a0, a1, a0
273 ; CHECK-NEXT: bnez a0, .LBB6_2
274 ; CHECK-NEXT: # %bb.1:
275 ; CHECK-NEXT: fmv.d fa0, fa1
276 ; CHECK-NEXT: .LBB6_2:
279 ; CHECKRV32ZDINX-LABEL: select_fcmp_one:
280 ; CHECKRV32ZDINX: # %bb.0:
281 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
282 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
283 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
284 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
285 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
286 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
287 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
288 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
289 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
290 ; CHECKRV32ZDINX-NEXT: flt.d a4, a0, a2
291 ; CHECKRV32ZDINX-NEXT: flt.d a5, a2, a0
292 ; CHECKRV32ZDINX-NEXT: or a4, a5, a4
293 ; CHECKRV32ZDINX-NEXT: bnez a4, .LBB6_2
294 ; CHECKRV32ZDINX-NEXT: # %bb.1:
295 ; CHECKRV32ZDINX-NEXT: mv a0, a2
296 ; CHECKRV32ZDINX-NEXT: mv a1, a3
297 ; CHECKRV32ZDINX-NEXT: .LBB6_2:
298 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
299 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
300 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
301 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
302 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
303 ; CHECKRV32ZDINX-NEXT: ret
305 ; CHECKRV64ZDINX-LABEL: select_fcmp_one:
306 ; CHECKRV64ZDINX: # %bb.0:
307 ; CHECKRV64ZDINX-NEXT: flt.d a2, a0, a1
308 ; CHECKRV64ZDINX-NEXT: flt.d a3, a1, a0
309 ; CHECKRV64ZDINX-NEXT: or a2, a3, a2
310 ; CHECKRV64ZDINX-NEXT: bnez a2, .LBB6_2
311 ; CHECKRV64ZDINX-NEXT: # %bb.1:
312 ; CHECKRV64ZDINX-NEXT: mv a0, a1
313 ; CHECKRV64ZDINX-NEXT: .LBB6_2:
314 ; CHECKRV64ZDINX-NEXT: ret
315 %1 = fcmp one double %a, %b
316 %2 = select i1 %1, double %a, double %b
320 define double @select_fcmp_ord(double %a, double %b) nounwind {
321 ; CHECK-LABEL: select_fcmp_ord:
323 ; CHECK-NEXT: feq.d a0, fa1, fa1
324 ; CHECK-NEXT: feq.d a1, fa0, fa0
325 ; CHECK-NEXT: and a0, a1, a0
326 ; CHECK-NEXT: bnez a0, .LBB7_2
327 ; CHECK-NEXT: # %bb.1:
328 ; CHECK-NEXT: fmv.d fa0, fa1
329 ; CHECK-NEXT: .LBB7_2:
332 ; CHECKRV32ZDINX-LABEL: select_fcmp_ord:
333 ; CHECKRV32ZDINX: # %bb.0:
334 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
335 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
336 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
337 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
338 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
339 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
340 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
341 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
342 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
343 ; CHECKRV32ZDINX-NEXT: feq.d a4, a2, a2
344 ; CHECKRV32ZDINX-NEXT: feq.d a5, a0, a0
345 ; CHECKRV32ZDINX-NEXT: and a4, a5, a4
346 ; CHECKRV32ZDINX-NEXT: bnez a4, .LBB7_2
347 ; CHECKRV32ZDINX-NEXT: # %bb.1:
348 ; CHECKRV32ZDINX-NEXT: mv a0, a2
349 ; CHECKRV32ZDINX-NEXT: mv a1, a3
350 ; CHECKRV32ZDINX-NEXT: .LBB7_2:
351 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
352 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
353 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
354 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
355 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
356 ; CHECKRV32ZDINX-NEXT: ret
358 ; CHECKRV64ZDINX-LABEL: select_fcmp_ord:
359 ; CHECKRV64ZDINX: # %bb.0:
360 ; CHECKRV64ZDINX-NEXT: feq.d a2, a1, a1
361 ; CHECKRV64ZDINX-NEXT: feq.d a3, a0, a0
362 ; CHECKRV64ZDINX-NEXT: and a2, a3, a2
363 ; CHECKRV64ZDINX-NEXT: bnez a2, .LBB7_2
364 ; CHECKRV64ZDINX-NEXT: # %bb.1:
365 ; CHECKRV64ZDINX-NEXT: mv a0, a1
366 ; CHECKRV64ZDINX-NEXT: .LBB7_2:
367 ; CHECKRV64ZDINX-NEXT: ret
368 %1 = fcmp ord double %a, %b
369 %2 = select i1 %1, double %a, double %b
373 define double @select_fcmp_ueq(double %a, double %b) nounwind {
374 ; CHECK-LABEL: select_fcmp_ueq:
376 ; CHECK-NEXT: flt.d a0, fa0, fa1
377 ; CHECK-NEXT: flt.d a1, fa1, fa0
378 ; CHECK-NEXT: or a0, a1, a0
379 ; CHECK-NEXT: beqz a0, .LBB8_2
380 ; CHECK-NEXT: # %bb.1:
381 ; CHECK-NEXT: fmv.d fa0, fa1
382 ; CHECK-NEXT: .LBB8_2:
385 ; CHECKRV32ZDINX-LABEL: select_fcmp_ueq:
386 ; CHECKRV32ZDINX: # %bb.0:
387 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
388 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
389 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
390 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
391 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
392 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
393 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
394 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
395 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
396 ; CHECKRV32ZDINX-NEXT: flt.d a4, a0, a2
397 ; CHECKRV32ZDINX-NEXT: flt.d a5, a2, a0
398 ; CHECKRV32ZDINX-NEXT: or a4, a5, a4
399 ; CHECKRV32ZDINX-NEXT: beqz a4, .LBB8_2
400 ; CHECKRV32ZDINX-NEXT: # %bb.1:
401 ; CHECKRV32ZDINX-NEXT: mv a0, a2
402 ; CHECKRV32ZDINX-NEXT: mv a1, a3
403 ; CHECKRV32ZDINX-NEXT: .LBB8_2:
404 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
405 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
406 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
407 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
408 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
409 ; CHECKRV32ZDINX-NEXT: ret
411 ; CHECKRV64ZDINX-LABEL: select_fcmp_ueq:
412 ; CHECKRV64ZDINX: # %bb.0:
413 ; CHECKRV64ZDINX-NEXT: flt.d a2, a0, a1
414 ; CHECKRV64ZDINX-NEXT: flt.d a3, a1, a0
415 ; CHECKRV64ZDINX-NEXT: or a2, a3, a2
416 ; CHECKRV64ZDINX-NEXT: beqz a2, .LBB8_2
417 ; CHECKRV64ZDINX-NEXT: # %bb.1:
418 ; CHECKRV64ZDINX-NEXT: mv a0, a1
419 ; CHECKRV64ZDINX-NEXT: .LBB8_2:
420 ; CHECKRV64ZDINX-NEXT: ret
421 %1 = fcmp ueq double %a, %b
422 %2 = select i1 %1, double %a, double %b
426 define double @select_fcmp_ugt(double %a, double %b) nounwind {
427 ; CHECK-LABEL: select_fcmp_ugt:
429 ; CHECK-NEXT: fle.d a0, fa0, fa1
430 ; CHECK-NEXT: beqz a0, .LBB9_2
431 ; CHECK-NEXT: # %bb.1:
432 ; CHECK-NEXT: fmv.d fa0, fa1
433 ; CHECK-NEXT: .LBB9_2:
436 ; CHECKRV32ZDINX-LABEL: select_fcmp_ugt:
437 ; CHECKRV32ZDINX: # %bb.0:
438 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
439 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
440 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
441 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
442 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
443 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
444 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
445 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
446 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
447 ; CHECKRV32ZDINX-NEXT: fle.d a4, a0, a2
448 ; CHECKRV32ZDINX-NEXT: beqz a4, .LBB9_2
449 ; CHECKRV32ZDINX-NEXT: # %bb.1:
450 ; CHECKRV32ZDINX-NEXT: mv a0, a2
451 ; CHECKRV32ZDINX-NEXT: mv a1, a3
452 ; CHECKRV32ZDINX-NEXT: .LBB9_2:
453 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
454 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
455 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
456 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
457 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
458 ; CHECKRV32ZDINX-NEXT: ret
460 ; CHECKRV64ZDINX-LABEL: select_fcmp_ugt:
461 ; CHECKRV64ZDINX: # %bb.0:
462 ; CHECKRV64ZDINX-NEXT: fle.d a2, a0, a1
463 ; CHECKRV64ZDINX-NEXT: beqz a2, .LBB9_2
464 ; CHECKRV64ZDINX-NEXT: # %bb.1:
465 ; CHECKRV64ZDINX-NEXT: mv a0, a1
466 ; CHECKRV64ZDINX-NEXT: .LBB9_2:
467 ; CHECKRV64ZDINX-NEXT: ret
468 %1 = fcmp ugt double %a, %b
469 %2 = select i1 %1, double %a, double %b
473 define double @select_fcmp_uge(double %a, double %b) nounwind {
474 ; CHECK-LABEL: select_fcmp_uge:
476 ; CHECK-NEXT: flt.d a0, fa0, fa1
477 ; CHECK-NEXT: beqz a0, .LBB10_2
478 ; CHECK-NEXT: # %bb.1:
479 ; CHECK-NEXT: fmv.d fa0, fa1
480 ; CHECK-NEXT: .LBB10_2:
483 ; CHECKRV32ZDINX-LABEL: select_fcmp_uge:
484 ; CHECKRV32ZDINX: # %bb.0:
485 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
486 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
487 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
488 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
489 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
490 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
491 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
492 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
493 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
494 ; CHECKRV32ZDINX-NEXT: flt.d a4, a0, a2
495 ; CHECKRV32ZDINX-NEXT: beqz a4, .LBB10_2
496 ; CHECKRV32ZDINX-NEXT: # %bb.1:
497 ; CHECKRV32ZDINX-NEXT: mv a0, a2
498 ; CHECKRV32ZDINX-NEXT: mv a1, a3
499 ; CHECKRV32ZDINX-NEXT: .LBB10_2:
500 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
501 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
502 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
503 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
504 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
505 ; CHECKRV32ZDINX-NEXT: ret
507 ; CHECKRV64ZDINX-LABEL: select_fcmp_uge:
508 ; CHECKRV64ZDINX: # %bb.0:
509 ; CHECKRV64ZDINX-NEXT: flt.d a2, a0, a1
510 ; CHECKRV64ZDINX-NEXT: beqz a2, .LBB10_2
511 ; CHECKRV64ZDINX-NEXT: # %bb.1:
512 ; CHECKRV64ZDINX-NEXT: mv a0, a1
513 ; CHECKRV64ZDINX-NEXT: .LBB10_2:
514 ; CHECKRV64ZDINX-NEXT: ret
515 %1 = fcmp uge double %a, %b
516 %2 = select i1 %1, double %a, double %b
520 define double @select_fcmp_ult(double %a, double %b) nounwind {
521 ; CHECK-LABEL: select_fcmp_ult:
523 ; CHECK-NEXT: fle.d a0, fa1, fa0
524 ; CHECK-NEXT: beqz a0, .LBB11_2
525 ; CHECK-NEXT: # %bb.1:
526 ; CHECK-NEXT: fmv.d fa0, fa1
527 ; CHECK-NEXT: .LBB11_2:
530 ; CHECKRV32ZDINX-LABEL: select_fcmp_ult:
531 ; CHECKRV32ZDINX: # %bb.0:
532 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
533 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
534 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
535 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
536 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
537 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
538 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
539 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
540 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
541 ; CHECKRV32ZDINX-NEXT: fle.d a4, a2, a0
542 ; CHECKRV32ZDINX-NEXT: beqz a4, .LBB11_2
543 ; CHECKRV32ZDINX-NEXT: # %bb.1:
544 ; CHECKRV32ZDINX-NEXT: mv a0, a2
545 ; CHECKRV32ZDINX-NEXT: mv a1, a3
546 ; CHECKRV32ZDINX-NEXT: .LBB11_2:
547 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
548 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
549 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
550 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
551 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
552 ; CHECKRV32ZDINX-NEXT: ret
554 ; CHECKRV64ZDINX-LABEL: select_fcmp_ult:
555 ; CHECKRV64ZDINX: # %bb.0:
556 ; CHECKRV64ZDINX-NEXT: fle.d a2, a1, a0
557 ; CHECKRV64ZDINX-NEXT: beqz a2, .LBB11_2
558 ; CHECKRV64ZDINX-NEXT: # %bb.1:
559 ; CHECKRV64ZDINX-NEXT: mv a0, a1
560 ; CHECKRV64ZDINX-NEXT: .LBB11_2:
561 ; CHECKRV64ZDINX-NEXT: ret
562 %1 = fcmp ult double %a, %b
563 %2 = select i1 %1, double %a, double %b
567 define double @select_fcmp_ule(double %a, double %b) nounwind {
568 ; CHECK-LABEL: select_fcmp_ule:
570 ; CHECK-NEXT: flt.d a0, fa1, fa0
571 ; CHECK-NEXT: beqz a0, .LBB12_2
572 ; CHECK-NEXT: # %bb.1:
573 ; CHECK-NEXT: fmv.d fa0, fa1
574 ; CHECK-NEXT: .LBB12_2:
577 ; CHECKRV32ZDINX-LABEL: select_fcmp_ule:
578 ; CHECKRV32ZDINX: # %bb.0:
579 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
580 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
581 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
582 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
583 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
584 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
585 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
586 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
587 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
588 ; CHECKRV32ZDINX-NEXT: flt.d a4, a2, a0
589 ; CHECKRV32ZDINX-NEXT: beqz a4, .LBB12_2
590 ; CHECKRV32ZDINX-NEXT: # %bb.1:
591 ; CHECKRV32ZDINX-NEXT: mv a0, a2
592 ; CHECKRV32ZDINX-NEXT: mv a1, a3
593 ; CHECKRV32ZDINX-NEXT: .LBB12_2:
594 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
595 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
596 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
597 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
598 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
599 ; CHECKRV32ZDINX-NEXT: ret
601 ; CHECKRV64ZDINX-LABEL: select_fcmp_ule:
602 ; CHECKRV64ZDINX: # %bb.0:
603 ; CHECKRV64ZDINX-NEXT: flt.d a2, a1, a0
604 ; CHECKRV64ZDINX-NEXT: beqz a2, .LBB12_2
605 ; CHECKRV64ZDINX-NEXT: # %bb.1:
606 ; CHECKRV64ZDINX-NEXT: mv a0, a1
607 ; CHECKRV64ZDINX-NEXT: .LBB12_2:
608 ; CHECKRV64ZDINX-NEXT: ret
609 %1 = fcmp ule double %a, %b
610 %2 = select i1 %1, double %a, double %b
614 define double @select_fcmp_une(double %a, double %b) nounwind {
615 ; CHECK-LABEL: select_fcmp_une:
617 ; CHECK-NEXT: feq.d a0, fa0, fa1
618 ; CHECK-NEXT: beqz a0, .LBB13_2
619 ; CHECK-NEXT: # %bb.1:
620 ; CHECK-NEXT: fmv.d fa0, fa1
621 ; CHECK-NEXT: .LBB13_2:
624 ; CHECKRV32ZDINX-LABEL: select_fcmp_une:
625 ; CHECKRV32ZDINX: # %bb.0:
626 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
627 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
628 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
629 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
630 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
631 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
632 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
633 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
634 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
635 ; CHECKRV32ZDINX-NEXT: feq.d a4, a0, a2
636 ; CHECKRV32ZDINX-NEXT: beqz a4, .LBB13_2
637 ; CHECKRV32ZDINX-NEXT: # %bb.1:
638 ; CHECKRV32ZDINX-NEXT: mv a0, a2
639 ; CHECKRV32ZDINX-NEXT: mv a1, a3
640 ; CHECKRV32ZDINX-NEXT: .LBB13_2:
641 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
642 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
643 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
644 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
645 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
646 ; CHECKRV32ZDINX-NEXT: ret
648 ; CHECKRV64ZDINX-LABEL: select_fcmp_une:
649 ; CHECKRV64ZDINX: # %bb.0:
650 ; CHECKRV64ZDINX-NEXT: feq.d a2, a0, a1
651 ; CHECKRV64ZDINX-NEXT: beqz a2, .LBB13_2
652 ; CHECKRV64ZDINX-NEXT: # %bb.1:
653 ; CHECKRV64ZDINX-NEXT: mv a0, a1
654 ; CHECKRV64ZDINX-NEXT: .LBB13_2:
655 ; CHECKRV64ZDINX-NEXT: ret
656 %1 = fcmp une double %a, %b
657 %2 = select i1 %1, double %a, double %b
661 define double @select_fcmp_uno(double %a, double %b) nounwind {
662 ; CHECK-LABEL: select_fcmp_uno:
664 ; CHECK-NEXT: feq.d a0, fa1, fa1
665 ; CHECK-NEXT: feq.d a1, fa0, fa0
666 ; CHECK-NEXT: and a0, a1, a0
667 ; CHECK-NEXT: beqz a0, .LBB14_2
668 ; CHECK-NEXT: # %bb.1:
669 ; CHECK-NEXT: fmv.d fa0, fa1
670 ; CHECK-NEXT: .LBB14_2:
673 ; CHECKRV32ZDINX-LABEL: select_fcmp_uno:
674 ; CHECKRV32ZDINX: # %bb.0:
675 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
676 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
677 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
678 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
679 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
680 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
681 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
682 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
683 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
684 ; CHECKRV32ZDINX-NEXT: feq.d a4, a2, a2
685 ; CHECKRV32ZDINX-NEXT: feq.d a5, a0, a0
686 ; CHECKRV32ZDINX-NEXT: and a4, a5, a4
687 ; CHECKRV32ZDINX-NEXT: beqz a4, .LBB14_2
688 ; CHECKRV32ZDINX-NEXT: # %bb.1:
689 ; CHECKRV32ZDINX-NEXT: mv a0, a2
690 ; CHECKRV32ZDINX-NEXT: mv a1, a3
691 ; CHECKRV32ZDINX-NEXT: .LBB14_2:
692 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
693 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
694 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
695 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
696 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
697 ; CHECKRV32ZDINX-NEXT: ret
699 ; CHECKRV64ZDINX-LABEL: select_fcmp_uno:
700 ; CHECKRV64ZDINX: # %bb.0:
701 ; CHECKRV64ZDINX-NEXT: feq.d a2, a1, a1
702 ; CHECKRV64ZDINX-NEXT: feq.d a3, a0, a0
703 ; CHECKRV64ZDINX-NEXT: and a2, a3, a2
704 ; CHECKRV64ZDINX-NEXT: beqz a2, .LBB14_2
705 ; CHECKRV64ZDINX-NEXT: # %bb.1:
706 ; CHECKRV64ZDINX-NEXT: mv a0, a1
707 ; CHECKRV64ZDINX-NEXT: .LBB14_2:
708 ; CHECKRV64ZDINX-NEXT: ret
709 %1 = fcmp uno double %a, %b
710 %2 = select i1 %1, double %a, double %b
714 define double @select_fcmp_true(double %a, double %b) nounwind {
715 ; CHECK-LABEL: select_fcmp_true:
719 ; CHECKRV32ZDINX-LABEL: select_fcmp_true:
720 ; CHECKRV32ZDINX: # %bb.0:
721 ; CHECKRV32ZDINX-NEXT: ret
723 ; CHECKRV64ZDINX-LABEL: select_fcmp_true:
724 ; CHECKRV64ZDINX: # %bb.0:
725 ; CHECKRV64ZDINX-NEXT: ret
726 %1 = fcmp true double %a, %b
727 %2 = select i1 %1, double %a, double %b
731 ; Ensure that ISel succeeds for a select+fcmp that has an i32 result type.
732 define i32 @i32_select_fcmp_oeq(double %a, double %b, i32 %c, i32 %d) nounwind {
733 ; CHECK-LABEL: i32_select_fcmp_oeq:
735 ; CHECK-NEXT: feq.d a2, fa0, fa1
736 ; CHECK-NEXT: bnez a2, .LBB16_2
737 ; CHECK-NEXT: # %bb.1:
738 ; CHECK-NEXT: mv a0, a1
739 ; CHECK-NEXT: .LBB16_2:
742 ; CHECKRV32ZDINX-LABEL: i32_select_fcmp_oeq:
743 ; CHECKRV32ZDINX: # %bb.0:
744 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
745 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
746 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
747 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
748 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
749 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
750 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
751 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
752 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
753 ; CHECKRV32ZDINX-NEXT: feq.d a1, a0, a2
754 ; CHECKRV32ZDINX-NEXT: mv a0, a4
755 ; CHECKRV32ZDINX-NEXT: bnez a1, .LBB16_2
756 ; CHECKRV32ZDINX-NEXT: # %bb.1:
757 ; CHECKRV32ZDINX-NEXT: mv a0, a5
758 ; CHECKRV32ZDINX-NEXT: .LBB16_2:
759 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
760 ; CHECKRV32ZDINX-NEXT: ret
762 ; CHECKRV64ZDINX-LABEL: i32_select_fcmp_oeq:
763 ; CHECKRV64ZDINX: # %bb.0:
764 ; CHECKRV64ZDINX-NEXT: feq.d a1, a0, a1
765 ; CHECKRV64ZDINX-NEXT: mv a0, a2
766 ; CHECKRV64ZDINX-NEXT: bnez a1, .LBB16_2
767 ; CHECKRV64ZDINX-NEXT: # %bb.1:
768 ; CHECKRV64ZDINX-NEXT: mv a0, a3
769 ; CHECKRV64ZDINX-NEXT: .LBB16_2:
770 ; CHECKRV64ZDINX-NEXT: ret
771 %1 = fcmp oeq double %a, %b
772 %2 = select i1 %1, i32 %c, i32 %d
776 define i32 @select_fcmp_oeq_1_2(double %a, double %b) {
777 ; CHECK-LABEL: select_fcmp_oeq_1_2:
779 ; CHECK-NEXT: feq.d a0, fa0, fa1
780 ; CHECK-NEXT: li a1, 2
781 ; CHECK-NEXT: sub a0, a1, a0
784 ; CHECKRV32ZDINX-LABEL: select_fcmp_oeq_1_2:
785 ; CHECKRV32ZDINX: # %bb.0:
786 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
787 ; CHECKRV32ZDINX-NEXT: .cfi_def_cfa_offset 16
788 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
789 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
790 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
791 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
792 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
793 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
794 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
795 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
796 ; CHECKRV32ZDINX-NEXT: feq.d a0, a0, a2
797 ; CHECKRV32ZDINX-NEXT: li a1, 2
798 ; CHECKRV32ZDINX-NEXT: sub a0, a1, a0
799 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
800 ; CHECKRV32ZDINX-NEXT: ret
802 ; CHECKRV64ZDINX-LABEL: select_fcmp_oeq_1_2:
803 ; CHECKRV64ZDINX: # %bb.0:
804 ; CHECKRV64ZDINX-NEXT: feq.d a0, a0, a1
805 ; CHECKRV64ZDINX-NEXT: li a1, 2
806 ; CHECKRV64ZDINX-NEXT: sub a0, a1, a0
807 ; CHECKRV64ZDINX-NEXT: ret
808 %1 = fcmp fast oeq double %a, %b
809 %2 = select i1 %1, i32 1, i32 2
813 define signext i32 @select_fcmp_uge_negone_zero(double %a, double %b) nounwind {
814 ; CHECK-LABEL: select_fcmp_uge_negone_zero:
816 ; CHECK-NEXT: fle.d a0, fa0, fa1
817 ; CHECK-NEXT: addi a0, a0, -1
820 ; CHECKRV32ZDINX-LABEL: select_fcmp_uge_negone_zero:
821 ; CHECKRV32ZDINX: # %bb.0:
822 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
823 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
824 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
825 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
826 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
827 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
828 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
829 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
830 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
831 ; CHECKRV32ZDINX-NEXT: fle.d a0, a0, a2
832 ; CHECKRV32ZDINX-NEXT: addi a0, a0, -1
833 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
834 ; CHECKRV32ZDINX-NEXT: ret
836 ; CHECKRV64ZDINX-LABEL: select_fcmp_uge_negone_zero:
837 ; CHECKRV64ZDINX: # %bb.0:
838 ; CHECKRV64ZDINX-NEXT: fle.d a0, a0, a1
839 ; CHECKRV64ZDINX-NEXT: addi a0, a0, -1
840 ; CHECKRV64ZDINX-NEXT: ret
841 %1 = fcmp ugt double %a, %b
842 %2 = select i1 %1, i32 -1, i32 0
846 define signext i32 @select_fcmp_uge_1_2(double %a, double %b) nounwind {
847 ; CHECK-LABEL: select_fcmp_uge_1_2:
849 ; CHECK-NEXT: fle.d a0, fa0, fa1
850 ; CHECK-NEXT: addi a0, a0, 1
853 ; CHECKRV32ZDINX-LABEL: select_fcmp_uge_1_2:
854 ; CHECKRV32ZDINX: # %bb.0:
855 ; CHECKRV32ZDINX-NEXT: addi sp, sp, -16
856 ; CHECKRV32ZDINX-NEXT: sw a2, 8(sp)
857 ; CHECKRV32ZDINX-NEXT: sw a3, 12(sp)
858 ; CHECKRV32ZDINX-NEXT: lw a2, 8(sp)
859 ; CHECKRV32ZDINX-NEXT: lw a3, 12(sp)
860 ; CHECKRV32ZDINX-NEXT: sw a0, 8(sp)
861 ; CHECKRV32ZDINX-NEXT: sw a1, 12(sp)
862 ; CHECKRV32ZDINX-NEXT: lw a0, 8(sp)
863 ; CHECKRV32ZDINX-NEXT: lw a1, 12(sp)
864 ; CHECKRV32ZDINX-NEXT: fle.d a0, a0, a2
865 ; CHECKRV32ZDINX-NEXT: addi a0, a0, 1
866 ; CHECKRV32ZDINX-NEXT: addi sp, sp, 16
867 ; CHECKRV32ZDINX-NEXT: ret
869 ; CHECKRV64ZDINX-LABEL: select_fcmp_uge_1_2:
870 ; CHECKRV64ZDINX: # %bb.0:
871 ; CHECKRV64ZDINX-NEXT: fle.d a0, a0, a1
872 ; CHECKRV64ZDINX-NEXT: addi a0, a0, 1
873 ; CHECKRV64ZDINX-NEXT: ret
874 %1 = fcmp ugt double %a, %b
875 %2 = select i1 %1, i32 1, i32 2