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
10 ; Function Attrs: norecurse nounwind readonly
11 define <2 x i64> @s2v_test1(i32* nocapture readonly %int32, <2 x i64> %vec) {
12 ; P9LE-LABEL: s2v_test1:
13 ; P9LE: # %bb.0: # %entry
14 ; P9LE-NEXT: lfiwax f0, 0, r3
15 ; P9LE-NEXT: xxpermdi v3, f0, f0, 2
16 ; P9LE-NEXT: xxpermdi v2, v2, v3, 1
19 ; P9BE-LABEL: s2v_test1:
20 ; P9BE: # %bb.0: # %entry
21 ; P9BE-NEXT: lfiwax f0, 0, r3
22 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
25 ; P8LE-LABEL: s2v_test1:
26 ; P8LE: # %bb.0: # %entry
27 ; P8LE-NEXT: lfiwax f0, 0, r3
28 ; P8LE-NEXT: xxpermdi v3, f0, f0, 2
29 ; P8LE-NEXT: xxpermdi v2, v2, v3, 1
32 ; P8BE-LABEL: s2v_test1:
33 ; P8BE: # %bb.0: # %entry
34 ; P8BE-NEXT: lfiwax f0, 0, r3
35 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
38 %0 = load i32, i32* %int32, align 4
39 %conv = sext i32 %0 to i64
40 %vecins = insertelement <2 x i64> %vec, i64 %conv, i32 0
44 ; Function Attrs: norecurse nounwind readonly
45 define <2 x i64> @s2v_test2(i32* nocapture readonly %int32, <2 x i64> %vec) {
46 ; P9LE-LABEL: s2v_test2:
47 ; P9LE: # %bb.0: # %entry
48 ; P9LE-NEXT: addi r3, r3, 4
49 ; P9LE-NEXT: lfiwax f0, 0, r3
50 ; P9LE-NEXT: xxpermdi v3, f0, f0, 2
51 ; P9LE-NEXT: xxpermdi v2, v2, v3, 1
54 ; P9BE-LABEL: s2v_test2:
55 ; P9BE: # %bb.0: # %entry
56 ; P9BE-NEXT: addi r3, r3, 4
57 ; P9BE-NEXT: lfiwax f0, 0, r3
58 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
61 ; P8LE-LABEL: s2v_test2:
62 ; P8LE: # %bb.0: # %entry
63 ; P8LE-NEXT: addi r3, r3, 4
64 ; P8LE-NEXT: lfiwax f0, 0, r3
65 ; P8LE-NEXT: xxpermdi v3, f0, f0, 2
66 ; P8LE-NEXT: xxpermdi v2, v2, v3, 1
69 ; P8BE-LABEL: s2v_test2:
70 ; P8BE: # %bb.0: # %entry
71 ; P8BE-NEXT: addi r3, r3, 4
72 ; P8BE-NEXT: lfiwax f0, 0, r3
73 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
76 %arrayidx = getelementptr inbounds i32, i32* %int32, i64 1
77 %0 = load i32, i32* %arrayidx, align 4
78 %conv = sext i32 %0 to i64
79 %vecins = insertelement <2 x i64> %vec, i64 %conv, i32 0
83 ; Function Attrs: norecurse nounwind readonly
84 define <2 x i64> @s2v_test3(i32* nocapture readonly %int32, <2 x i64> %vec, i32 signext %Idx) {
85 ; P9LE-LABEL: s2v_test3:
86 ; P9LE: # %bb.0: # %entry
87 ; P9LE-NEXT: sldi r4, r7, 2
88 ; P9LE-NEXT: lfiwax f0, r3, r4
89 ; P9LE-NEXT: xxpermdi v3, f0, f0, 2
90 ; P9LE-NEXT: xxpermdi v2, v2, v3, 1
93 ; P9BE-LABEL: s2v_test3:
94 ; P9BE: # %bb.0: # %entry
95 ; P9BE-NEXT: sldi r4, r7, 2
96 ; P9BE-NEXT: lfiwax f0, r3, r4
97 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
100 ; P8LE-LABEL: s2v_test3:
101 ; P8LE: # %bb.0: # %entry
102 ; P8LE-NEXT: sldi r4, r7, 2
103 ; P8LE-NEXT: lfiwax f0, r3, r4
104 ; P8LE-NEXT: xxpermdi v3, f0, f0, 2
105 ; P8LE-NEXT: xxpermdi v2, v2, v3, 1
108 ; P8BE-LABEL: s2v_test3:
109 ; P8BE: # %bb.0: # %entry
110 ; P8BE-NEXT: sldi r4, r7, 2
111 ; P8BE-NEXT: lfiwax f0, r3, r4
112 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
115 %idxprom = sext i32 %Idx to i64
116 %arrayidx = getelementptr inbounds i32, i32* %int32, i64 %idxprom
117 %0 = load i32, i32* %arrayidx, align 4
118 %conv = sext i32 %0 to i64
119 %vecins = insertelement <2 x i64> %vec, i64 %conv, i32 0
120 ret <2 x i64> %vecins
123 ; Function Attrs: norecurse nounwind readonly
124 define <2 x i64> @s2v_test4(i32* nocapture readonly %int32, <2 x i64> %vec) {
125 ; P9LE-LABEL: s2v_test4:
126 ; P9LE: # %bb.0: # %entry
127 ; P9LE-NEXT: addi r3, r3, 4
128 ; P9LE-NEXT: lfiwax f0, 0, r3
129 ; P9LE-NEXT: xxpermdi v3, f0, f0, 2
130 ; P9LE-NEXT: xxpermdi v2, v2, v3, 1
133 ; P9BE-LABEL: s2v_test4:
134 ; P9BE: # %bb.0: # %entry
135 ; P9BE-NEXT: addi r3, r3, 4
136 ; P9BE-NEXT: lfiwax f0, 0, r3
137 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
140 ; P8LE-LABEL: s2v_test4:
141 ; P8LE: # %bb.0: # %entry
142 ; P8LE-NEXT: addi r3, r3, 4
143 ; P8LE-NEXT: lfiwax f0, 0, r3
144 ; P8LE-NEXT: xxpermdi v3, f0, f0, 2
145 ; P8LE-NEXT: xxpermdi v2, v2, v3, 1
148 ; P8BE-LABEL: s2v_test4:
149 ; P8BE: # %bb.0: # %entry
150 ; P8BE-NEXT: addi r3, r3, 4
151 ; P8BE-NEXT: lfiwax f0, 0, r3
152 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
155 %arrayidx = getelementptr inbounds i32, i32* %int32, i64 1
156 %0 = load i32, i32* %arrayidx, align 4
157 %conv = sext i32 %0 to i64
158 %vecins = insertelement <2 x i64> %vec, i64 %conv, i32 0
159 ret <2 x i64> %vecins
162 ; Function Attrs: norecurse nounwind readonly
163 define <2 x i64> @s2v_test5(<2 x i64> %vec, i32* nocapture readonly %ptr1) {
164 ; P9LE-LABEL: s2v_test5:
165 ; P9LE: # %bb.0: # %entry
166 ; P9LE-NEXT: lfiwax f0, 0, r5
167 ; P9LE-NEXT: xxpermdi v3, f0, f0, 2
168 ; P9LE-NEXT: xxpermdi v2, v2, v3, 1
171 ; P9BE-LABEL: s2v_test5:
172 ; P9BE: # %bb.0: # %entry
173 ; P9BE-NEXT: lfiwax f0, 0, r5
174 ; P9BE-NEXT: xxpermdi v2, vs0, v2, 1
177 ; P8LE-LABEL: s2v_test5:
178 ; P8LE: # %bb.0: # %entry
179 ; P8LE-NEXT: lfiwax f0, 0, r5
180 ; P8LE-NEXT: xxpermdi v3, f0, f0, 2
181 ; P8LE-NEXT: xxpermdi v2, v2, v3, 1
184 ; P8BE-LABEL: s2v_test5:
185 ; P8BE: # %bb.0: # %entry
186 ; P8BE-NEXT: lfiwax f0, 0, r5
187 ; P8BE-NEXT: xxpermdi v2, vs0, v2, 1
190 %0 = load i32, i32* %ptr1, align 4
191 %conv = sext i32 %0 to i64
192 %vecins = insertelement <2 x i64> %vec, i64 %conv, i32 0
193 ret <2 x i64> %vecins
196 ; Function Attrs: norecurse nounwind readonly
197 define <2 x i64> @s2v_test6(i32* nocapture readonly %ptr) {
198 ; P9LE-LABEL: s2v_test6:
199 ; P9LE: # %bb.0: # %entry
200 ; P9LE-NEXT: lfiwax f0, 0, r3
201 ; P9LE-NEXT: xxpermdi v2, f0, f0, 2
202 ; P9LE-NEXT: xxspltd v2, v2, 1
205 ; P9BE-LABEL: s2v_test6:
206 ; P9BE: # %bb.0: # %entry
207 ; P9BE-NEXT: lfiwax f0, 0, r3
208 ; P9BE-NEXT: xxspltd v2, vs0, 0
211 ; P8LE-LABEL: s2v_test6:
212 ; P8LE: # %bb.0: # %entry
213 ; P8LE-NEXT: lfiwax f0, 0, r3
214 ; P8LE-NEXT: xxpermdi v2, f0, f0, 2
215 ; P8LE-NEXT: xxspltd v2, v2, 1
218 ; P8BE-LABEL: s2v_test6:
219 ; P8BE: # %bb.0: # %entry
220 ; P8BE-NEXT: lfiwax f0, 0, r3
221 ; P8BE-NEXT: xxspltd v2, vs0, 0
224 %0 = load i32, i32* %ptr, align 4
225 %conv = sext i32 %0 to i64
226 %splat.splatinsert = insertelement <2 x i64> undef, i64 %conv, i32 0
227 %splat.splat = shufflevector <2 x i64> %splat.splatinsert, <2 x i64> undef, <2 x i32> zeroinitializer
228 ret <2 x i64> %splat.splat
231 ; Function Attrs: norecurse nounwind readonly
232 define <2 x i64> @s2v_test7(i32* nocapture readonly %ptr) {
233 ; P9LE-LABEL: s2v_test7:
234 ; P9LE: # %bb.0: # %entry
235 ; P9LE-NEXT: lfiwax f0, 0, r3
236 ; P9LE-NEXT: xxpermdi v2, f0, f0, 2
237 ; P9LE-NEXT: xxspltd v2, v2, 1
240 ; P9BE-LABEL: s2v_test7:
241 ; P9BE: # %bb.0: # %entry
242 ; P9BE-NEXT: lfiwax f0, 0, r3
243 ; P9BE-NEXT: xxspltd v2, vs0, 0
246 ; P8LE-LABEL: s2v_test7:
247 ; P8LE: # %bb.0: # %entry
248 ; P8LE-NEXT: lfiwax f0, 0, r3
249 ; P8LE-NEXT: xxpermdi v2, f0, f0, 2
250 ; P8LE-NEXT: xxspltd v2, v2, 1
253 ; P8BE-LABEL: s2v_test7:
254 ; P8BE: # %bb.0: # %entry
255 ; P8BE-NEXT: lfiwax f0, 0, r3
256 ; P8BE-NEXT: xxspltd v2, vs0, 0
259 %0 = load i32, i32* %ptr, align 4
260 %conv = sext i32 %0 to i64
261 %splat.splatinsert = insertelement <2 x i64> undef, i64 %conv, i32 0
262 %splat.splat = shufflevector <2 x i64> %splat.splatinsert, <2 x i64> undef, <2 x i32> zeroinitializer
263 ret <2 x i64> %splat.splat