1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mcpu=pwr8 -ppc-asm-full-reg-names --enable-unsafe-fp-math \
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=pwr9 -ppc-asm-full-reg-names --enable-unsafe-fp-math \
7 ; RUN: -verify-machineinstrs --enable-no-signed-zeros-fp-math \
8 ; RUN: --enable-no-nans-fp-math \
9 ; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s
10 ; RUN: llc -mcpu=pwr9 -ppc-asm-full-reg-names -verify-machineinstrs \
11 ; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s \
12 ; RUN: --check-prefix=NO-FAST-P9
13 ; RUN: llc -mcpu=pwr8 -ppc-asm-full-reg-names -verify-machineinstrs \
14 ; RUN: -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s \
15 ; RUN: --check-prefix=NO-FAST-P8
16 define dso_local float @testfmax(float %a, float %b) local_unnamed_addr {
17 ; CHECK-LABEL: testfmax:
18 ; CHECK: # %bb.0: # %entry
19 ; CHECK-NEXT: xsmaxdp f1, f1, f2
22 ; NO-FAST-P9-LABEL: testfmax:
23 ; NO-FAST-P9: # %bb.0: # %entry
24 ; NO-FAST-P9-NEXT: xsmaxcdp f1, f1, f2
25 ; NO-FAST-P9-NEXT: blr
27 ; NO-FAST-P8-LABEL: testfmax:
28 ; NO-FAST-P8: # %bb.0: # %entry
29 ; NO-FAST-P8-NEXT: fcmpu cr0, f1, f2
30 ; NO-FAST-P8-NEXT: bgtlr cr0
31 ; NO-FAST-P8-NEXT: # %bb.1: # %entry
32 ; NO-FAST-P8-NEXT: fmr f1, f2
33 ; NO-FAST-P8-NEXT: blr
35 %cmp = fcmp ogt float %a, %b
36 %cond = select i1 %cmp, float %a, float %b
40 define dso_local double @testdmax(double %a, double %b) local_unnamed_addr {
41 ; CHECK-LABEL: testdmax:
42 ; CHECK: # %bb.0: # %entry
43 ; CHECK-NEXT: xsmaxdp f1, f1, f2
46 ; NO-FAST-P9-LABEL: testdmax:
47 ; NO-FAST-P9: # %bb.0: # %entry
48 ; NO-FAST-P9-NEXT: xsmaxcdp f1, f1, f2
49 ; NO-FAST-P9-NEXT: blr
51 ; NO-FAST-P8-LABEL: testdmax:
52 ; NO-FAST-P8: # %bb.0: # %entry
53 ; NO-FAST-P8-NEXT: xscmpudp cr0, f1, f2
54 ; NO-FAST-P8-NEXT: bgtlr cr0
55 ; NO-FAST-P8-NEXT: # %bb.1: # %entry
56 ; NO-FAST-P8-NEXT: fmr f1, f2
57 ; NO-FAST-P8-NEXT: blr
59 %cmp = fcmp ogt double %a, %b
60 %cond = select i1 %cmp, double %a, double %b
64 define dso_local float @testfmin(float %a, float %b) local_unnamed_addr {
65 ; CHECK-LABEL: testfmin:
66 ; CHECK: # %bb.0: # %entry
67 ; CHECK-NEXT: xsmindp f1, f1, f2
70 ; NO-FAST-P9-LABEL: testfmin:
71 ; NO-FAST-P9: # %bb.0: # %entry
72 ; NO-FAST-P9-NEXT: xsmincdp f1, f1, f2
73 ; NO-FAST-P9-NEXT: blr
75 ; NO-FAST-P8-LABEL: testfmin:
76 ; NO-FAST-P8: # %bb.0: # %entry
77 ; NO-FAST-P8-NEXT: fcmpu cr0, f1, f2
78 ; NO-FAST-P8-NEXT: bltlr cr0
79 ; NO-FAST-P8-NEXT: # %bb.1: # %entry
80 ; NO-FAST-P8-NEXT: fmr f1, f2
81 ; NO-FAST-P8-NEXT: blr
83 %cmp = fcmp olt float %a, %b
84 %cond = select i1 %cmp, float %a, float %b
88 define dso_local double @testdmin(double %a, double %b) local_unnamed_addr {
89 ; CHECK-LABEL: testdmin:
90 ; CHECK: # %bb.0: # %entry
91 ; CHECK-NEXT: xsmindp f1, f1, f2
94 ; NO-FAST-P9-LABEL: testdmin:
95 ; NO-FAST-P9: # %bb.0: # %entry
96 ; NO-FAST-P9-NEXT: xsmincdp f1, f1, f2
97 ; NO-FAST-P9-NEXT: blr
99 ; NO-FAST-P8-LABEL: testdmin:
100 ; NO-FAST-P8: # %bb.0: # %entry
101 ; NO-FAST-P8-NEXT: xscmpudp cr0, f1, f2
102 ; NO-FAST-P8-NEXT: bltlr cr0
103 ; NO-FAST-P8-NEXT: # %bb.1: # %entry
104 ; NO-FAST-P8-NEXT: fmr f1, f2
105 ; NO-FAST-P8-NEXT: blr
107 %cmp = fcmp olt double %a, %b
108 %cond = select i1 %cmp, double %a, double %b
112 define dso_local float @testfmax_fast(float %a, float %b) local_unnamed_addr {
113 ; CHECK-LABEL: testfmax_fast:
114 ; CHECK: # %bb.0: # %entry
115 ; CHECK-NEXT: xsmaxdp f1, f1, f2
118 ; NO-FAST-P9-LABEL: testfmax_fast:
119 ; NO-FAST-P9: # %bb.0: # %entry
120 ; NO-FAST-P9-NEXT: xsmaxcdp f1, f1, f2
121 ; NO-FAST-P9-NEXT: blr
123 ; NO-FAST-P8-LABEL: testfmax_fast:
124 ; NO-FAST-P8: # %bb.0: # %entry
125 ; NO-FAST-P8-NEXT: xssubsp f0, f2, f1
126 ; NO-FAST-P8-NEXT: fsel f1, f0, f2, f1
127 ; NO-FAST-P8-NEXT: blr
129 %cmp = fcmp nnan ninf ogt float %a, %b
130 %cond = select i1 %cmp, float %a, float %b
133 define dso_local double @testdmax_fast(double %a, double %b) local_unnamed_addr {
134 ; CHECK-LABEL: testdmax_fast:
135 ; CHECK: # %bb.0: # %entry
136 ; CHECK-NEXT: xsmaxdp f1, f1, f2
139 ; NO-FAST-P9-LABEL: testdmax_fast:
140 ; NO-FAST-P9: # %bb.0: # %entry
141 ; NO-FAST-P9-NEXT: xsmaxcdp f1, f1, f2
142 ; NO-FAST-P9-NEXT: blr
144 ; NO-FAST-P8-LABEL: testdmax_fast:
145 ; NO-FAST-P8: # %bb.0: # %entry
146 ; NO-FAST-P8-NEXT: xssubdp f0, f2, f1
147 ; NO-FAST-P8-NEXT: fsel f1, f0, f2, f1
148 ; NO-FAST-P8-NEXT: blr
150 %cmp = fcmp nnan ninf ogt double %a, %b
151 %cond = select i1 %cmp, double %a, double %b
154 define dso_local float @testfmin_fast(float %a, float %b) local_unnamed_addr {
155 ; CHECK-LABEL: testfmin_fast:
156 ; CHECK: # %bb.0: # %entry
157 ; CHECK-NEXT: xsmindp f1, f1, f2
160 ; NO-FAST-P9-LABEL: testfmin_fast:
161 ; NO-FAST-P9: # %bb.0: # %entry
162 ; NO-FAST-P9-NEXT: xsmincdp f1, f1, f2
163 ; NO-FAST-P9-NEXT: blr
165 ; NO-FAST-P8-LABEL: testfmin_fast:
166 ; NO-FAST-P8: # %bb.0: # %entry
167 ; NO-FAST-P8-NEXT: xssubsp f0, f1, f2
168 ; NO-FAST-P8-NEXT: fsel f1, f0, f2, f1
169 ; NO-FAST-P8-NEXT: blr
171 %cmp = fcmp nnan ninf olt float %a, %b
172 %cond = select i1 %cmp, float %a, float %b
175 define dso_local double @testdmin_fast(double %a, double %b) local_unnamed_addr {
176 ; CHECK-LABEL: testdmin_fast:
177 ; CHECK: # %bb.0: # %entry
178 ; CHECK-NEXT: xsmindp f1, f1, f2
181 ; NO-FAST-P9-LABEL: testdmin_fast:
182 ; NO-FAST-P9: # %bb.0: # %entry
183 ; NO-FAST-P9-NEXT: xsmincdp f1, f1, f2
184 ; NO-FAST-P9-NEXT: blr
186 ; NO-FAST-P8-LABEL: testdmin_fast:
187 ; NO-FAST-P8: # %bb.0: # %entry
188 ; NO-FAST-P8-NEXT: xssubdp f0, f1, f2
189 ; NO-FAST-P8-NEXT: fsel f1, f0, f2, f1
190 ; NO-FAST-P8-NEXT: blr
192 %cmp = fcmp nnan ninf olt double %a, %b
193 %cond = select i1 %cmp, double %a, double %b