1 ; RUN: llc -mcpu=pwr9 -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \
2 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s --check-prefix=P9LE
3 ; RUN: llc -mcpu=pwr9 -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \
4 ; RUN: -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s --check-prefix=P9BE
5 ; RUN: llc -mcpu=pwr8 -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \
6 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s --check-prefix=P8LE
7 ; RUN: llc -mcpu=pwr8 -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \
8 ; RUN: -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s --check-prefix=P8BE
11 ; Function Attrs: norecurse nounwind readonly
12 define <2 x i64> @s2v_test1(i64* nocapture readonly %int64, <2 x i64> %vec) {
13 ; P9LE-LABEL: s2v_test1:
14 ; P9LE: # %bb.0: # %entry
15 ; P9LE-NEXT: lfd f0, 0(r3)
16 ; P9LE-NEXT: xxpermdi v3, f0, f0, 2
17 ; P9LE-NEXT: xxpermdi v2, v2, v3, 1
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 %0 = load i64, i64* %int64, align 8
27 %vecins = insertelement <2 x i64> %vec, i64 %0, i32 0
31 ; Function Attrs: norecurse nounwind readonly
32 define <2 x i64> @s2v_test2(i64* nocapture readonly %int64, <2 x i64> %vec) {
33 ; P9LE-LABEL: s2v_test2:
34 ; P9LE: # %bb.0: # %entry
35 ; P9LE-NEXT: lfd f0, 8(r3)
36 ; P9LE-NEXT: xxpermdi v3, f0, f0, 2
37 ; P9LE-NEXT: xxpermdi v2, v2, v3, 1
40 ; P9BE-LABEL: s2v_test2:
41 ; P9BE: # %bb.0: # %entry
42 ; P9BE-NEXT: lfd f0, 8(r3)
43 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
46 %arrayidx = getelementptr inbounds i64, i64* %int64, i64 1
47 %0 = load i64, i64* %arrayidx, align 8
48 %vecins = insertelement <2 x i64> %vec, i64 %0, i32 0
52 ; Function Attrs: norecurse nounwind readonly
53 define <2 x i64> @s2v_test3(i64* nocapture readonly %int64, <2 x i64> %vec, i32 signext %Idx) {
54 ; P9LE-LABEL: s2v_test3:
55 ; P9LE: # %bb.0: # %entry
56 ; P9LE-NEXT: sldi r4, r7, 3
57 ; P9LE-NEXT: lfdx f0, r3, r4
58 ; P9LE-NEXT: xxpermdi v3, f0, f0, 2
59 ; P9LE-NEXT: xxpermdi v2, v2, v3, 1
62 ; P9BE-LABEL: s2v_test3
63 ; P9BE: # %bb.0: # %entry
64 ; P9BE-NEXT: sldi r4, r7, 3
65 ; P9BE-NEXT: lfdx f0, r3, r4
66 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
69 %idxprom = sext i32 %Idx to i64
70 %arrayidx = getelementptr inbounds i64, i64* %int64, i64 %idxprom
71 %0 = load i64, i64* %arrayidx, align 8
72 %vecins = insertelement <2 x i64> %vec, i64 %0, i32 0
76 ; Function Attrs: norecurse nounwind readonly
77 define <2 x i64> @s2v_test4(i64* nocapture readonly %int64, <2 x i64> %vec) {
78 ; P9LE-LABEL: s2v_test4:
79 ; P9LE: # %bb.0: # %entry
80 ; P9LE-NEXT: lfd f0, 8(r3)
81 ; P9LE-NEXT: xxpermdi v3, f0, f0, 2
82 ; P9LE-NEXT: xxpermdi v2, v2, v3, 1
85 ; P9BE-LABEL: s2v_test4:
86 ; P9BE: # %bb.0: # %entry
87 ; P9BE-NEXT: lfd f0, 8(r3)
88 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
91 %arrayidx = getelementptr inbounds i64, i64* %int64, i64 1
92 %0 = load i64, i64* %arrayidx, align 8
93 %vecins = insertelement <2 x i64> %vec, i64 %0, i32 0
97 ; Function Attrs: norecurse nounwind readonly
98 define <2 x i64> @s2v_test5(<2 x i64> %vec, i64* nocapture readonly %ptr1) {
99 ; P9LE-LABEL: s2v_test5:
100 ; P9LE: # %bb.0: # %entry
101 ; P9LE-NEXT: lfd f0, 0(r5)
102 ; P9LE-NEXT: xxpermdi v3, f0, f0, 2
103 ; P9LE-NEXT: xxpermdi v2, v2, v3, 1
106 ; P9BE-LABEL: s2v_test5:
107 ; P9BE: # %bb.0: # %entry
108 ; P9BE-NEXT: lfd f0, 0(r5)
109 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
112 %0 = load i64, i64* %ptr1, align 8
113 %vecins = insertelement <2 x i64> %vec, i64 %0, i32 0
114 ret <2 x i64> %vecins
117 ; Function Attrs: norecurse nounwind readonly
118 define <2 x double> @s2v_test_f1(double* nocapture readonly %f64, <2 x double> %vec) {
119 ; P9LE-LABEL: s2v_test_f1:
120 ; P9LE: # %bb.0: # %entry
121 ; P9LE-NEXT: lfd f0, 0(r3)
122 ; P9LE-NEXT: xxpermdi vs0, f0, f0, 2
123 ; P9LE-NEXT: xxpermdi v2, v2, vs0, 1
126 ; P9BE-LABEL: s2v_test_f1:
127 ; P9BE: # %bb.0: # %entry
128 ; P9BE-NEXT: lfd f0, 0(r3)
129 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
132 ; P8LE-LABEL: s2v_test_f1:
133 ; P8LE: # %bb.0: # %entry
134 ; P8LE-NEXT: lfdx f0, 0, r3
135 ; P8LE-NEXT: xxspltd vs0, vs0, 0
136 ; P8LE-NEXT: xxpermdi v2, v2, vs0, 1
139 ; P8BE-LABEL: s2v_test_f1:
140 ; P8BE: # %bb.0: # %entry
141 ; P8BE-NEXT: lfdx f0, 0, r3
142 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
145 %0 = load double, double* %f64, align 8
146 %vecins = insertelement <2 x double> %vec, double %0, i32 0
147 ret <2 x double> %vecins
150 ; Function Attrs: norecurse nounwind readonly
151 define <2 x double> @s2v_test_f2(double* nocapture readonly %f64, <2 x double> %vec) {
152 ; P9LE-LABEL: s2v_test_f2:
153 ; P9LE: # %bb.0: # %entry
154 ; P9LE-NEXT: lfd f0, 8(r3)
155 ; P9LE-NEXT: xxpermdi vs0, f0, f0, 2
156 ; P9LE-NEXT: xxpermdi v2, v2, vs0, 1
159 ; P9BE-LABEL: s2v_test_f2:
160 ; P9BE: # %bb.0: # %entry
161 ; P9BE-NEXT: lfd f0, 8(r3)
162 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
165 ; P8LE-LABEL: s2v_test_f2:
166 ; P8LE: # %bb.0: # %entry
167 ; P8LE-NEXT: lfd f0, 8(r3)
168 ; P8LE-NEXT: xxspltd vs0, vs0, 0
169 ; P8LE-NEXT: xxpermdi v2, v2, vs0, 1
172 ; P8BE-LABEL: s2v_test_f2:
173 ; P8BE: # %bb.0: # %entry
174 ; P8BE-NEXT: lfd f0, 8(r3)
175 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
178 %arrayidx = getelementptr inbounds double, double* %f64, i64 1
179 %0 = load double, double* %arrayidx, align 8
180 %vecins = insertelement <2 x double> %vec, double %0, i32 0
181 ret <2 x double> %vecins
184 ; Function Attrs: norecurse nounwind readonly
185 define <2 x double> @s2v_test_f3(double* nocapture readonly %f64, <2 x double> %vec, i32 signext %Idx) {
186 ; P9LE-LABEL: s2v_test_f3:
187 ; P9LE: # %bb.0: # %entry
188 ; P9LE-NEXT: sldi r4, r7, 3
189 ; P9LE-NEXT: lfdx f0, r3, r4
190 ; P9LE-NEXT: xxpermdi vs0, f0, f0, 2
191 ; P9LE-NEXT: xxpermdi v2, v2, vs0, 1
194 ; P9BE-LABEL: s2v_test_f3:
195 ; P9BE: # %bb.0: # %entry
196 ; P9BE-NEXT: sldi r4, r7, 3
197 ; P9BE-NEXT: lfdx f0, r3, r4
198 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
201 ; P8LE-LABEL: s2v_test_f3:
202 ; P8LE: # %bb.0: # %entry
203 ; P8LE-NEXT: sldi r4, r7, 3
204 ; P8LE-NEXT: lfdx f0, r3, r4
205 ; P8LE-NEXT: xxspltd vs0, vs0, 0
206 ; P8LE-NEXT: xxpermdi v2, v2, vs0, 1
209 ; P8BE-LABEL: s2v_test_f3:
210 ; P8BE: # %bb.0: # %entry
211 ; P8BE-NEXT: sldi r4, r7, 3
212 ; P8BE-NEXT: lfdx f0, r3, r4
213 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
216 %idxprom = sext i32 %Idx to i64
217 %arrayidx = getelementptr inbounds double, double* %f64, i64 %idxprom
218 %0 = load double, double* %arrayidx, align 8
219 %vecins = insertelement <2 x double> %vec, double %0, i32 0
220 ret <2 x double> %vecins
223 ; Function Attrs: norecurse nounwind readonly
224 define <2 x double> @s2v_test_f4(double* nocapture readonly %f64, <2 x double> %vec) {
225 ; P9LE-LABEL: s2v_test_f4:
226 ; P9LE: # %bb.0: # %entry
227 ; P9LE-NEXT: lfd f0, 8(r3)
228 ; P9LE-NEXT: xxpermdi vs0, f0, f0, 2
229 ; P9LE-NEXT: xxpermdi v2, v2, vs0, 1
232 ; P9BE-LABEL: s2v_test_f4:
233 ; P9BE: # %bb.0: # %entry
234 ; P9BE-NEXT: lfd f0, 8(r3)
235 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
238 ; P8LE-LABEL: s2v_test_f4:
239 ; P8LE: # %bb.0: # %entry
240 ; P8LE-NEXT: lfd f0, 8(r3)
241 ; P8LE-NEXT: xxspltd vs0, vs0, 0
242 ; P8LE-NEXT: xxpermdi v2, v2, vs0, 1
245 ; P8BE-LABEL: s2v_test_f4:
246 ; P8BE: # %bb.0: # %entry
247 ; P8BE-NEXT: lfd f0, 8(r3)
248 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
251 %arrayidx = getelementptr inbounds double, double* %f64, i64 1
252 %0 = load double, double* %arrayidx, align 8
253 %vecins = insertelement <2 x double> %vec, double %0, i32 0
254 ret <2 x double> %vecins
257 ; Function Attrs: norecurse nounwind readonly
258 define <2 x double> @s2v_test_f5(<2 x double> %vec, double* nocapture readonly %ptr1) {
259 ; P9LE-LABEL: s2v_test_f5:
260 ; P9LE: # %bb.0: # %entry
261 ; P9LE-NEXT: lfd f0, 0(r5)
262 ; P9LE-NEXT: xxpermdi vs0, f0, f0, 2
263 ; P9LE-NEXT: xxpermdi v2, v2, vs0, 1
266 ; P9BE-LABEL: s2v_test_f5:
267 ; P9BE: # %bb.0: # %entry
268 ; P9BE-NEXT: lfd f0, 0(r5)
269 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
272 ; P8LE-LABEL: s2v_test_f5:
273 ; P8LE: # %bb.0: # %entry
274 ; P8LE-NEXT: lfdx f0, 0, r5
275 ; P8LE-NEXT: xxspltd vs0, vs0, 0
276 ; P8LE-NEXT: xxpermdi v2, v2, vs0, 1
279 ; P8BE-LABEL: s2v_test_f5:
280 ; P8BE: # %bb.0: # %entry
281 ; P8BE-NEXT: lfdx f0, 0, r5
282 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
285 %0 = load double, double* %ptr1, align 8
286 %vecins = insertelement <2 x double> %vec, double %0, i32 0
287 ret <2 x double> %vecins