1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mcpu=pwr9 -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \
3 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s --check-prefix=P9LE
4 ; RUN: llc -mcpu=pwr9 -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \
5 ; RUN: -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s --check-prefix=P9BE
6 ; RUN: llc -mcpu=pwr8 -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \
7 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s --check-prefix=P8LE
8 ; RUN: llc -mcpu=pwr8 -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \
9 ; RUN: -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s --check-prefix=P8BE
12 ; Function Attrs: norecurse nounwind readonly
13 define <2 x i64> @s2v_test1(ptr nocapture readonly %int64, <2 x i64> %vec) {
14 ; P9LE-LABEL: s2v_test1:
15 ; P9LE: # %bb.0: # %entry
16 ; P9LE-NEXT: lfd f0, 0(r3)
17 ; P9LE-NEXT: xxmrghd v2, v2, vs0
20 ; P9BE-LABEL: s2v_test1:
21 ; P9BE: # %bb.0: # %entry
22 ; P9BE-NEXT: lfd f0, 0(r3)
23 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
26 ; P8LE-LABEL: s2v_test1:
27 ; P8LE: # %bb.0: # %entry
28 ; P8LE-NEXT: lfdx f0, 0, r3
29 ; P8LE-NEXT: xxmrghd v2, v2, vs0
32 ; P8BE-LABEL: s2v_test1:
33 ; P8BE: # %bb.0: # %entry
34 ; P8BE-NEXT: lfdx f0, 0, r3
35 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
39 %0 = load i64, ptr %int64, align 8
40 %vecins = insertelement <2 x i64> %vec, i64 %0, i32 0
44 ; Function Attrs: norecurse nounwind readonly
45 define <2 x i64> @s2v_test2(ptr nocapture readonly %int64, <2 x i64> %vec) {
46 ; P9LE-LABEL: s2v_test2:
47 ; P9LE: # %bb.0: # %entry
48 ; P9LE-NEXT: lfd f0, 8(r3)
49 ; P9LE-NEXT: xxmrghd v2, v2, vs0
52 ; P9BE-LABEL: s2v_test2:
53 ; P9BE: # %bb.0: # %entry
54 ; P9BE-NEXT: lfd f0, 8(r3)
55 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
58 ; P8LE-LABEL: s2v_test2:
59 ; P8LE: # %bb.0: # %entry
60 ; P8LE-NEXT: lfd f0, 8(r3)
61 ; P8LE-NEXT: xxmrghd v2, v2, vs0
64 ; P8BE-LABEL: s2v_test2:
65 ; P8BE: # %bb.0: # %entry
66 ; P8BE-NEXT: lfd f0, 8(r3)
67 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
71 %arrayidx = getelementptr inbounds i64, ptr %int64, i64 1
72 %0 = load i64, ptr %arrayidx, align 8
73 %vecins = insertelement <2 x i64> %vec, i64 %0, i32 0
77 ; Function Attrs: norecurse nounwind readonly
78 define <2 x i64> @s2v_test3(ptr nocapture readonly %int64, <2 x i64> %vec, i32 signext %Idx) {
79 ; P9LE-LABEL: s2v_test3:
80 ; P9LE: # %bb.0: # %entry
81 ; P9LE-NEXT: sldi r4, r7, 3
82 ; P9LE-NEXT: lfdx f0, r3, r4
83 ; P9LE-NEXT: xxmrghd v2, v2, vs0
86 ; P9BE-LABEL: s2v_test3:
87 ; P9BE: # %bb.0: # %entry
88 ; P9BE-NEXT: sldi r4, r7, 3
89 ; P9BE-NEXT: lfdx f0, r3, r4
90 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
93 ; P8LE-LABEL: s2v_test3:
94 ; P8LE: # %bb.0: # %entry
95 ; P8LE-NEXT: sldi r4, r7, 3
96 ; P8LE-NEXT: lfdx f0, r3, r4
97 ; P8LE-NEXT: xxmrghd v2, v2, vs0
100 ; P8BE-LABEL: s2v_test3:
101 ; P8BE: # %bb.0: # %entry
102 ; P8BE-NEXT: sldi r4, r7, 3
103 ; P8BE-NEXT: lfdx f0, r3, r4
104 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
108 %idxprom = sext i32 %Idx to i64
109 %arrayidx = getelementptr inbounds i64, ptr %int64, i64 %idxprom
110 %0 = load i64, ptr %arrayidx, align 8
111 %vecins = insertelement <2 x i64> %vec, i64 %0, i32 0
112 ret <2 x i64> %vecins
115 ; Function Attrs: norecurse nounwind readonly
116 define <2 x i64> @s2v_test4(ptr nocapture readonly %int64, <2 x i64> %vec) {
117 ; P9LE-LABEL: s2v_test4:
118 ; P9LE: # %bb.0: # %entry
119 ; P9LE-NEXT: lfd f0, 8(r3)
120 ; P9LE-NEXT: xxmrghd v2, v2, vs0
123 ; P9BE-LABEL: s2v_test4:
124 ; P9BE: # %bb.0: # %entry
125 ; P9BE-NEXT: lfd f0, 8(r3)
126 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
129 ; P8LE-LABEL: s2v_test4:
130 ; P8LE: # %bb.0: # %entry
131 ; P8LE-NEXT: lfd f0, 8(r3)
132 ; P8LE-NEXT: xxmrghd v2, v2, vs0
135 ; P8BE-LABEL: s2v_test4:
136 ; P8BE: # %bb.0: # %entry
137 ; P8BE-NEXT: lfd f0, 8(r3)
138 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
142 %arrayidx = getelementptr inbounds i64, ptr %int64, i64 1
143 %0 = load i64, ptr %arrayidx, align 8
144 %vecins = insertelement <2 x i64> %vec, i64 %0, i32 0
145 ret <2 x i64> %vecins
148 ; Function Attrs: norecurse nounwind readonly
149 define <2 x i64> @s2v_test5(<2 x i64> %vec, ptr nocapture readonly %ptr1) {
150 ; P9LE-LABEL: s2v_test5:
151 ; P9LE: # %bb.0: # %entry
152 ; P9LE-NEXT: lfd f0, 0(r5)
153 ; P9LE-NEXT: xxmrghd v2, v2, vs0
156 ; P9BE-LABEL: s2v_test5:
157 ; P9BE: # %bb.0: # %entry
158 ; P9BE-NEXT: lfd f0, 0(r5)
159 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
162 ; P8LE-LABEL: s2v_test5:
163 ; P8LE: # %bb.0: # %entry
164 ; P8LE-NEXT: lfdx f0, 0, r5
165 ; P8LE-NEXT: xxmrghd v2, v2, vs0
168 ; P8BE-LABEL: s2v_test5:
169 ; P8BE: # %bb.0: # %entry
170 ; P8BE-NEXT: lfdx f0, 0, r5
171 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
175 %0 = load i64, ptr %ptr1, align 8
176 %vecins = insertelement <2 x i64> %vec, i64 %0, i32 0
177 ret <2 x i64> %vecins
180 ; Function Attrs: norecurse nounwind readonly
181 define <2 x double> @s2v_test_f1(ptr nocapture readonly %f64, <2 x double> %vec) {
182 ; P9LE-LABEL: s2v_test_f1:
183 ; P9LE: # %bb.0: # %entry
184 ; P9LE-NEXT: lfd f0, 0(r3)
185 ; P9LE-NEXT: xxmrghd v2, v2, vs0
188 ; P9BE-LABEL: s2v_test_f1:
189 ; P9BE: # %bb.0: # %entry
190 ; P9BE-NEXT: lfd f0, 0(r3)
191 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
194 ; P8LE-LABEL: s2v_test_f1:
195 ; P8LE: # %bb.0: # %entry
196 ; P8LE-NEXT: lfd f0, 0(r3)
197 ; P8LE-NEXT: xxmrghd v2, v2, vs0
200 ; P8BE-LABEL: s2v_test_f1:
201 ; P8BE: # %bb.0: # %entry
202 ; P8BE-NEXT: lfd f0, 0(r3)
203 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
209 %0 = load double, ptr %f64, align 8
210 %vecins = insertelement <2 x double> %vec, double %0, i32 0
211 ret <2 x double> %vecins
214 ; Function Attrs: norecurse nounwind readonly
215 define <2 x double> @s2v_test_f2(ptr nocapture readonly %f64, <2 x double> %vec) {
216 ; P9LE-LABEL: s2v_test_f2:
217 ; P9LE: # %bb.0: # %entry
218 ; P9LE-NEXT: lfd f0, 8(r3)
219 ; P9LE-NEXT: xxmrghd v2, v2, vs0
222 ; P9BE-LABEL: s2v_test_f2:
223 ; P9BE: # %bb.0: # %entry
224 ; P9BE-NEXT: lfd f0, 8(r3)
225 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
228 ; P8LE-LABEL: s2v_test_f2:
229 ; P8LE: # %bb.0: # %entry
230 ; P8LE-NEXT: lfd f0, 8(r3)
231 ; P8LE-NEXT: xxmrghd v2, v2, vs0
234 ; P8BE-LABEL: s2v_test_f2:
235 ; P8BE: # %bb.0: # %entry
236 ; P8BE-NEXT: lfd f0, 8(r3)
237 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
243 %arrayidx = getelementptr inbounds double, ptr %f64, i64 1
244 %0 = load double, ptr %arrayidx, align 8
245 %vecins = insertelement <2 x double> %vec, double %0, i32 0
246 ret <2 x double> %vecins
249 ; Function Attrs: norecurse nounwind readonly
250 define <2 x double> @s2v_test_f3(ptr nocapture readonly %f64, <2 x double> %vec, i32 signext %Idx) {
251 ; P9LE-LABEL: s2v_test_f3:
252 ; P9LE: # %bb.0: # %entry
253 ; P9LE-NEXT: sldi r4, r7, 3
254 ; P9LE-NEXT: lfdx f0, r3, r4
255 ; P9LE-NEXT: xxmrghd v2, v2, vs0
258 ; P9BE-LABEL: s2v_test_f3:
259 ; P9BE: # %bb.0: # %entry
260 ; P9BE-NEXT: sldi r4, r7, 3
261 ; P9BE-NEXT: lfdx f0, r3, r4
262 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
265 ; P8LE-LABEL: s2v_test_f3:
266 ; P8LE: # %bb.0: # %entry
267 ; P8LE-NEXT: sldi r4, r7, 3
268 ; P8LE-NEXT: lfdx f0, r3, r4
269 ; P8LE-NEXT: xxmrghd v2, v2, vs0
272 ; P8BE-LABEL: s2v_test_f3:
273 ; P8BE: # %bb.0: # %entry
274 ; P8BE-NEXT: sldi r4, r7, 3
275 ; P8BE-NEXT: lfdx f0, r3, r4
276 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
282 %idxprom = sext i32 %Idx to i64
283 %arrayidx = getelementptr inbounds double, ptr %f64, i64 %idxprom
284 %0 = load double, ptr %arrayidx, align 8
285 %vecins = insertelement <2 x double> %vec, double %0, i32 0
286 ret <2 x double> %vecins
289 ; Function Attrs: norecurse nounwind readonly
290 define <2 x double> @s2v_test_f4(ptr nocapture readonly %f64, <2 x double> %vec) {
291 ; P9LE-LABEL: s2v_test_f4:
292 ; P9LE: # %bb.0: # %entry
293 ; P9LE-NEXT: lfd f0, 8(r3)
294 ; P9LE-NEXT: xxmrghd v2, v2, vs0
297 ; P9BE-LABEL: s2v_test_f4:
298 ; P9BE: # %bb.0: # %entry
299 ; P9BE-NEXT: lfd f0, 8(r3)
300 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
303 ; P8LE-LABEL: s2v_test_f4:
304 ; P8LE: # %bb.0: # %entry
305 ; P8LE-NEXT: lfd f0, 8(r3)
306 ; P8LE-NEXT: xxmrghd v2, v2, vs0
309 ; P8BE-LABEL: s2v_test_f4:
310 ; P8BE: # %bb.0: # %entry
311 ; P8BE-NEXT: lfd f0, 8(r3)
312 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
318 %arrayidx = getelementptr inbounds double, ptr %f64, i64 1
319 %0 = load double, ptr %arrayidx, align 8
320 %vecins = insertelement <2 x double> %vec, double %0, i32 0
321 ret <2 x double> %vecins
324 ; Function Attrs: norecurse nounwind readonly
325 define <2 x double> @s2v_test_f5(<2 x double> %vec, ptr nocapture readonly %ptr1) {
326 ; P9LE-LABEL: s2v_test_f5:
327 ; P9LE: # %bb.0: # %entry
328 ; P9LE-NEXT: lfd f0, 0(r5)
329 ; P9LE-NEXT: xxmrghd v2, v2, vs0
332 ; P9BE-LABEL: s2v_test_f5:
333 ; P9BE: # %bb.0: # %entry
334 ; P9BE-NEXT: lfd f0, 0(r5)
335 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
338 ; P8LE-LABEL: s2v_test_f5:
339 ; P8LE: # %bb.0: # %entry
340 ; P8LE-NEXT: lfd f0, 0(r5)
341 ; P8LE-NEXT: xxmrghd v2, v2, vs0
344 ; P8BE-LABEL: s2v_test_f5:
345 ; P8BE: # %bb.0: # %entry
346 ; P8BE-NEXT: lfd f0, 0(r5)
347 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
353 %0 = load double, ptr %ptr1, align 8
354 %vecins = insertelement <2 x double> %vec, double %0, i32 0
355 ret <2 x double> %vecins