Debian Codegraph @

llvm/test/CodeGen/PowerPC/scalar-min-max-p10.ll

raw
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mcpu=pwr10 -ppc-asm-full-reg-names \
3 ; RUN: -verify-machineinstrs --enable-no-signed-zeros-fp-math \
4 ; RUN: --enable-no-nans-fp-math \
5 ; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s
6 ; RUN: llc -mcpu=pwr10 -ppc-asm-full-reg-names -verify-machineinstrs \
7 ; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s
8 define dso_local fp128 @testqmax(fp128 %a, fp128 %b) local_unnamed_addr {
9 ; CHECK-LABEL: testqmax:
10 ; CHECK: # %bb.0: # %entry
11 ; CHECK-NEXT: xsmaxcqp v2, v2, v3
12 ; CHECK-NEXT: blr
13 entry:
14 %cmp = fcmp ogt fp128 %a, %b
15 %cond = select i1 %cmp, fp128 %a, fp128 %b
16 ret fp128 %cond
17 }
18
19 define dso_local fp128 @testqmin(fp128 %a, fp128 %b) local_unnamed_addr {
20 ; CHECK-LABEL: testqmin:
21 ; CHECK: # %bb.0: # %entry
22 ; CHECK-NEXT: xsmincqp v2, v2, v3
23 ; CHECK-NEXT: blr
24 entry:
25 %cmp = fcmp olt fp128 %a, %b
26 %cond = select i1 %cmp, fp128 %a, fp128 %b
27 ret fp128 %cond
28 }
29
30 define dso_local fp128 @testqmax_fast(fp128 %a, fp128 %b) local_unnamed_addr {
31 ; CHECK-LABEL: testqmax_fast:
32 ; CHECK: # %bb.0: # %entry
33 ; CHECK-NEXT: xsmaxcqp v2, v2, v3
34 ; CHECK-NEXT: blr
35 entry:
36 %cmp = fcmp nnan ninf ogt fp128 %a, %b
37 %cond = select i1 %cmp, fp128 %a, fp128 %b
38 ret fp128 %cond
39 }
40
41 define dso_local fp128 @testqmin_fast(fp128 %a, fp128 %b) local_unnamed_addr {
42 ; CHECK-LABEL: testqmin_fast:
43 ; CHECK: # %bb.0: # %entry
44 ; CHECK-NEXT: xsmincqp v2, v2, v3
45 ; CHECK-NEXT: blr
46 entry:
47 %cmp = fcmp nnan ninf olt fp128 %a, %b
48 %cond = select i1 %cmp, fp128 %a, fp128 %b
49 ret fp128 %cond
50 }
51
52 declare fp128 @llvm.maxnum.f128(fp128, fp128)
53 define dso_local fp128 @testq_intrinsic_maxnum(fp128 %a, fp128 %b) local_unnamed_addr {
54 ; CHECK-LABEL: testq_intrinsic_maxnum:
55 ; CHECK: # %bb.0: # %entry
56 ; CHECK-NEXT: xsmaxcqp v2, v2, v3
57 ; CHECK-NEXT: blr
58 entry:
59 %0 = tail call fast fp128 @llvm.maxnum.f128(fp128 %a, fp128 %b)
60 ret fp128 %0
61 }
62
63 declare fp128 @llvm.minnum.f128(fp128, fp128)
64 define dso_local fp128 @testq_intrinsic_minnum(fp128 %a, fp128 %b) local_unnamed_addr {
65 ; CHECK-LABEL: testq_intrinsic_minnum:
66 ; CHECK: # %bb.0: # %entry
67 ; CHECK-NEXT: xsmincqp v2, v2, v3
68 ; CHECK-NEXT: blr
69 entry:
70 %0 = tail call fast fp128 @llvm.minnum.f128(fp128 %a, fp128 %b)
71 ret fp128 %0
72 }
73
74 define fp128 @olt_sel(fp128 %a, fp128 %b) {
75 ; CHECK-LABEL: olt_sel:
76 ; CHECK: # %bb.0: # %entry
77 ; CHECK-NEXT: plxv vs36, .LCPI6_0@PCREL(0), 1
78 ; CHECK-NEXT: xscmpuqp cr0, v2, v4
79 ; CHECK-NEXT: blt cr0, .LBB6_2
80 ; CHECK-NEXT: # %bb.1: # %entry
81 ; CHECK-NEXT: vmr v3, v4
82 ; CHECK-NEXT: .LBB6_2: # %entry
83 ; CHECK-NEXT: vmr v2, v3
84 ; CHECK-NEXT: blr
85 entry:
86 %0 = fcmp fast olt fp128 %a, 0xL00000000000000000000000000000000
87 %1 = select i1 %0, fp128 %b, fp128 0xL00000000000000000000000000000000
88 ret fp128 %1
89 }