1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z15 -verify-machineinstrs -O3 \
5 ; Test reassociation of fp add, subtract and multiply.
7 define double @fun0_fadd(ptr %x) {
8 ; CHECK-LABEL: fun0_fadd:
9 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: ld %f0, 0(%r2)
11 ; CHECK-NEXT: adb %f0, 8(%r2)
12 ; CHECK-NEXT: ld %f1, 24(%r2)
13 ; CHECK-NEXT: adb %f1, 16(%r2)
14 ; CHECK-NEXT: adbr %f0, %f1
15 ; CHECK-NEXT: ld %f1, 40(%r2)
16 ; CHECK-NEXT: adb %f1, 32(%r2)
17 ; CHECK-NEXT: adb %f1, 48(%r2)
18 ; CHECK-NEXT: adbr %f0, %f1
19 ; CHECK-NEXT: adb %f0, 56(%r2)
22 %0 = load double, ptr %x, align 8
23 %arrayidx1 = getelementptr inbounds double, ptr %x, i64 1
24 %1 = load double, ptr %arrayidx1, align 8
25 %add = fadd reassoc nsz arcp contract afn double %1, %0
26 %arrayidx2 = getelementptr inbounds double, ptr %x, i64 2
27 %2 = load double, ptr %arrayidx2, align 8
28 %add3 = fadd reassoc nsz arcp contract afn double %add, %2
29 %arrayidx4 = getelementptr inbounds double, ptr %x, i64 3
30 %3 = load double, ptr %arrayidx4, align 8
31 %add5 = fadd reassoc nsz arcp contract afn double %add3, %3
32 %arrayidx6 = getelementptr inbounds double, ptr %x, i64 4
33 %4 = load double, ptr %arrayidx6, align 8
34 %add7 = fadd reassoc nsz arcp contract afn double %add5, %4
35 %arrayidx8 = getelementptr inbounds double, ptr %x, i64 5
36 %5 = load double, ptr %arrayidx8, align 8
37 %add9 = fadd reassoc nsz arcp contract afn double %add7, %5
38 %arrayidx10 = getelementptr inbounds double, ptr %x, i64 6
39 %6 = load double, ptr %arrayidx10, align 8
40 %add11 = fadd reassoc nsz arcp contract afn double %add9, %6
41 %arrayidx12 = getelementptr inbounds double, ptr %x, i64 7
42 %7 = load double, ptr %arrayidx12, align 8
43 %add13 = fadd reassoc nsz arcp contract afn double %add11, %7
47 define float @fun1_fadd(ptr %x) {
48 ; CHECK-LABEL: fun1_fadd:
49 ; CHECK: # %bb.0: # %entry
50 ; CHECK-NEXT: lde %f0, 0(%r2)
51 ; CHECK-NEXT: aeb %f0, 4(%r2)
52 ; CHECK-NEXT: lde %f1, 12(%r2)
53 ; CHECK-NEXT: aeb %f1, 8(%r2)
54 ; CHECK-NEXT: aebr %f0, %f1
55 ; CHECK-NEXT: lde %f1, 20(%r2)
56 ; CHECK-NEXT: aeb %f1, 16(%r2)
57 ; CHECK-NEXT: aeb %f1, 24(%r2)
58 ; CHECK-NEXT: aebr %f0, %f1
59 ; CHECK-NEXT: aeb %f0, 28(%r2)
62 %0 = load float, ptr %x, align 8
63 %arrayidx1 = getelementptr inbounds float, ptr %x, i64 1
64 %1 = load float, ptr %arrayidx1, align 8
65 %add = fadd reassoc nsz arcp contract afn float %1, %0
66 %arrayidx2 = getelementptr inbounds float, ptr %x, i64 2
67 %2 = load float, ptr %arrayidx2, align 8
68 %add3 = fadd reassoc nsz arcp contract afn float %add, %2
69 %arrayidx4 = getelementptr inbounds float, ptr %x, i64 3
70 %3 = load float, ptr %arrayidx4, align 8
71 %add5 = fadd reassoc nsz arcp contract afn float %add3, %3
72 %arrayidx6 = getelementptr inbounds float, ptr %x, i64 4
73 %4 = load float, ptr %arrayidx6, align 8
74 %add7 = fadd reassoc nsz arcp contract afn float %add5, %4
75 %arrayidx8 = getelementptr inbounds float, ptr %x, i64 5
76 %5 = load float, ptr %arrayidx8, align 8
77 %add9 = fadd reassoc nsz arcp contract afn float %add7, %5
78 %arrayidx10 = getelementptr inbounds float, ptr %x, i64 6
79 %6 = load float, ptr %arrayidx10, align 8
80 %add11 = fadd reassoc nsz arcp contract afn float %add9, %6
81 %arrayidx12 = getelementptr inbounds float, ptr %x, i64 7
82 %7 = load float, ptr %arrayidx12, align 8
83 %add13 = fadd reassoc nsz arcp contract afn float %add11, %7
87 define fp128 @fun2_fadd(ptr %x) {
88 ; CHECK-LABEL: fun2_fadd:
89 ; CHECK: # %bb.0: # %entry
90 ; CHECK-NEXT: vl %v0, 0(%r3), 3
91 ; CHECK-NEXT: vl %v1, 16(%r3), 3
92 ; CHECK-NEXT: wfaxb %v0, %v1, %v0
93 ; CHECK-NEXT: vl %v1, 32(%r3), 3
94 ; CHECK-NEXT: vl %v2, 48(%r3), 3
95 ; CHECK-NEXT: wfaxb %v1, %v1, %v2
96 ; CHECK-NEXT: wfaxb %v0, %v0, %v1
97 ; CHECK-NEXT: vl %v1, 64(%r3), 3
98 ; CHECK-NEXT: vl %v2, 80(%r3), 3
99 ; CHECK-NEXT: wfaxb %v1, %v1, %v2
100 ; CHECK-NEXT: vl %v2, 96(%r3), 3
101 ; CHECK-NEXT: wfaxb %v1, %v1, %v2
102 ; CHECK-NEXT: wfaxb %v0, %v0, %v1
103 ; CHECK-NEXT: vl %v1, 112(%r3), 3
104 ; CHECK-NEXT: wfaxb %v0, %v0, %v1
105 ; CHECK-NEXT: vst %v0, 0(%r2), 3
106 ; CHECK-NEXT: br %r14
108 %0 = load fp128, ptr %x, align 8
109 %arrayidx1 = getelementptr inbounds fp128, ptr %x, i64 1
110 %1 = load fp128, ptr %arrayidx1, align 8
111 %add = fadd reassoc nsz arcp contract afn fp128 %1, %0
112 %arrayidx2 = getelementptr inbounds fp128, ptr %x, i64 2
113 %2 = load fp128, ptr %arrayidx2, align 8
114 %add3 = fadd reassoc nsz arcp contract afn fp128 %add, %2
115 %arrayidx4 = getelementptr inbounds fp128, ptr %x, i64 3
116 %3 = load fp128, ptr %arrayidx4, align 8
117 %add5 = fadd reassoc nsz arcp contract afn fp128 %add3, %3
118 %arrayidx6 = getelementptr inbounds fp128, ptr %x, i64 4
119 %4 = load fp128, ptr %arrayidx6, align 8
120 %add7 = fadd reassoc nsz arcp contract afn fp128 %add5, %4
121 %arrayidx8 = getelementptr inbounds fp128, ptr %x, i64 5
122 %5 = load fp128, ptr %arrayidx8, align 8
123 %add9 = fadd reassoc nsz arcp contract afn fp128 %add7, %5
124 %arrayidx10 = getelementptr inbounds fp128, ptr %x, i64 6
125 %6 = load fp128, ptr %arrayidx10, align 8
126 %add11 = fadd reassoc nsz arcp contract afn fp128 %add9, %6
127 %arrayidx12 = getelementptr inbounds fp128, ptr %x, i64 7
128 %7 = load fp128, ptr %arrayidx12, align 8
129 %add13 = fadd reassoc nsz arcp contract afn fp128 %add11, %7
133 define <2 x double> @fun3_fadd(ptr %x) {
134 ; CHECK-LABEL: fun3_fadd:
135 ; CHECK: # %bb.0: # %entry
136 ; CHECK-NEXT: vl %v0, 0(%r2), 3
137 ; CHECK-NEXT: vl %v1, 16(%r2), 3
138 ; CHECK-NEXT: vfadb %v0, %v1, %v0
139 ; CHECK-NEXT: vl %v1, 32(%r2), 3
140 ; CHECK-NEXT: vl %v2, 48(%r2), 3
141 ; CHECK-NEXT: vfadb %v1, %v1, %v2
142 ; CHECK-NEXT: vfadb %v0, %v0, %v1
143 ; CHECK-NEXT: vl %v1, 64(%r2), 3
144 ; CHECK-NEXT: vl %v2, 80(%r2), 3
145 ; CHECK-NEXT: vfadb %v1, %v1, %v2
146 ; CHECK-NEXT: vl %v2, 96(%r2), 3
147 ; CHECK-NEXT: vfadb %v1, %v1, %v2
148 ; CHECK-NEXT: vfadb %v0, %v0, %v1
149 ; CHECK-NEXT: vl %v1, 112(%r2), 3
150 ; CHECK-NEXT: vfadb %v24, %v0, %v1
151 ; CHECK-NEXT: br %r14
153 %0 = load <2 x double>, ptr %x, align 8
154 %arrayidx1 = getelementptr inbounds <2 x double>, ptr %x, i64 1
155 %1 = load <2 x double>, ptr %arrayidx1, align 8
156 %add = fadd reassoc nsz arcp contract afn <2 x double> %1, %0
157 %arrayidx2 = getelementptr inbounds <2 x double>, ptr %x, i64 2
158 %2 = load <2 x double>, ptr %arrayidx2, align 8
159 %add3 = fadd reassoc nsz arcp contract afn <2 x double> %add, %2
160 %arrayidx4 = getelementptr inbounds <2 x double>, ptr %x, i64 3
161 %3 = load <2 x double>, ptr %arrayidx4, align 8
162 %add5 = fadd reassoc nsz arcp contract afn <2 x double> %add3, %3
163 %arrayidx6 = getelementptr inbounds <2 x double>, ptr %x, i64 4
164 %4 = load <2 x double>, ptr %arrayidx6, align 8
165 %add7 = fadd reassoc nsz arcp contract afn <2 x double> %add5, %4
166 %arrayidx8 = getelementptr inbounds <2 x double>, ptr %x, i64 5
167 %5 = load <2 x double>, ptr %arrayidx8, align 8
168 %add9 = fadd reassoc nsz arcp contract afn <2 x double> %add7, %5
169 %arrayidx10 = getelementptr inbounds <2 x double>, ptr %x, i64 6
170 %6 = load <2 x double>, ptr %arrayidx10, align 8
171 %add11 = fadd reassoc nsz arcp contract afn <2 x double> %add9, %6
172 %arrayidx12 = getelementptr inbounds <2 x double>, ptr %x, i64 7
173 %7 = load <2 x double>, ptr %arrayidx12, align 8
174 %add13 = fadd reassoc nsz arcp contract afn <2 x double> %add11, %7
175 ret <2 x double> %add13
178 define <4 x float> @fun4_fadd(ptr %x) {
179 ; CHECK-LABEL: fun4_fadd:
180 ; CHECK: # %bb.0: # %entry
181 ; CHECK-NEXT: vl %v0, 0(%r2), 3
182 ; CHECK-NEXT: vl %v1, 16(%r2), 3
183 ; CHECK-NEXT: vfasb %v0, %v1, %v0
184 ; CHECK-NEXT: vl %v1, 32(%r2), 3
185 ; CHECK-NEXT: vl %v2, 48(%r2), 3
186 ; CHECK-NEXT: vfasb %v1, %v1, %v2
187 ; CHECK-NEXT: vfasb %v0, %v0, %v1
188 ; CHECK-NEXT: vl %v1, 64(%r2), 3
189 ; CHECK-NEXT: vl %v2, 80(%r2), 3
190 ; CHECK-NEXT: vfasb %v1, %v1, %v2
191 ; CHECK-NEXT: vl %v2, 96(%r2), 3
192 ; CHECK-NEXT: vfasb %v1, %v1, %v2
193 ; CHECK-NEXT: vfasb %v0, %v0, %v1
194 ; CHECK-NEXT: vl %v1, 112(%r2), 3
195 ; CHECK-NEXT: vfasb %v24, %v0, %v1
196 ; CHECK-NEXT: br %r14
198 %0 = load <4 x float>, ptr %x, align 8
199 %arrayidx1 = getelementptr inbounds <4 x float>, ptr %x, i64 1
200 %1 = load <4 x float>, ptr %arrayidx1, align 8
201 %add = fadd reassoc nsz arcp contract afn <4 x float> %1, %0
202 %arrayidx2 = getelementptr inbounds <4 x float>, ptr %x, i64 2
203 %2 = load <4 x float>, ptr %arrayidx2, align 8
204 %add3 = fadd reassoc nsz arcp contract afn <4 x float> %add, %2
205 %arrayidx4 = getelementptr inbounds <4 x float>, ptr %x, i64 3
206 %3 = load <4 x float>, ptr %arrayidx4, align 8
207 %add5 = fadd reassoc nsz arcp contract afn <4 x float> %add3, %3
208 %arrayidx6 = getelementptr inbounds <4 x float>, ptr %x, i64 4
209 %4 = load <4 x float>, ptr %arrayidx6, align 8
210 %add7 = fadd reassoc nsz arcp contract afn <4 x float> %add5, %4
211 %arrayidx8 = getelementptr inbounds <4 x float>, ptr %x, i64 5
212 %5 = load <4 x float>, ptr %arrayidx8, align 8
213 %add9 = fadd reassoc nsz arcp contract afn <4 x float> %add7, %5
214 %arrayidx10 = getelementptr inbounds <4 x float>, ptr %x, i64 6
215 %6 = load <4 x float>, ptr %arrayidx10, align 8
216 %add11 = fadd reassoc nsz arcp contract afn <4 x float> %add9, %6
217 %arrayidx12 = getelementptr inbounds <4 x float>, ptr %x, i64 7
218 %7 = load <4 x float>, ptr %arrayidx12, align 8
219 %add13 = fadd reassoc nsz arcp contract afn <4 x float> %add11, %7
220 ret <4 x float> %add13
223 define double @fun5_fsub(ptr %x) {
224 ; CHECK-LABEL: fun5_fsub:
225 ; CHECK: # %bb.0: # %entry
226 ; CHECK-NEXT: ld %f0, 0(%r2)
227 ; CHECK-NEXT: sdb %f0, 8(%r2)
228 ; CHECK-NEXT: ld %f1, 24(%r2)
229 ; CHECK-NEXT: adb %f1, 16(%r2)
230 ; CHECK-NEXT: sdbr %f0, %f1
231 ; CHECK-NEXT: ld %f1, 40(%r2)
232 ; CHECK-NEXT: adb %f1, 32(%r2)
233 ; CHECK-NEXT: adb %f1, 48(%r2)
234 ; CHECK-NEXT: sdbr %f0, %f1
235 ; CHECK-NEXT: sdb %f0, 56(%r2)
236 ; CHECK-NEXT: br %r14
238 %0 = load double, ptr %x, align 8
239 %arrayidx1 = getelementptr inbounds double, ptr %x, i64 1
240 %1 = load double, ptr %arrayidx1, align 8
241 %sub = fsub reassoc nsz arcp contract afn double %0, %1
242 %arrayidx2 = getelementptr inbounds double, ptr %x, i64 2
243 %2 = load double, ptr %arrayidx2, align 8
244 %sub3 = fsub reassoc nsz arcp contract afn double %sub, %2
245 %arrayidx4 = getelementptr inbounds double, ptr %x, i64 3
246 %3 = load double, ptr %arrayidx4, align 8
247 %sub5 = fsub reassoc nsz arcp contract afn double %sub3, %3
248 %arrayidx6 = getelementptr inbounds double, ptr %x, i64 4
249 %4 = load double, ptr %arrayidx6, align 8
250 %sub7 = fsub reassoc nsz arcp contract afn double %sub5, %4
251 %arrayidx8 = getelementptr inbounds double, ptr %x, i64 5
252 %5 = load double, ptr %arrayidx8, align 8
253 %sub9 = fsub reassoc nsz arcp contract afn double %sub7, %5
254 %arrayidx10 = getelementptr inbounds double, ptr %x, i64 6
255 %6 = load double, ptr %arrayidx10, align 8
256 %sub11 = fsub reassoc nsz arcp contract afn double %sub9, %6
257 %arrayidx12 = getelementptr inbounds double, ptr %x, i64 7
258 %7 = load double, ptr %arrayidx12, align 8
259 %sub13 = fsub reassoc nsz arcp contract afn double %sub11, %7
263 define float @fun6_fsub(ptr %x) {
264 ; CHECK-LABEL: fun6_fsub:
265 ; CHECK: # %bb.0: # %entry
266 ; CHECK-NEXT: lde %f0, 0(%r2)
267 ; CHECK-NEXT: seb %f0, 4(%r2)
268 ; CHECK-NEXT: lde %f1, 12(%r2)
269 ; CHECK-NEXT: aeb %f1, 8(%r2)
270 ; CHECK-NEXT: sebr %f0, %f1
271 ; CHECK-NEXT: lde %f1, 20(%r2)
272 ; CHECK-NEXT: aeb %f1, 16(%r2)
273 ; CHECK-NEXT: aeb %f1, 24(%r2)
274 ; CHECK-NEXT: sebr %f0, %f1
275 ; CHECK-NEXT: seb %f0, 28(%r2)
276 ; CHECK-NEXT: br %r14
278 %0 = load float, ptr %x, align 8
279 %arrayidx1 = getelementptr inbounds float, ptr %x, i64 1
280 %1 = load float, ptr %arrayidx1, align 8
281 %sub = fsub reassoc nsz arcp contract afn float %0, %1
282 %arrayidx2 = getelementptr inbounds float, ptr %x, i64 2
283 %2 = load float, ptr %arrayidx2, align 8
284 %sub3 = fsub reassoc nsz arcp contract afn float %sub, %2
285 %arrayidx4 = getelementptr inbounds float, ptr %x, i64 3
286 %3 = load float, ptr %arrayidx4, align 8
287 %sub5 = fsub reassoc nsz arcp contract afn float %sub3, %3
288 %arrayidx6 = getelementptr inbounds float, ptr %x, i64 4
289 %4 = load float, ptr %arrayidx6, align 8
290 %sub7 = fsub reassoc nsz arcp contract afn float %sub5, %4
291 %arrayidx8 = getelementptr inbounds float, ptr %x, i64 5
292 %5 = load float, ptr %arrayidx8, align 8
293 %sub9 = fsub reassoc nsz arcp contract afn float %sub7, %5
294 %arrayidx10 = getelementptr inbounds float, ptr %x, i64 6
295 %6 = load float, ptr %arrayidx10, align 8
296 %sub11 = fsub reassoc nsz arcp contract afn float %sub9, %6
297 %arrayidx12 = getelementptr inbounds float, ptr %x, i64 7
298 %7 = load float, ptr %arrayidx12, align 8
299 %sub13 = fsub reassoc nsz arcp contract afn float %sub11, %7
303 define fp128 @fun7_fsub(ptr %x) {
304 ; CHECK-LABEL: fun7_fsub:
305 ; CHECK: # %bb.0: # %entry
306 ; CHECK-NEXT: vl %v0, 0(%r3), 3
307 ; CHECK-NEXT: vl %v1, 16(%r3), 3
308 ; CHECK-NEXT: wfsxb %v0, %v0, %v1
309 ; CHECK-NEXT: vl %v1, 32(%r3), 3
310 ; CHECK-NEXT: vl %v2, 48(%r3), 3
311 ; CHECK-NEXT: wfaxb %v1, %v1, %v2
312 ; CHECK-NEXT: wfsxb %v0, %v0, %v1
313 ; CHECK-NEXT: vl %v1, 64(%r3), 3
314 ; CHECK-NEXT: vl %v2, 80(%r3), 3
315 ; CHECK-NEXT: wfaxb %v1, %v1, %v2
316 ; CHECK-NEXT: vl %v2, 96(%r3), 3
317 ; CHECK-NEXT: wfaxb %v1, %v1, %v2
318 ; CHECK-NEXT: wfsxb %v0, %v0, %v1
319 ; CHECK-NEXT: vl %v1, 112(%r3), 3
320 ; CHECK-NEXT: wfsxb %v0, %v0, %v1
321 ; CHECK-NEXT: vst %v0, 0(%r2), 3
322 ; CHECK-NEXT: br %r14
324 %0 = load fp128, ptr %x, align 8
325 %arrayidx1 = getelementptr inbounds fp128, ptr %x, i64 1
326 %1 = load fp128, ptr %arrayidx1, align 8
327 %sub = fsub reassoc nsz arcp contract afn fp128 %0, %1
328 %arrayidx2 = getelementptr inbounds fp128, ptr %x, i64 2
329 %2 = load fp128, ptr %arrayidx2, align 8
330 %sub3 = fsub reassoc nsz arcp contract afn fp128 %sub, %2
331 %arrayidx4 = getelementptr inbounds fp128, ptr %x, i64 3
332 %3 = load fp128, ptr %arrayidx4, align 8
333 %sub5 = fsub reassoc nsz arcp contract afn fp128 %sub3, %3
334 %arrayidx6 = getelementptr inbounds fp128, ptr %x, i64 4
335 %4 = load fp128, ptr %arrayidx6, align 8
336 %sub7 = fsub reassoc nsz arcp contract afn fp128 %sub5, %4
337 %arrayidx8 = getelementptr inbounds fp128, ptr %x, i64 5
338 %5 = load fp128, ptr %arrayidx8, align 8
339 %sub9 = fsub reassoc nsz arcp contract afn fp128 %sub7, %5
340 %arrayidx10 = getelementptr inbounds fp128, ptr %x, i64 6
341 %6 = load fp128, ptr %arrayidx10, align 8
342 %sub11 = fsub reassoc nsz arcp contract afn fp128 %sub9, %6
343 %arrayidx12 = getelementptr inbounds fp128, ptr %x, i64 7
344 %7 = load fp128, ptr %arrayidx12, align 8
345 %sub13 = fsub reassoc nsz arcp contract afn fp128 %sub11, %7
349 define <2 x double> @fun8_fsub(ptr %x) {
350 ; CHECK-LABEL: fun8_fsub:
351 ; CHECK: # %bb.0: # %entry
352 ; CHECK-NEXT: vl %v0, 0(%r2), 3
353 ; CHECK-NEXT: vl %v1, 16(%r2), 3
354 ; CHECK-NEXT: vfsdb %v0, %v0, %v1
355 ; CHECK-NEXT: vl %v1, 32(%r2), 3
356 ; CHECK-NEXT: vl %v2, 48(%r2), 3
357 ; CHECK-NEXT: vfadb %v1, %v1, %v2
358 ; CHECK-NEXT: vfsdb %v0, %v0, %v1
359 ; CHECK-NEXT: vl %v1, 64(%r2), 3
360 ; CHECK-NEXT: vl %v2, 80(%r2), 3
361 ; CHECK-NEXT: vfadb %v1, %v1, %v2
362 ; CHECK-NEXT: vl %v2, 96(%r2), 3
363 ; CHECK-NEXT: vfadb %v1, %v1, %v2
364 ; CHECK-NEXT: vfsdb %v0, %v0, %v1
365 ; CHECK-NEXT: vl %v1, 112(%r2), 3
366 ; CHECK-NEXT: vfsdb %v24, %v0, %v1
367 ; CHECK-NEXT: br %r14
369 %0 = load <2 x double>, ptr %x, align 8
370 %arrayidx1 = getelementptr inbounds <2 x double>, ptr %x, i64 1
371 %1 = load <2 x double>, ptr %arrayidx1, align 8
372 %sub = fsub reassoc nsz arcp contract afn <2 x double> %0, %1
373 %arrayidx2 = getelementptr inbounds <2 x double>, ptr %x, i64 2
374 %2 = load <2 x double>, ptr %arrayidx2, align 8
375 %sub3 = fsub reassoc nsz arcp contract afn <2 x double> %sub, %2
376 %arrayidx4 = getelementptr inbounds <2 x double>, ptr %x, i64 3
377 %3 = load <2 x double>, ptr %arrayidx4, align 8
378 %sub5 = fsub reassoc nsz arcp contract afn <2 x double> %sub3, %3
379 %arrayidx6 = getelementptr inbounds <2 x double>, ptr %x, i64 4
380 %4 = load <2 x double>, ptr %arrayidx6, align 8
381 %sub7 = fsub reassoc nsz arcp contract afn <2 x double> %sub5, %4
382 %arrayidx8 = getelementptr inbounds <2 x double>, ptr %x, i64 5
383 %5 = load <2 x double>, ptr %arrayidx8, align 8
384 %sub9 = fsub reassoc nsz arcp contract afn <2 x double> %sub7, %5
385 %arrayidx10 = getelementptr inbounds <2 x double>, ptr %x, i64 6
386 %6 = load <2 x double>, ptr %arrayidx10, align 8
387 %sub11 = fsub reassoc nsz arcp contract afn <2 x double> %sub9, %6
388 %arrayidx12 = getelementptr inbounds <2 x double>, ptr %x, i64 7
389 %7 = load <2 x double>, ptr %arrayidx12, align 8
390 %sub13 = fsub reassoc nsz arcp contract afn <2 x double> %sub11, %7
391 ret <2 x double> %sub13
394 define <4 x float> @fun9_fsub(ptr %x) {
395 ; CHECK-LABEL: fun9_fsub:
396 ; CHECK: # %bb.0: # %entry
397 ; CHECK-NEXT: vl %v0, 0(%r2), 3
398 ; CHECK-NEXT: vl %v1, 16(%r2), 3
399 ; CHECK-NEXT: vfssb %v0, %v0, %v1
400 ; CHECK-NEXT: vl %v1, 32(%r2), 3
401 ; CHECK-NEXT: vl %v2, 48(%r2), 3
402 ; CHECK-NEXT: vfasb %v1, %v1, %v2
403 ; CHECK-NEXT: vfssb %v0, %v0, %v1
404 ; CHECK-NEXT: vl %v1, 64(%r2), 3
405 ; CHECK-NEXT: vl %v2, 80(%r2), 3
406 ; CHECK-NEXT: vfasb %v1, %v1, %v2
407 ; CHECK-NEXT: vl %v2, 96(%r2), 3
408 ; CHECK-NEXT: vfasb %v1, %v1, %v2
409 ; CHECK-NEXT: vfssb %v0, %v0, %v1
410 ; CHECK-NEXT: vl %v1, 112(%r2), 3
411 ; CHECK-NEXT: vfssb %v24, %v0, %v1
412 ; CHECK-NEXT: br %r14
414 %0 = load <4 x float>, ptr %x, align 8
415 %arrayidx1 = getelementptr inbounds <4 x float>, ptr %x, i64 1
416 %1 = load <4 x float>, ptr %arrayidx1, align 8
417 %sub = fsub reassoc nsz arcp contract afn <4 x float> %0, %1
418 %arrayidx2 = getelementptr inbounds <4 x float>, ptr %x, i64 2
419 %2 = load <4 x float>, ptr %arrayidx2, align 8
420 %sub3 = fsub reassoc nsz arcp contract afn <4 x float> %sub, %2
421 %arrayidx4 = getelementptr inbounds <4 x float>, ptr %x, i64 3
422 %3 = load <4 x float>, ptr %arrayidx4, align 8
423 %sub5 = fsub reassoc nsz arcp contract afn <4 x float> %sub3, %3
424 %arrayidx6 = getelementptr inbounds <4 x float>, ptr %x, i64 4
425 %4 = load <4 x float>, ptr %arrayidx6, align 8
426 %sub7 = fsub reassoc nsz arcp contract afn <4 x float> %sub5, %4
427 %arrayidx8 = getelementptr inbounds <4 x float>, ptr %x, i64 5
428 %5 = load <4 x float>, ptr %arrayidx8, align 8
429 %sub9 = fsub reassoc nsz arcp contract afn <4 x float> %sub7, %5
430 %arrayidx10 = getelementptr inbounds <4 x float>, ptr %x, i64 6
431 %6 = load <4 x float>, ptr %arrayidx10, align 8
432 %sub11 = fsub reassoc nsz arcp contract afn <4 x float> %sub9, %6
433 %arrayidx12 = getelementptr inbounds <4 x float>, ptr %x, i64 7
434 %7 = load <4 x float>, ptr %arrayidx12, align 8
435 %sub13 = fsub reassoc nsz arcp contract afn <4 x float> %sub11, %7
436 ret <4 x float> %sub13
439 define double @fun10_fmul(ptr %x) {
440 ; CHECK-LABEL: fun10_fmul:
441 ; CHECK: # %bb.0: # %entry
442 ; CHECK-NEXT: ld %f0, 8(%r2)
443 ; CHECK-NEXT: mdb %f0, 0(%r2)
444 ; CHECK-NEXT: ld %f1, 24(%r2)
445 ; CHECK-NEXT: mdb %f1, 16(%r2)
446 ; CHECK-NEXT: mdbr %f0, %f1
447 ; CHECK-NEXT: ld %f1, 40(%r2)
448 ; CHECK-NEXT: mdb %f1, 32(%r2)
449 ; CHECK-NEXT: mdb %f1, 48(%r2)
450 ; CHECK-NEXT: mdbr %f0, %f1
451 ; CHECK-NEXT: mdb %f0, 56(%r2)
452 ; CHECK-NEXT: br %r14
454 %0 = load double, ptr %x, align 8
455 %arrayidx1 = getelementptr inbounds double, ptr %x, i64 1
456 %1 = load double, ptr %arrayidx1, align 8
457 %mul = fmul reassoc nsz arcp contract afn double %0, %1
458 %arrayidx2 = getelementptr inbounds double, ptr %x, i64 2
459 %2 = load double, ptr %arrayidx2, align 8
460 %mul3 = fmul reassoc nsz arcp contract afn double %mul, %2
461 %arrayidx4 = getelementptr inbounds double, ptr %x, i64 3
462 %3 = load double, ptr %arrayidx4, align 8
463 %mul5 = fmul reassoc nsz arcp contract afn double %mul3, %3
464 %arrayidx6 = getelementptr inbounds double, ptr %x, i64 4
465 %4 = load double, ptr %arrayidx6, align 8
466 %mul7 = fmul reassoc nsz arcp contract afn double %mul5, %4
467 %arrayidx8 = getelementptr inbounds double, ptr %x, i64 5
468 %5 = load double, ptr %arrayidx8, align 8
469 %mul9 = fmul reassoc nsz arcp contract afn double %mul7, %5
470 %arrayidx10 = getelementptr inbounds double, ptr %x, i64 6
471 %6 = load double, ptr %arrayidx10, align 8
472 %mul11 = fmul reassoc nsz arcp contract afn double %mul9, %6
473 %arrayidx12 = getelementptr inbounds double, ptr %x, i64 7
474 %7 = load double, ptr %arrayidx12, align 8
475 %mul13 = fmul reassoc nsz arcp contract afn double %mul11, %7
479 define float @fun11_fmul(ptr %x) {
480 ; CHECK-LABEL: fun11_fmul:
481 ; CHECK: # %bb.0: # %entry
482 ; CHECK-NEXT: lde %f0, 4(%r2)
483 ; CHECK-NEXT: meeb %f0, 0(%r2)
484 ; CHECK-NEXT: lde %f1, 12(%r2)
485 ; CHECK-NEXT: meeb %f1, 8(%r2)
486 ; CHECK-NEXT: meebr %f0, %f1
487 ; CHECK-NEXT: lde %f1, 20(%r2)
488 ; CHECK-NEXT: meeb %f1, 16(%r2)
489 ; CHECK-NEXT: meeb %f1, 24(%r2)
490 ; CHECK-NEXT: meebr %f0, %f1
491 ; CHECK-NEXT: meeb %f0, 28(%r2)
492 ; CHECK-NEXT: br %r14
494 %0 = load float, ptr %x, align 8
495 %arrayidx1 = getelementptr inbounds float, ptr %x, i64 1
496 %1 = load float, ptr %arrayidx1, align 8
497 %mul = fmul reassoc nsz arcp contract afn float %0, %1
498 %arrayidx2 = getelementptr inbounds float, ptr %x, i64 2
499 %2 = load float, ptr %arrayidx2, align 8
500 %mul3 = fmul reassoc nsz arcp contract afn float %mul, %2
501 %arrayidx4 = getelementptr inbounds float, ptr %x, i64 3
502 %3 = load float, ptr %arrayidx4, align 8
503 %mul5 = fmul reassoc nsz arcp contract afn float %mul3, %3
504 %arrayidx6 = getelementptr inbounds float, ptr %x, i64 4
505 %4 = load float, ptr %arrayidx6, align 8
506 %mul7 = fmul reassoc nsz arcp contract afn float %mul5, %4
507 %arrayidx8 = getelementptr inbounds float, ptr %x, i64 5
508 %5 = load float, ptr %arrayidx8, align 8
509 %mul9 = fmul reassoc nsz arcp contract afn float %mul7, %5
510 %arrayidx10 = getelementptr inbounds float, ptr %x, i64 6
511 %6 = load float, ptr %arrayidx10, align 8
512 %mul11 = fmul reassoc nsz arcp contract afn float %mul9, %6
513 %arrayidx12 = getelementptr inbounds float, ptr %x, i64 7
514 %7 = load float, ptr %arrayidx12, align 8
515 %mul13 = fmul reassoc nsz arcp contract afn float %mul11, %7
519 define fp128 @fun12_fmul(ptr %x) {
520 ; CHECK-LABEL: fun12_fmul:
521 ; CHECK: # %bb.0: # %entry
522 ; CHECK-NEXT: vl %v0, 0(%r3), 3
523 ; CHECK-NEXT: vl %v1, 16(%r3), 3
524 ; CHECK-NEXT: wfmxb %v0, %v0, %v1
525 ; CHECK-NEXT: vl %v1, 32(%r3), 3
526 ; CHECK-NEXT: vl %v2, 48(%r3), 3
527 ; CHECK-NEXT: wfmxb %v1, %v1, %v2
528 ; CHECK-NEXT: wfmxb %v0, %v0, %v1
529 ; CHECK-NEXT: vl %v1, 64(%r3), 3
530 ; CHECK-NEXT: vl %v2, 80(%r3), 3
531 ; CHECK-NEXT: wfmxb %v1, %v1, %v2
532 ; CHECK-NEXT: vl %v2, 96(%r3), 3
533 ; CHECK-NEXT: wfmxb %v1, %v1, %v2
534 ; CHECK-NEXT: wfmxb %v0, %v0, %v1
535 ; CHECK-NEXT: vl %v1, 112(%r3), 3
536 ; CHECK-NEXT: wfmxb %v0, %v0, %v1
537 ; CHECK-NEXT: vst %v0, 0(%r2), 3
538 ; CHECK-NEXT: br %r14
540 %0 = load fp128, ptr %x, align 8
541 %arrayidx1 = getelementptr inbounds fp128, ptr %x, i64 1
542 %1 = load fp128, ptr %arrayidx1, align 8
543 %mul = fmul reassoc nsz arcp contract afn fp128 %0, %1
544 %arrayidx2 = getelementptr inbounds fp128, ptr %x, i64 2
545 %2 = load fp128, ptr %arrayidx2, align 8
546 %mul3 = fmul reassoc nsz arcp contract afn fp128 %mul, %2
547 %arrayidx4 = getelementptr inbounds fp128, ptr %x, i64 3
548 %3 = load fp128, ptr %arrayidx4, align 8
549 %mul5 = fmul reassoc nsz arcp contract afn fp128 %mul3, %3
550 %arrayidx6 = getelementptr inbounds fp128, ptr %x, i64 4
551 %4 = load fp128, ptr %arrayidx6, align 8
552 %mul7 = fmul reassoc nsz arcp contract afn fp128 %mul5, %4
553 %arrayidx8 = getelementptr inbounds fp128, ptr %x, i64 5
554 %5 = load fp128, ptr %arrayidx8, align 8
555 %mul9 = fmul reassoc nsz arcp contract afn fp128 %mul7, %5
556 %arrayidx10 = getelementptr inbounds fp128, ptr %x, i64 6
557 %6 = load fp128, ptr %arrayidx10, align 8
558 %mul11 = fmul reassoc nsz arcp contract afn fp128 %mul9, %6
559 %arrayidx12 = getelementptr inbounds fp128, ptr %x, i64 7
560 %7 = load fp128, ptr %arrayidx12, align 8
561 %mul13 = fmul reassoc nsz arcp contract afn fp128 %mul11, %7
565 define <2 x double> @fun13_fmul(ptr %x) {
566 ; CHECK-LABEL: fun13_fmul:
567 ; CHECK: # %bb.0: # %entry
568 ; CHECK-NEXT: vl %v0, 0(%r2), 3
569 ; CHECK-NEXT: vl %v1, 16(%r2), 3
570 ; CHECK-NEXT: vfmdb %v0, %v0, %v1
571 ; CHECK-NEXT: vl %v1, 32(%r2), 3
572 ; CHECK-NEXT: vl %v2, 48(%r2), 3
573 ; CHECK-NEXT: vfmdb %v1, %v1, %v2
574 ; CHECK-NEXT: vfmdb %v0, %v0, %v1
575 ; CHECK-NEXT: vl %v1, 64(%r2), 3
576 ; CHECK-NEXT: vl %v2, 80(%r2), 3
577 ; CHECK-NEXT: vfmdb %v1, %v1, %v2
578 ; CHECK-NEXT: vl %v2, 96(%r2), 3
579 ; CHECK-NEXT: vfmdb %v1, %v1, %v2
580 ; CHECK-NEXT: vfmdb %v0, %v0, %v1
581 ; CHECK-NEXT: vl %v1, 112(%r2), 3
582 ; CHECK-NEXT: vfmdb %v24, %v0, %v1
583 ; CHECK-NEXT: br %r14
585 %0 = load <2 x double>, ptr %x, align 8
586 %arrayidx1 = getelementptr inbounds <2 x double>, ptr %x, i64 1
587 %1 = load <2 x double>, ptr %arrayidx1, align 8
588 %mul = fmul reassoc nsz arcp contract afn <2 x double> %0, %1
589 %arrayidx2 = getelementptr inbounds <2 x double>, ptr %x, i64 2
590 %2 = load <2 x double>, ptr %arrayidx2, align 8
591 %mul3 = fmul reassoc nsz arcp contract afn <2 x double> %mul, %2
592 %arrayidx4 = getelementptr inbounds <2 x double>, ptr %x, i64 3
593 %3 = load <2 x double>, ptr %arrayidx4, align 8
594 %mul5 = fmul reassoc nsz arcp contract afn <2 x double> %mul3, %3
595 %arrayidx6 = getelementptr inbounds <2 x double>, ptr %x, i64 4
596 %4 = load <2 x double>, ptr %arrayidx6, align 8
597 %mul7 = fmul reassoc nsz arcp contract afn <2 x double> %mul5, %4
598 %arrayidx8 = getelementptr inbounds <2 x double>, ptr %x, i64 5
599 %5 = load <2 x double>, ptr %arrayidx8, align 8
600 %mul9 = fmul reassoc nsz arcp contract afn <2 x double> %mul7, %5
601 %arrayidx10 = getelementptr inbounds <2 x double>, ptr %x, i64 6
602 %6 = load <2 x double>, ptr %arrayidx10, align 8
603 %mul11 = fmul reassoc nsz arcp contract afn <2 x double> %mul9, %6
604 %arrayidx12 = getelementptr inbounds <2 x double>, ptr %x, i64 7
605 %7 = load <2 x double>, ptr %arrayidx12, align 8
606 %mul13 = fmul reassoc nsz arcp contract afn <2 x double> %mul11, %7
607 ret <2 x double> %mul13
610 define <4 x float> @fun14_fmul(ptr %x) {
611 ; CHECK-LABEL: fun14_fmul:
612 ; CHECK: # %bb.0: # %entry
613 ; CHECK-NEXT: vl %v0, 0(%r2), 3
614 ; CHECK-NEXT: vl %v1, 16(%r2), 3
615 ; CHECK-NEXT: vfmsb %v0, %v0, %v1
616 ; CHECK-NEXT: vl %v1, 32(%r2), 3
617 ; CHECK-NEXT: vl %v2, 48(%r2), 3
618 ; CHECK-NEXT: vfmsb %v1, %v1, %v2
619 ; CHECK-NEXT: vfmsb %v0, %v0, %v1
620 ; CHECK-NEXT: vl %v1, 64(%r2), 3
621 ; CHECK-NEXT: vl %v2, 80(%r2), 3
622 ; CHECK-NEXT: vfmsb %v1, %v1, %v2
623 ; CHECK-NEXT: vl %v2, 96(%r2), 3
624 ; CHECK-NEXT: vfmsb %v1, %v1, %v2
625 ; CHECK-NEXT: vfmsb %v0, %v0, %v1
626 ; CHECK-NEXT: vl %v1, 112(%r2), 3
627 ; CHECK-NEXT: vfmsb %v24, %v0, %v1
628 ; CHECK-NEXT: br %r14
630 %0 = load <4 x float>, ptr %x, align 8
631 %arrayidx1 = getelementptr inbounds <4 x float>, ptr %x, i64 1
632 %1 = load <4 x float>, ptr %arrayidx1, align 8
633 %mul = fmul reassoc nsz arcp contract afn <4 x float> %0, %1
634 %arrayidx2 = getelementptr inbounds <4 x float>, ptr %x, i64 2
635 %2 = load <4 x float>, ptr %arrayidx2, align 8
636 %mul3 = fmul reassoc nsz arcp contract afn <4 x float> %mul, %2
637 %arrayidx4 = getelementptr inbounds <4 x float>, ptr %x, i64 3
638 %3 = load <4 x float>, ptr %arrayidx4, align 8
639 %mul5 = fmul reassoc nsz arcp contract afn <4 x float> %mul3, %3
640 %arrayidx6 = getelementptr inbounds <4 x float>, ptr %x, i64 4
641 %4 = load <4 x float>, ptr %arrayidx6, align 8
642 %mul7 = fmul reassoc nsz arcp contract afn <4 x float> %mul5, %4
643 %arrayidx8 = getelementptr inbounds <4 x float>, ptr %x, i64 5
644 %5 = load <4 x float>, ptr %arrayidx8, align 8
645 %mul9 = fmul reassoc nsz arcp contract afn <4 x float> %mul7, %5
646 %arrayidx10 = getelementptr inbounds <4 x float>, ptr %x, i64 6
647 %6 = load <4 x float>, ptr %arrayidx10, align 8
648 %mul11 = fmul reassoc nsz arcp contract afn <4 x float> %mul9, %6
649 %arrayidx12 = getelementptr inbounds <4 x float>, ptr %x, i64 7
650 %7 = load <4 x float>, ptr %arrayidx12, align 8
651 %mul13 = fmul reassoc nsz arcp contract afn <4 x float> %mul11, %7
652 ret <4 x float> %mul13