1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mcpu=pwr9 -verify-machineinstrs -mtriple=powerpc64le-unknown-linux \
3 ; RUN: < %s | FileCheck --check-prefixes=CHECK,CHECK-P9 %s
4 ; RUN: llc -mcpu=pwr8 -verify-machineinstrs -mtriple=powerpc64le-unknown-linux \
5 ; RUN: < %s | FileCheck --check-prefixes=CHECK,CHECK-P8 %s
7 declare ppc_fp128 @llvm.ppc.maxfe(ppc_fp128 %a, ppc_fp128 %b, ppc_fp128 %c, ...)
8 define ppc_fp128 @test_maxfe(ppc_fp128 %a, ppc_fp128 %b, ppc_fp128 %c, ppc_fp128 %d) {
9 ; CHECK-LABEL: test_maxfe:
10 ; CHECK: # %bb.0: # %entry
11 ; CHECK-NEXT: fcmpu 0, 6, 4
12 ; CHECK-NEXT: fcmpu 1, 5, 3
13 ; CHECK-NEXT: crand 20, 6, 1
14 ; CHECK-NEXT: cror 20, 5, 20
15 ; CHECK-NEXT: bc 12, 20, .LBB0_2
16 ; CHECK-NEXT: # %bb.1: # %entry
17 ; CHECK-NEXT: fmr 6, 4
18 ; CHECK-NEXT: .LBB0_2: # %entry
19 ; CHECK-NEXT: fcmpu 0, 6, 2
20 ; CHECK-NEXT: bc 12, 20, .LBB0_4
21 ; CHECK-NEXT: # %bb.3: # %entry
22 ; CHECK-NEXT: fmr 5, 3
23 ; CHECK-NEXT: .LBB0_4: # %entry
24 ; CHECK-NEXT: fcmpu 1, 5, 1
25 ; CHECK-NEXT: crand 20, 6, 1
26 ; CHECK-NEXT: cror 20, 5, 20
27 ; CHECK-NEXT: bc 12, 20, .LBB0_6
28 ; CHECK-NEXT: # %bb.5: # %entry
29 ; CHECK-NEXT: fmr 6, 2
30 ; CHECK-NEXT: .LBB0_6: # %entry
31 ; CHECK-NEXT: fcmpu 0, 6, 8
32 ; CHECK-NEXT: bc 12, 20, .LBB0_8
33 ; CHECK-NEXT: # %bb.7: # %entry
34 ; CHECK-NEXT: fmr 5, 1
35 ; CHECK-NEXT: .LBB0_8: # %entry
36 ; CHECK-NEXT: fcmpu 1, 5, 7
37 ; CHECK-NEXT: crand 20, 6, 1
38 ; CHECK-NEXT: cror 20, 5, 20
39 ; CHECK-NEXT: bc 12, 20, .LBB0_10
40 ; CHECK-NEXT: # %bb.9: # %entry
41 ; CHECK-NEXT: fmr 5, 7
42 ; CHECK-NEXT: .LBB0_10: # %entry
43 ; CHECK-NEXT: bc 12, 20, .LBB0_12
44 ; CHECK-NEXT: # %bb.11: # %entry
45 ; CHECK-NEXT: fmr 6, 8
46 ; CHECK-NEXT: .LBB0_12: # %entry
47 ; CHECK-NEXT: fmr 1, 5
48 ; CHECK-NEXT: fmr 2, 6
51 %0 = call ppc_fp128 (ppc_fp128, ppc_fp128, ppc_fp128, ...) @llvm.ppc.maxfe(ppc_fp128 %a, ppc_fp128 %b, ppc_fp128 %c, ppc_fp128 %d)
55 declare double @llvm.ppc.maxfl(double %a, double %b, double %c, ...)
56 define double @test_maxfl(double %a, double %b, double %c, double %d) {
57 ; CHECK-P9-LABEL: test_maxfl:
58 ; CHECK-P9: # %bb.0: # %entry
59 ; CHECK-P9-NEXT: xsmaxcdp 0, 3, 2
60 ; CHECK-P9-NEXT: xsmaxcdp 0, 0, 1
61 ; CHECK-P9-NEXT: xsmaxcdp 1, 0, 4
64 ; CHECK-P8-LABEL: test_maxfl:
65 ; CHECK-P8: # %bb.0: # %entry
66 ; CHECK-P8-NEXT: xscmpudp 0, 3, 2
67 ; CHECK-P8-NEXT: ble 0, .LBB1_4
68 ; CHECK-P8-NEXT: # %bb.1: # %entry
69 ; CHECK-P8-NEXT: xscmpudp 0, 3, 1
70 ; CHECK-P8-NEXT: ble 0, .LBB1_5
71 ; CHECK-P8-NEXT: .LBB1_2: # %entry
72 ; CHECK-P8-NEXT: xscmpudp 0, 3, 4
73 ; CHECK-P8-NEXT: ble 0, .LBB1_6
74 ; CHECK-P8-NEXT: .LBB1_3: # %entry
75 ; CHECK-P8-NEXT: fmr 1, 3
77 ; CHECK-P8-NEXT: .LBB1_4: # %entry
78 ; CHECK-P8-NEXT: fmr 3, 2
79 ; CHECK-P8-NEXT: xscmpudp 0, 3, 1
80 ; CHECK-P8-NEXT: bgt 0, .LBB1_2
81 ; CHECK-P8-NEXT: .LBB1_5: # %entry
82 ; CHECK-P8-NEXT: fmr 3, 1
83 ; CHECK-P8-NEXT: xscmpudp 0, 3, 4
84 ; CHECK-P8-NEXT: bgt 0, .LBB1_3
85 ; CHECK-P8-NEXT: .LBB1_6: # %entry
86 ; CHECK-P8-NEXT: fmr 3, 4
87 ; CHECK-P8-NEXT: fmr 1, 3
90 %0 = call double (double, double, double, ...) @llvm.ppc.maxfl(double %a, double %b, double %c, double %d)
94 declare float @llvm.ppc.maxfs(float %a, float %b, float %c, ...)
95 define float @test_maxfs(float %a, float %b, float %c, float %d) {
96 ; CHECK-P9-LABEL: test_maxfs:
97 ; CHECK-P9: # %bb.0: # %entry
98 ; CHECK-P9-NEXT: xsmaxcdp 0, 3, 2
99 ; CHECK-P9-NEXT: xsmaxcdp 0, 0, 1
100 ; CHECK-P9-NEXT: xsmaxcdp 1, 0, 4
103 ; CHECK-P8-LABEL: test_maxfs:
104 ; CHECK-P8: # %bb.0: # %entry
105 ; CHECK-P8-NEXT: fcmpu 0, 3, 2
106 ; CHECK-P8-NEXT: ble 0, .LBB2_4
107 ; CHECK-P8-NEXT: # %bb.1: # %entry
108 ; CHECK-P8-NEXT: fcmpu 0, 3, 1
109 ; CHECK-P8-NEXT: ble 0, .LBB2_5
110 ; CHECK-P8-NEXT: .LBB2_2: # %entry
111 ; CHECK-P8-NEXT: fcmpu 0, 3, 4
112 ; CHECK-P8-NEXT: ble 0, .LBB2_6
113 ; CHECK-P8-NEXT: .LBB2_3: # %entry
114 ; CHECK-P8-NEXT: fmr 1, 3
116 ; CHECK-P8-NEXT: .LBB2_4: # %entry
117 ; CHECK-P8-NEXT: fmr 3, 2
118 ; CHECK-P8-NEXT: fcmpu 0, 3, 1
119 ; CHECK-P8-NEXT: bgt 0, .LBB2_2
120 ; CHECK-P8-NEXT: .LBB2_5: # %entry
121 ; CHECK-P8-NEXT: fmr 3, 1
122 ; CHECK-P8-NEXT: fcmpu 0, 3, 4
123 ; CHECK-P8-NEXT: bgt 0, .LBB2_3
124 ; CHECK-P8-NEXT: .LBB2_6: # %entry
125 ; CHECK-P8-NEXT: fmr 3, 4
126 ; CHECK-P8-NEXT: fmr 1, 3
129 %0 = call float (float, float, float, ...) @llvm.ppc.maxfs(float %a, float %b, float %c, float %d)
133 declare ppc_fp128 @llvm.ppc.minfe(ppc_fp128 %a, ppc_fp128 %b, ppc_fp128 %c, ...)
134 define ppc_fp128 @test_minfe(ppc_fp128 %a, ppc_fp128 %b, ppc_fp128 %c, ppc_fp128 %d) {
135 ; CHECK-LABEL: test_minfe:
136 ; CHECK: # %bb.0: # %entry
137 ; CHECK-NEXT: fcmpu 0, 6, 4
138 ; CHECK-NEXT: fcmpu 1, 5, 3
139 ; CHECK-NEXT: crand 20, 6, 0
140 ; CHECK-NEXT: cror 20, 4, 20
141 ; CHECK-NEXT: bc 12, 20, .LBB3_2
142 ; CHECK-NEXT: # %bb.1: # %entry
143 ; CHECK-NEXT: fmr 6, 4
144 ; CHECK-NEXT: .LBB3_2: # %entry
145 ; CHECK-NEXT: fcmpu 0, 6, 2
146 ; CHECK-NEXT: bc 12, 20, .LBB3_4
147 ; CHECK-NEXT: # %bb.3: # %entry
148 ; CHECK-NEXT: fmr 5, 3
149 ; CHECK-NEXT: .LBB3_4: # %entry
150 ; CHECK-NEXT: fcmpu 1, 5, 1
151 ; CHECK-NEXT: crand 20, 6, 0
152 ; CHECK-NEXT: cror 20, 4, 20
153 ; CHECK-NEXT: bc 12, 20, .LBB3_6
154 ; CHECK-NEXT: # %bb.5: # %entry
155 ; CHECK-NEXT: fmr 6, 2
156 ; CHECK-NEXT: .LBB3_6: # %entry
157 ; CHECK-NEXT: fcmpu 0, 6, 8
158 ; CHECK-NEXT: bc 12, 20, .LBB3_8
159 ; CHECK-NEXT: # %bb.7: # %entry
160 ; CHECK-NEXT: fmr 5, 1
161 ; CHECK-NEXT: .LBB3_8: # %entry
162 ; CHECK-NEXT: fcmpu 1, 5, 7
163 ; CHECK-NEXT: crand 20, 6, 0
164 ; CHECK-NEXT: cror 20, 4, 20
165 ; CHECK-NEXT: bc 12, 20, .LBB3_10
166 ; CHECK-NEXT: # %bb.9: # %entry
167 ; CHECK-NEXT: fmr 5, 7
168 ; CHECK-NEXT: .LBB3_10: # %entry
169 ; CHECK-NEXT: bc 12, 20, .LBB3_12
170 ; CHECK-NEXT: # %bb.11: # %entry
171 ; CHECK-NEXT: fmr 6, 8
172 ; CHECK-NEXT: .LBB3_12: # %entry
173 ; CHECK-NEXT: fmr 1, 5
174 ; CHECK-NEXT: fmr 2, 6
177 %0 = call ppc_fp128 (ppc_fp128, ppc_fp128, ppc_fp128, ...) @llvm.ppc.minfe(ppc_fp128 %a, ppc_fp128 %b, ppc_fp128 %c, ppc_fp128 %d)
181 declare double @llvm.ppc.minfl(double %a, double %b, double %c, ...)
182 define double @test_minfl(double %a, double %b, double %c, double %d) {
183 ; CHECK-P9-LABEL: test_minfl:
184 ; CHECK-P9: # %bb.0: # %entry
185 ; CHECK-P9-NEXT: xsmincdp 0, 3, 2
186 ; CHECK-P9-NEXT: xsmincdp 0, 0, 1
187 ; CHECK-P9-NEXT: xsmincdp 1, 0, 4
190 ; CHECK-P8-LABEL: test_minfl:
191 ; CHECK-P8: # %bb.0: # %entry
192 ; CHECK-P8-NEXT: xscmpudp 0, 3, 2
193 ; CHECK-P8-NEXT: bge 0, .LBB4_4
194 ; CHECK-P8-NEXT: # %bb.1: # %entry
195 ; CHECK-P8-NEXT: xscmpudp 0, 3, 1
196 ; CHECK-P8-NEXT: bge 0, .LBB4_5
197 ; CHECK-P8-NEXT: .LBB4_2: # %entry
198 ; CHECK-P8-NEXT: xscmpudp 0, 3, 4
199 ; CHECK-P8-NEXT: bge 0, .LBB4_6
200 ; CHECK-P8-NEXT: .LBB4_3: # %entry
201 ; CHECK-P8-NEXT: fmr 1, 3
203 ; CHECK-P8-NEXT: .LBB4_4: # %entry
204 ; CHECK-P8-NEXT: fmr 3, 2
205 ; CHECK-P8-NEXT: xscmpudp 0, 3, 1
206 ; CHECK-P8-NEXT: blt 0, .LBB4_2
207 ; CHECK-P8-NEXT: .LBB4_5: # %entry
208 ; CHECK-P8-NEXT: fmr 3, 1
209 ; CHECK-P8-NEXT: xscmpudp 0, 3, 4
210 ; CHECK-P8-NEXT: blt 0, .LBB4_3
211 ; CHECK-P8-NEXT: .LBB4_6: # %entry
212 ; CHECK-P8-NEXT: fmr 3, 4
213 ; CHECK-P8-NEXT: fmr 1, 3
216 %0 = call double (double, double, double, ...) @llvm.ppc.minfl(double %a, double %b, double %c, double %d)
220 declare float @llvm.ppc.minfs(float %a, float %b, float %c, ...)
221 define float @test_minfs(float %a, float %b, float %c, float %d) {
222 ; CHECK-P9-LABEL: test_minfs:
223 ; CHECK-P9: # %bb.0: # %entry
224 ; CHECK-P9-NEXT: xsmincdp 0, 3, 2
225 ; CHECK-P9-NEXT: xsmincdp 0, 0, 1
226 ; CHECK-P9-NEXT: xsmincdp 1, 0, 4
229 ; CHECK-P8-LABEL: test_minfs:
230 ; CHECK-P8: # %bb.0: # %entry
231 ; CHECK-P8-NEXT: fcmpu 0, 3, 2
232 ; CHECK-P8-NEXT: bge 0, .LBB5_4
233 ; CHECK-P8-NEXT: # %bb.1: # %entry
234 ; CHECK-P8-NEXT: fcmpu 0, 3, 1
235 ; CHECK-P8-NEXT: bge 0, .LBB5_5
236 ; CHECK-P8-NEXT: .LBB5_2: # %entry
237 ; CHECK-P8-NEXT: fcmpu 0, 3, 4
238 ; CHECK-P8-NEXT: bge 0, .LBB5_6
239 ; CHECK-P8-NEXT: .LBB5_3: # %entry
240 ; CHECK-P8-NEXT: fmr 1, 3
242 ; CHECK-P8-NEXT: .LBB5_4: # %entry
243 ; CHECK-P8-NEXT: fmr 3, 2
244 ; CHECK-P8-NEXT: fcmpu 0, 3, 1
245 ; CHECK-P8-NEXT: blt 0, .LBB5_2
246 ; CHECK-P8-NEXT: .LBB5_5: # %entry
247 ; CHECK-P8-NEXT: fmr 3, 1
248 ; CHECK-P8-NEXT: fcmpu 0, 3, 4
249 ; CHECK-P8-NEXT: blt 0, .LBB5_3
250 ; CHECK-P8-NEXT: .LBB5_6: # %entry
251 ; CHECK-P8-NEXT: fmr 3, 4
252 ; CHECK-P8-NEXT: fmr 1, 3
255 %0 = call float (float, float, float, ...) @llvm.ppc.minfs(float %a, float %b, float %c, float %d)