1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s -mtriple=powerpc-unknown-linux -mattr=spe | FileCheck %s -check-prefix=SPE
4 define i32 @test_f32_oeq_s(i32 %a, i32 %b, float %f1, float %f2) #0 {
5 ; SPE-LABEL: test_f32_oeq_s:
7 ; SPE-NEXT: efscmpeq cr0, r5, r6
8 ; SPE-NEXT: bclr 12, gt, 0
12 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(float %f1, float %f2, metadata !"oeq", metadata !"fpexcept.strict") #0
13 %res = select i1 %cond, i32 %a, i32 %b
17 define i32 @test_f32_ogt_s(i32 %a, i32 %b, float %f1, float %f2) #0 {
18 ; SPE-LABEL: test_f32_ogt_s:
20 ; SPE-NEXT: efscmpgt cr0, r5, r6
21 ; SPE-NEXT: bclr 12, gt, 0
25 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(float %f1, float %f2, metadata !"ogt", metadata !"fpexcept.strict") #0
26 %res = select i1 %cond, i32 %a, i32 %b
30 define i32 @test_f32_oge_s(i32 %a, i32 %b, float %f1, float %f2) #0 {
31 ; SPE-LABEL: test_f32_oge_s:
33 ; SPE-NEXT: efscmpeq cr0, r6, r6
34 ; SPE-NEXT: bc 4, gt, .LBB2_3
36 ; SPE-NEXT: efscmpeq cr0, r5, r5
37 ; SPE-NEXT: bc 4, gt, .LBB2_3
39 ; SPE-NEXT: efscmplt cr0, r5, r6
40 ; SPE-NEXT: bclr 4, gt, 0
44 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(float %f1, float %f2, metadata !"oge", metadata !"fpexcept.strict") #0
45 %res = select i1 %cond, i32 %a, i32 %b
49 define i32 @test_f32_olt_s(i32 %a, i32 %b, float %f1, float %f2) #0 {
50 ; SPE-LABEL: test_f32_olt_s:
52 ; SPE-NEXT: efscmplt cr0, r5, r6
53 ; SPE-NEXT: bclr 12, gt, 0
57 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(float %f1, float %f2, metadata !"olt", metadata !"fpexcept.strict") #0
58 %res = select i1 %cond, i32 %a, i32 %b
62 define i32 @test_f32_ole_s(i32 %a, i32 %b, float %f1, float %f2) #0 {
63 ; SPE-LABEL: test_f32_ole_s:
65 ; SPE-NEXT: efscmpeq cr0, r6, r6
66 ; SPE-NEXT: bc 4, gt, .LBB4_3
68 ; SPE-NEXT: efscmpeq cr0, r5, r5
69 ; SPE-NEXT: bc 4, gt, .LBB4_3
71 ; SPE-NEXT: efscmpgt cr0, r5, r6
72 ; SPE-NEXT: bclr 4, gt, 0
76 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(float %f1, float %f2, metadata !"ole", metadata !"fpexcept.strict") #0
77 %res = select i1 %cond, i32 %a, i32 %b
81 define i32 @test_f32_one_s(i32 %a, i32 %b, float %f1, float %f2) #0 {
82 ; SPE-LABEL: test_f32_one_s:
84 ; SPE-NEXT: efscmplt cr0, r5, r6
85 ; SPE-NEXT: bclr 12, gt, 0
87 ; SPE-NEXT: efscmpgt cr0, r5, r6
88 ; SPE-NEXT: bclr 12, gt, 0
92 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(float %f1, float %f2, metadata !"one", metadata !"fpexcept.strict") #0
93 %res = select i1 %cond, i32 %a, i32 %b
97 define i32 @test_f32_ord_s(i32 %a, i32 %b, float %f1, float %f2) #0 {
98 ; SPE-LABEL: test_f32_ord_s:
100 ; SPE-NEXT: efscmpeq cr0, r6, r6
101 ; SPE-NEXT: bc 4, gt, .LBB6_2
103 ; SPE-NEXT: efscmpeq cr0, r5, r5
104 ; SPE-NEXT: bclr 12, gt, 0
106 ; SPE-NEXT: mr r3, r4
108 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(float %f1, float %f2, metadata !"ord", metadata !"fpexcept.strict") #0
109 %res = select i1 %cond, i32 %a, i32 %b
113 define i32 @test_f32_ueq_s(i32 %a, i32 %b, float %f1, float %f2) #0 {
114 ; SPE-LABEL: test_f32_ueq_s:
116 ; SPE-NEXT: efscmplt cr0, r5, r6
117 ; SPE-NEXT: bc 12, gt, .LBB7_3
119 ; SPE-NEXT: efscmpgt cr0, r5, r6
120 ; SPE-NEXT: bc 12, gt, .LBB7_3
122 ; SPE-NEXT: mr r4, r3
124 ; SPE-NEXT: mr r3, r4
126 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(float %f1, float %f2, metadata !"ueq", metadata !"fpexcept.strict") #0
127 %res = select i1 %cond, i32 %a, i32 %b
131 define i32 @test_f32_ugt_s(i32 %a, i32 %b, float %f1, float %f2) #0 {
132 ; SPE-LABEL: test_f32_ugt_s:
134 ; SPE-NEXT: efscmpeq cr0, r5, r5
135 ; SPE-NEXT: bclr 4, gt, 0
137 ; SPE-NEXT: efscmpeq cr0, r6, r6
138 ; SPE-NEXT: bclr 4, gt, 0
140 ; SPE-NEXT: efscmpgt cr0, r5, r6
141 ; SPE-NEXT: bclr 12, gt, 0
143 ; SPE-NEXT: mr r3, r4
145 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(float %f1, float %f2, metadata !"ugt", metadata !"fpexcept.strict") #0
146 %res = select i1 %cond, i32 %a, i32 %b
150 define i32 @test_f32_uge_s(i32 %a, i32 %b, float %f1, float %f2) #0 {
151 ; SPE-LABEL: test_f32_uge_s:
153 ; SPE-NEXT: efscmplt cr0, r5, r6
154 ; SPE-NEXT: bc 12, gt, .LBB9_2
156 ; SPE-NEXT: mr r4, r3
158 ; SPE-NEXT: mr r3, r4
160 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(float %f1, float %f2, metadata !"uge", metadata !"fpexcept.strict") #0
161 %res = select i1 %cond, i32 %a, i32 %b
165 define i32 @test_f32_ult_s(i32 %a, i32 %b, float %f1, float %f2) #0 {
166 ; SPE-LABEL: test_f32_ult_s:
168 ; SPE-NEXT: efscmpeq cr0, r5, r5
169 ; SPE-NEXT: bclr 4, gt, 0
171 ; SPE-NEXT: efscmpeq cr0, r6, r6
172 ; SPE-NEXT: bclr 4, gt, 0
174 ; SPE-NEXT: efscmplt cr0, r5, r6
175 ; SPE-NEXT: bclr 12, gt, 0
177 ; SPE-NEXT: mr r3, r4
179 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(float %f1, float %f2, metadata !"ult", metadata !"fpexcept.strict") #0
180 %res = select i1 %cond, i32 %a, i32 %b
184 define i32 @test_f32_ule_s(i32 %a, i32 %b, float %f1, float %f2) #0 {
185 ; SPE-LABEL: test_f32_ule_s:
187 ; SPE-NEXT: efscmpgt cr0, r5, r6
188 ; SPE-NEXT: bc 12, gt, .LBB11_2
190 ; SPE-NEXT: mr r4, r3
191 ; SPE-NEXT: .LBB11_2:
192 ; SPE-NEXT: mr r3, r4
194 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(float %f1, float %f2, metadata !"ule", metadata !"fpexcept.strict") #0
195 %res = select i1 %cond, i32 %a, i32 %b
199 define i32 @test_f32_une_s(i32 %a, i32 %b, float %f1, float %f2) #0 {
200 ; SPE-LABEL: test_f32_une_s:
202 ; SPE-NEXT: efscmpeq cr0, r5, r6
203 ; SPE-NEXT: bc 12, gt, .LBB12_2
205 ; SPE-NEXT: mr r4, r3
206 ; SPE-NEXT: .LBB12_2:
207 ; SPE-NEXT: mr r3, r4
209 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(float %f1, float %f2, metadata !"une", metadata !"fpexcept.strict") #0
210 %res = select i1 %cond, i32 %a, i32 %b
214 define i32 @test_f32_uno_s(i32 %a, i32 %b, float %f1, float %f2) #0 {
215 ; SPE-LABEL: test_f32_uno_s:
217 ; SPE-NEXT: efscmpeq cr0, r5, r5
218 ; SPE-NEXT: bclr 4, gt, 0
220 ; SPE-NEXT: efscmpeq cr0, r6, r6
221 ; SPE-NEXT: bclr 4, gt, 0
223 ; SPE-NEXT: mr r3, r4
225 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(float %f1, float %f2, metadata !"uno", metadata !"fpexcept.strict") #0
226 %res = select i1 %cond, i32 %a, i32 %b
230 define i32 @test_f64_oeq_s(i32 %a, i32 %b, double %f1, double %f2) #0 {
231 ; SPE-LABEL: test_f64_oeq_s:
233 ; SPE-NEXT: evmergelo r7, r7, r8
234 ; SPE-NEXT: evmergelo r5, r5, r6
235 ; SPE-NEXT: efdcmpeq cr0, r5, r7
236 ; SPE-NEXT: bclr 12, gt, 0
238 ; SPE-NEXT: mr r3, r4
240 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(double %f1, double %f2, metadata !"oeq", metadata !"fpexcept.strict") #0
241 %res = select i1 %cond, i32 %a, i32 %b
245 define i32 @test_f64_ogt_s(i32 %a, i32 %b, double %f1, double %f2) #0 {
246 ; SPE-LABEL: test_f64_ogt_s:
248 ; SPE-NEXT: evmergelo r7, r7, r8
249 ; SPE-NEXT: evmergelo r5, r5, r6
250 ; SPE-NEXT: efdcmpgt cr0, r5, r7
251 ; SPE-NEXT: bclr 12, gt, 0
253 ; SPE-NEXT: mr r3, r4
255 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(double %f1, double %f2, metadata !"ogt", metadata !"fpexcept.strict") #0
256 %res = select i1 %cond, i32 %a, i32 %b
260 define i32 @test_f64_oge_s(i32 %a, i32 %b, double %f1, double %f2) #0 {
261 ; SPE-LABEL: test_f64_oge_s:
263 ; SPE-NEXT: evmergelo r5, r5, r6
264 ; SPE-NEXT: evmergelo r6, r7, r8
265 ; SPE-NEXT: efdcmpeq cr0, r6, r6
266 ; SPE-NEXT: bc 4, gt, .LBB16_3
268 ; SPE-NEXT: efdcmpeq cr0, r5, r5
269 ; SPE-NEXT: bc 4, gt, .LBB16_3
271 ; SPE-NEXT: efdcmplt cr0, r5, r6
272 ; SPE-NEXT: bclr 4, gt, 0
273 ; SPE-NEXT: .LBB16_3:
274 ; SPE-NEXT: mr r3, r4
276 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(double %f1, double %f2, metadata !"oge", metadata !"fpexcept.strict") #0
277 %res = select i1 %cond, i32 %a, i32 %b
281 define i32 @test_f64_olt_s(i32 %a, i32 %b, double %f1, double %f2) #0 {
282 ; SPE-LABEL: test_f64_olt_s:
284 ; SPE-NEXT: evmergelo r7, r7, r8
285 ; SPE-NEXT: evmergelo r5, r5, r6
286 ; SPE-NEXT: efdcmplt cr0, r5, r7
287 ; SPE-NEXT: bclr 12, gt, 0
289 ; SPE-NEXT: mr r3, r4
291 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(double %f1, double %f2, metadata !"olt", metadata !"fpexcept.strict") #0
292 %res = select i1 %cond, i32 %a, i32 %b
296 define i32 @test_f64_ole_s(i32 %a, i32 %b, double %f1, double %f2) #0 {
297 ; SPE-LABEL: test_f64_ole_s:
299 ; SPE-NEXT: evmergelo r5, r5, r6
300 ; SPE-NEXT: evmergelo r6, r7, r8
301 ; SPE-NEXT: efdcmpeq cr0, r6, r6
302 ; SPE-NEXT: bc 4, gt, .LBB18_3
304 ; SPE-NEXT: efdcmpeq cr0, r5, r5
305 ; SPE-NEXT: bc 4, gt, .LBB18_3
307 ; SPE-NEXT: efdcmpgt cr0, r5, r6
308 ; SPE-NEXT: bclr 4, gt, 0
309 ; SPE-NEXT: .LBB18_3:
310 ; SPE-NEXT: mr r3, r4
312 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(double %f1, double %f2, metadata !"ole", metadata !"fpexcept.strict") #0
313 %res = select i1 %cond, i32 %a, i32 %b
317 define i32 @test_f64_one_s(i32 %a, i32 %b, double %f1, double %f2) #0 {
318 ; SPE-LABEL: test_f64_one_s:
320 ; SPE-NEXT: evmergelo r7, r7, r8
321 ; SPE-NEXT: evmergelo r5, r5, r6
322 ; SPE-NEXT: efdcmplt cr0, r5, r7
323 ; SPE-NEXT: bclr 12, gt, 0
325 ; SPE-NEXT: efdcmpgt cr0, r5, r7
326 ; SPE-NEXT: bclr 12, gt, 0
328 ; SPE-NEXT: mr r3, r4
330 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(double %f1, double %f2, metadata !"one", metadata !"fpexcept.strict") #0
331 %res = select i1 %cond, i32 %a, i32 %b
335 define i32 @test_f64_ord_s(i32 %a, i32 %b, double %f1, double %f2) #0 {
336 ; SPE-LABEL: test_f64_ord_s:
338 ; SPE-NEXT: evmergelo r5, r5, r6
339 ; SPE-NEXT: evmergelo r6, r7, r8
340 ; SPE-NEXT: efdcmpeq cr0, r6, r6
341 ; SPE-NEXT: bc 4, gt, .LBB20_2
343 ; SPE-NEXT: efdcmpeq cr0, r5, r5
344 ; SPE-NEXT: bclr 12, gt, 0
345 ; SPE-NEXT: .LBB20_2:
346 ; SPE-NEXT: mr r3, r4
348 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(double %f1, double %f2, metadata !"ord", metadata !"fpexcept.strict") #0
349 %res = select i1 %cond, i32 %a, i32 %b
353 define i32 @test_f64_ueq_s(i32 %a, i32 %b, double %f1, double %f2) #0 {
354 ; SPE-LABEL: test_f64_ueq_s:
356 ; SPE-NEXT: evmergelo r7, r7, r8
357 ; SPE-NEXT: evmergelo r5, r5, r6
358 ; SPE-NEXT: efdcmplt cr0, r5, r7
359 ; SPE-NEXT: bc 12, gt, .LBB21_3
361 ; SPE-NEXT: efdcmpgt cr0, r5, r7
362 ; SPE-NEXT: bc 12, gt, .LBB21_3
364 ; SPE-NEXT: mr r4, r3
365 ; SPE-NEXT: .LBB21_3:
366 ; SPE-NEXT: mr r3, r4
368 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(double %f1, double %f2, metadata !"ueq", metadata !"fpexcept.strict") #0
369 %res = select i1 %cond, i32 %a, i32 %b
373 define i32 @test_f64_ugt_s(i32 %a, i32 %b, double %f1, double %f2) #0 {
374 ; SPE-LABEL: test_f64_ugt_s:
376 ; SPE-NEXT: evmergelo r7, r7, r8
377 ; SPE-NEXT: evmergelo r5, r5, r6
378 ; SPE-NEXT: efdcmpeq cr0, r5, r5
379 ; SPE-NEXT: bclr 4, gt, 0
381 ; SPE-NEXT: efdcmpeq cr0, r7, r7
382 ; SPE-NEXT: bclr 4, gt, 0
384 ; SPE-NEXT: efdcmpgt cr0, r5, r7
385 ; SPE-NEXT: bclr 12, gt, 0
387 ; SPE-NEXT: mr r3, r4
389 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(double %f1, double %f2, metadata !"ugt", metadata !"fpexcept.strict") #0
390 %res = select i1 %cond, i32 %a, i32 %b
394 define i32 @test_f64_uge_s(i32 %a, i32 %b, double %f1, double %f2) #0 {
395 ; SPE-LABEL: test_f64_uge_s:
397 ; SPE-NEXT: evmergelo r7, r7, r8
398 ; SPE-NEXT: evmergelo r5, r5, r6
399 ; SPE-NEXT: efdcmplt cr0, r5, r7
400 ; SPE-NEXT: bc 12, gt, .LBB23_2
402 ; SPE-NEXT: mr r4, r3
403 ; SPE-NEXT: .LBB23_2:
404 ; SPE-NEXT: mr r3, r4
406 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(double %f1, double %f2, metadata !"uge", metadata !"fpexcept.strict") #0
407 %res = select i1 %cond, i32 %a, i32 %b
411 define i32 @test_f64_ult_s(i32 %a, i32 %b, double %f1, double %f2) #0 {
412 ; SPE-LABEL: test_f64_ult_s:
414 ; SPE-NEXT: evmergelo r7, r7, r8
415 ; SPE-NEXT: evmergelo r5, r5, r6
416 ; SPE-NEXT: efdcmpeq cr0, r5, r5
417 ; SPE-NEXT: bclr 4, gt, 0
419 ; SPE-NEXT: efdcmpeq cr0, r7, r7
420 ; SPE-NEXT: bclr 4, gt, 0
422 ; SPE-NEXT: efdcmplt cr0, r5, r7
423 ; SPE-NEXT: bclr 12, gt, 0
425 ; SPE-NEXT: mr r3, r4
427 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(double %f1, double %f2, metadata !"ult", metadata !"fpexcept.strict") #0
428 %res = select i1 %cond, i32 %a, i32 %b
432 define i32 @test_f64_ule_s(i32 %a, i32 %b, double %f1, double %f2) #0 {
433 ; SPE-LABEL: test_f64_ule_s:
435 ; SPE-NEXT: evmergelo r7, r7, r8
436 ; SPE-NEXT: evmergelo r5, r5, r6
437 ; SPE-NEXT: efdcmpgt cr0, r5, r7
438 ; SPE-NEXT: bc 12, gt, .LBB25_2
440 ; SPE-NEXT: mr r4, r3
441 ; SPE-NEXT: .LBB25_2:
442 ; SPE-NEXT: mr r3, r4
444 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(double %f1, double %f2, metadata !"ule", metadata !"fpexcept.strict") #0
445 %res = select i1 %cond, i32 %a, i32 %b
449 define i32 @test_f64_une_s(i32 %a, i32 %b, double %f1, double %f2) #0 {
450 ; SPE-LABEL: test_f64_une_s:
452 ; SPE-NEXT: evmergelo r7, r7, r8
453 ; SPE-NEXT: evmergelo r5, r5, r6
454 ; SPE-NEXT: efdcmpeq cr0, r5, r7
455 ; SPE-NEXT: bc 12, gt, .LBB26_2
457 ; SPE-NEXT: mr r4, r3
458 ; SPE-NEXT: .LBB26_2:
459 ; SPE-NEXT: mr r3, r4
461 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(double %f1, double %f2, metadata !"une", metadata !"fpexcept.strict") #0
462 %res = select i1 %cond, i32 %a, i32 %b
466 define i32 @test_f64_uno_s(i32 %a, i32 %b, double %f1, double %f2) #0 {
467 ; SPE-LABEL: test_f64_uno_s:
469 ; SPE-NEXT: evmergelo r7, r7, r8
470 ; SPE-NEXT: evmergelo r5, r5, r6
471 ; SPE-NEXT: efdcmpeq cr0, r5, r5
472 ; SPE-NEXT: bclr 4, gt, 0
474 ; SPE-NEXT: efdcmpeq cr0, r7, r7
475 ; SPE-NEXT: bclr 4, gt, 0
477 ; SPE-NEXT: mr r3, r4
479 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(double %f1, double %f2, metadata !"uno", metadata !"fpexcept.strict") #0
480 %res = select i1 %cond, i32 %a, i32 %b
484 attributes #0 = { strictfp nounwind }
486 declare i1 @llvm.experimental.constrained.fcmps.f32(float, float, metadata, metadata)
487 declare i1 @llvm.experimental.constrained.fcmps.f64(double, double, metadata, metadata)