1 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -x86-experimental-vector-shuffle-lowering | FileCheck %s --check-prefix=ALL --check-prefix=SSE2
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -mattr=+sse3 -x86-experimental-vector-shuffle-lowering | FileCheck %s --check-prefix=ALL --check-prefix=SSE3
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -mattr=+ssse3 -x86-experimental-vector-shuffle-lowering | FileCheck %s --check-prefix=ALL --check-prefix=SSSE3
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -mattr=+sse4.1 -x86-experimental-vector-shuffle-lowering | FileCheck %s --check-prefix=ALL --check-prefix=SSE41
6 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
7 target triple = "x86_64-unknown-unknown"
9 define <2 x i64> @shuffle_v2i64_00(<2 x i64> %a, <2 x i64> %b) {
10 ; ALL-LABEL: @shuffle_v2i64_00
11 ; ALL: pshufd {{.*}} # xmm0 = xmm0[0,1,0,1]
13 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 0, i32 0>
14 ret <2 x i64> %shuffle
16 define <2 x i64> @shuffle_v2i64_10(<2 x i64> %a, <2 x i64> %b) {
17 ; ALL-LABEL: @shuffle_v2i64_10
18 ; ALL: pshufd {{.*}} # xmm0 = xmm0[2,3,0,1]
20 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 1, i32 0>
21 ret <2 x i64> %shuffle
23 define <2 x i64> @shuffle_v2i64_11(<2 x i64> %a, <2 x i64> %b) {
24 ; ALL-LABEL: @shuffle_v2i64_11
25 ; ALL: pshufd {{.*}} # xmm0 = xmm0[2,3,2,3]
27 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 1, i32 1>
28 ret <2 x i64> %shuffle
30 define <2 x i64> @shuffle_v2i64_22(<2 x i64> %a, <2 x i64> %b) {
31 ; ALL-LABEL: @shuffle_v2i64_22
32 ; ALL: pshufd {{.*}} # xmm0 = xmm1[0,1,0,1]
34 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 2, i32 2>
35 ret <2 x i64> %shuffle
37 define <2 x i64> @shuffle_v2i64_32(<2 x i64> %a, <2 x i64> %b) {
38 ; ALL-LABEL: @shuffle_v2i64_32
39 ; ALL: pshufd {{.*}} # xmm0 = xmm1[2,3,0,1]
41 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 3, i32 2>
42 ret <2 x i64> %shuffle
44 define <2 x i64> @shuffle_v2i64_33(<2 x i64> %a, <2 x i64> %b) {
45 ; ALL-LABEL: @shuffle_v2i64_33
46 ; ALL: pshufd {{.*}} # xmm0 = xmm1[2,3,2,3]
48 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 3, i32 3>
49 ret <2 x i64> %shuffle
52 define <2 x double> @shuffle_v2f64_00(<2 x double> %a, <2 x double> %b) {
53 ; SSE2-LABEL: @shuffle_v2f64_00
54 ; SSE2: movlhps {{.*}} # xmm0 = xmm0[0,0]
57 ; SSE3-LABEL: @shuffle_v2f64_00
58 ; SSE3: unpcklpd {{.*}} # xmm0 = xmm0[0,0]
61 ; SSSE3-LABEL: @shuffle_v2f64_00
62 ; SSSE3: unpcklpd {{.*}} # xmm0 = xmm0[0,0]
65 ; SSE41-LABEL: @shuffle_v2f64_00
66 ; SSE41: unpcklpd {{.*}} # xmm0 = xmm0[0,0]
68 %shuffle = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 0, i32 0>
69 ret <2 x double> %shuffle
71 define <2 x double> @shuffle_v2f64_10(<2 x double> %a, <2 x double> %b) {
72 ; ALL-LABEL: @shuffle_v2f64_10
73 ; ALL: shufpd {{.*}} # xmm0 = xmm0[1,0]
75 %shuffle = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 1, i32 0>
76 ret <2 x double> %shuffle
78 define <2 x double> @shuffle_v2f64_11(<2 x double> %a, <2 x double> %b) {
79 ; ALL-LABEL: @shuffle_v2f64_11
80 ; ALL: movhlps {{.*}} # xmm0 = xmm0[1,1]
82 %shuffle = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 1, i32 1>
83 ret <2 x double> %shuffle
85 define <2 x double> @shuffle_v2f64_22(<2 x double> %a, <2 x double> %b) {
86 ; SSE2-LABEL: @shuffle_v2f64_22
87 ; SSE2: movlhps {{.*}} # xmm1 = xmm1[0,0]
88 ; SSE2-NEXT: movaps %xmm1, %xmm0
91 ; SSE3-LABEL: @shuffle_v2f64_22
92 ; SSE3: unpcklpd {{.*}} # xmm1 = xmm1[0,0]
93 ; SSE3-NEXT: movapd %xmm1, %xmm0
96 ; SSSE3-LABEL: @shuffle_v2f64_22
97 ; SSSE3: unpcklpd {{.*}} # xmm1 = xmm1[0,0]
98 ; SSSE3-NEXT: movapd %xmm1, %xmm0
101 ; SSE41-LABEL: @shuffle_v2f64_22
102 ; SSE41: unpcklpd {{.*}} # xmm1 = xmm1[0,0]
103 ; SSE41-NEXT: movapd %xmm1, %xmm0
105 %shuffle = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 2, i32 2>
106 ret <2 x double> %shuffle
108 define <2 x double> @shuffle_v2f64_32(<2 x double> %a, <2 x double> %b) {
109 ; ALL-LABEL: @shuffle_v2f64_32
110 ; ALL: pshufd {{.*}} # xmm0 = xmm1[2,3,0,1]
112 %shuffle = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 3, i32 2>
113 ret <2 x double> %shuffle
115 define <2 x double> @shuffle_v2f64_33(<2 x double> %a, <2 x double> %b) {
116 ; ALL-LABEL: @shuffle_v2f64_33
117 ; ALL: movhlps {{.*}} # xmm1 = xmm1[1,1]
118 ; ALL-NEXT: movaps %xmm1, %xmm0
120 %shuffle = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 3, i32 3>
121 ret <2 x double> %shuffle
123 define <2 x double> @shuffle_v2f64_03(<2 x double> %a, <2 x double> %b) {
124 ; SSE2-LABEL: @shuffle_v2f64_03
125 ; SSE2: shufpd {{.*}} # xmm0 = xmm0[0],xmm1[1]
128 ; SSE3-LABEL: @shuffle_v2f64_03
129 ; SSE3: shufpd {{.*}} # xmm0 = xmm0[0],xmm1[1]
132 ; SSSE3-LABEL: @shuffle_v2f64_03
133 ; SSSE3: shufpd {{.*}} # xmm0 = xmm0[0],xmm1[1]
136 ; SSE41-LABEL: @shuffle_v2f64_03
137 ; SSE41: blendpd {{.*}} # xmm0 = xmm0[0],xmm1[1]
139 %shuffle = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 0, i32 3>
140 ret <2 x double> %shuffle
142 define <2 x double> @shuffle_v2f64_21(<2 x double> %a, <2 x double> %b) {
143 ; SSE2-LABEL: @shuffle_v2f64_21
144 ; SSE2: shufpd {{.*}} # xmm1 = xmm1[0],xmm0[1]
145 ; SSE2-NEXT: movapd %xmm1, %xmm0
148 ; SSE3-LABEL: @shuffle_v2f64_21
149 ; SSE3: shufpd {{.*}} # xmm1 = xmm1[0],xmm0[1]
150 ; SSE3-NEXT: movapd %xmm1, %xmm0
153 ; SSSE3-LABEL: @shuffle_v2f64_21
154 ; SSSE3: shufpd {{.*}} # xmm1 = xmm1[0],xmm0[1]
155 ; SSSE3-NEXT: movapd %xmm1, %xmm0
158 ; SSE41-LABEL: @shuffle_v2f64_21
159 ; SSE41: blendpd {{.*}} # xmm1 = xmm1[0],xmm0[1]
160 ; SSE41-NEXT: movapd %xmm1, %xmm0
162 %shuffle = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 2, i32 1>
163 ret <2 x double> %shuffle
167 define <2 x i64> @shuffle_v2i64_02(<2 x i64> %a, <2 x i64> %b) {
168 ; ALL-LABEL: @shuffle_v2i64_02
169 ; ALL: punpcklqdq {{.*}} # xmm0 = xmm0[0],xmm1[0]
171 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 0, i32 2>
172 ret <2 x i64> %shuffle
174 define <2 x i64> @shuffle_v2i64_02_copy(<2 x i64> %nonce, <2 x i64> %a, <2 x i64> %b) {
175 ; ALL-LABEL: @shuffle_v2i64_02_copy
176 ; ALL: punpcklqdq {{.*}} # xmm1 = xmm1[0],xmm2[0]
177 ; ALL-NEXT: movdqa %xmm1, %xmm0
179 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 0, i32 2>
180 ret <2 x i64> %shuffle
182 define <2 x i64> @shuffle_v2i64_03(<2 x i64> %a, <2 x i64> %b) {
183 ; SSE2-LABEL: @shuffle_v2i64_03
184 ; SSE2: shufpd {{.*}} # xmm0 = xmm0[0],xmm1[1]
187 ; SSE3-LABEL: @shuffle_v2i64_03
188 ; SSE3: shufpd {{.*}} # xmm0 = xmm0[0],xmm1[1]
191 ; SSSE3-LABEL: @shuffle_v2i64_03
192 ; SSSE3: shufpd {{.*}} # xmm0 = xmm0[0],xmm1[1]
195 ; SSE41-LABEL: @shuffle_v2i64_03
196 ; SSE41: pblendw {{.*}} # xmm0 = xmm0[0,1,2,3],xmm1[4,5,6,7]
198 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 0, i32 3>
199 ret <2 x i64> %shuffle
201 define <2 x i64> @shuffle_v2i64_03_copy(<2 x i64> %nonce, <2 x i64> %a, <2 x i64> %b) {
202 ; SSE2-LABEL: @shuffle_v2i64_03_copy
203 ; SSE2: shufpd {{.*}} # xmm1 = xmm1[0],xmm2[1]
204 ; SSE2-NEXT: movapd %xmm1, %xmm0
207 ; SSE3-LABEL: @shuffle_v2i64_03_copy
208 ; SSE3: shufpd {{.*}} # xmm1 = xmm1[0],xmm2[1]
209 ; SSE3-NEXT: movapd %xmm1, %xmm0
212 ; SSSE3-LABEL: @shuffle_v2i64_03_copy
213 ; SSSE3: shufpd {{.*}} # xmm1 = xmm1[0],xmm2[1]
214 ; SSSE3-NEXT: movapd %xmm1, %xmm0
217 ; SSE41-LABEL: @shuffle_v2i64_03_copy
218 ; SSE41: pblendw {{.*}} # xmm1 = xmm1[0,1,2,3],xmm2[4,5,6,7]
219 ; SSE41-NEXT: movdqa %xmm1, %xmm0
221 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 0, i32 3>
222 ret <2 x i64> %shuffle
224 define <2 x i64> @shuffle_v2i64_12(<2 x i64> %a, <2 x i64> %b) {
225 ; SSE2-LABEL: @shuffle_v2i64_12
226 ; SSE2: shufpd {{.*}} # xmm0 = xmm0[1],xmm1[0]
229 ; SSE3-LABEL: @shuffle_v2i64_12
230 ; SSE3: shufpd {{.*}} # xmm0 = xmm0[1],xmm1[0]
233 ; SSSE3-LABEL: @shuffle_v2i64_12
234 ; SSSE3: palignr {{.*}} # xmm1 = xmm0[8,9,10,11,12,13,14,15],xmm1[0,1,2,3,4,5,6,7]
235 ; SSSE3-NEXT: movdqa %xmm1, %xmm0
238 ; SSE41-LABEL: @shuffle_v2i64_12
239 ; SSE41: palignr {{.*}} # xmm1 = xmm0[8,9,10,11,12,13,14,15],xmm1[0,1,2,3,4,5,6,7]
240 ; SSE41-NEXT: movdqa %xmm1, %xmm0
242 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 1, i32 2>
243 ret <2 x i64> %shuffle
245 define <2 x i64> @shuffle_v2i64_12_copy(<2 x i64> %nonce, <2 x i64> %a, <2 x i64> %b) {
246 ; SSE2-LABEL: @shuffle_v2i64_12_copy
247 ; SSE2: shufpd {{.*}} # xmm1 = xmm1[1],xmm2[0]
248 ; SSE2-NEXT: movapd %xmm1, %xmm0
251 ; SSE3-LABEL: @shuffle_v2i64_12_copy
252 ; SSE3: shufpd {{.*}} # xmm1 = xmm1[1],xmm2[0]
253 ; SSE3-NEXT: movapd %xmm1, %xmm0
256 ; SSSE3-LABEL: @shuffle_v2i64_12_copy
257 ; SSSE3: palignr {{.*}} # xmm2 = xmm1[8,9,10,11,12,13,14,15],xmm2[0,1,2,3,4,5,6,7]
258 ; SSSE3-NEXT: movdqa %xmm2, %xmm0
261 ; SSE41-LABEL: @shuffle_v2i64_12_copy
262 ; SSE41: palignr {{.*}} # xmm2 = xmm1[8,9,10,11,12,13,14,15],xmm2[0,1,2,3,4,5,6,7]
263 ; SSE41-NEXT: movdqa %xmm2, %xmm0
265 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 1, i32 2>
266 ret <2 x i64> %shuffle
268 define <2 x i64> @shuffle_v2i64_13(<2 x i64> %a, <2 x i64> %b) {
269 ; ALL-LABEL: @shuffle_v2i64_13
270 ; ALL: punpckhqdq {{.*}} # xmm0 = xmm0[1],xmm1[1]
272 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 1, i32 3>
273 ret <2 x i64> %shuffle
275 define <2 x i64> @shuffle_v2i64_13_copy(<2 x i64> %nonce, <2 x i64> %a, <2 x i64> %b) {
276 ; ALL-LABEL: @shuffle_v2i64_13_copy
277 ; ALL: punpckhqdq {{.*}} # xmm1 = xmm1[1],xmm2[1]
278 ; ALL-NEXT: movdqa %xmm1, %xmm0
280 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 1, i32 3>
281 ret <2 x i64> %shuffle
283 define <2 x i64> @shuffle_v2i64_20(<2 x i64> %a, <2 x i64> %b) {
284 ; ALL-LABEL: @shuffle_v2i64_20
285 ; ALL: punpcklqdq {{.*}} # xmm1 = xmm1[0],xmm0[0]
286 ; ALL-NEXT: movdqa %xmm1, %xmm0
288 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 2, i32 0>
289 ret <2 x i64> %shuffle
291 define <2 x i64> @shuffle_v2i64_20_copy(<2 x i64> %nonce, <2 x i64> %a, <2 x i64> %b) {
292 ; ALL-LABEL: @shuffle_v2i64_20_copy
293 ; ALL: punpcklqdq {{.*}} # xmm2 = xmm2[0],xmm1[0]
294 ; ALL-NEXT: movdqa %xmm2, %xmm0
296 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 2, i32 0>
297 ret <2 x i64> %shuffle
299 define <2 x i64> @shuffle_v2i64_21(<2 x i64> %a, <2 x i64> %b) {
300 ; SSE2-LABEL: @shuffle_v2i64_21
301 ; SSE2: shufpd {{.*}} # xmm1 = xmm1[0],xmm0[1]
302 ; SSE2-NEXT: movapd %xmm1, %xmm0
305 ; SSE3-LABEL: @shuffle_v2i64_21
306 ; SSE3: shufpd {{.*}} # xmm1 = xmm1[0],xmm0[1]
307 ; SSE3-NEXT: movapd %xmm1, %xmm0
310 ; SSSE3-LABEL: @shuffle_v2i64_21
311 ; SSSE3: shufpd {{.*}} # xmm1 = xmm1[0],xmm0[1]
312 ; SSSE3-NEXT: movapd %xmm1, %xmm0
315 ; SSE41-LABEL: @shuffle_v2i64_21
316 ; SSE41: pblendw {{.*}} # xmm1 = xmm1[0,1,2,3],xmm0[4,5,6,7]
317 ; SSE41-NEXT: movdqa %xmm1, %xmm0
319 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 2, i32 1>
320 ret <2 x i64> %shuffle
322 define <2 x i64> @shuffle_v2i64_21_copy(<2 x i64> %nonce, <2 x i64> %a, <2 x i64> %b) {
323 ; SSE2-LABEL: @shuffle_v2i64_21_copy
324 ; SSE2: shufpd {{.*}} # xmm2 = xmm2[0],xmm1[1]
325 ; SSE2-NEXT: movapd %xmm2, %xmm0
328 ; SSE3-LABEL: @shuffle_v2i64_21_copy
329 ; SSE3: shufpd {{.*}} # xmm2 = xmm2[0],xmm1[1]
330 ; SSE3-NEXT: movapd %xmm2, %xmm0
333 ; SSSE3-LABEL: @shuffle_v2i64_21_copy
334 ; SSSE3: shufpd {{.*}} # xmm2 = xmm2[0],xmm1[1]
335 ; SSSE3-NEXT: movapd %xmm2, %xmm0
338 ; SSE41-LABEL: @shuffle_v2i64_21_copy
339 ; SSE41: pblendw {{.*}} # xmm2 = xmm2[0,1,2,3],xmm1[4,5,6,7]
340 ; SSE41-NEXT: movdqa %xmm2, %xmm0
342 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 2, i32 1>
343 ret <2 x i64> %shuffle
345 define <2 x i64> @shuffle_v2i64_30(<2 x i64> %a, <2 x i64> %b) {
346 ; SSE2-LABEL: @shuffle_v2i64_30
347 ; SSE2: shufpd {{.*}} # xmm1 = xmm1[1],xmm0[0]
348 ; SSE2-NEXT: movapd %xmm1, %xmm0
351 ; SSE3-LABEL: @shuffle_v2i64_30
352 ; SSE3: shufpd {{.*}} # xmm1 = xmm1[1],xmm0[0]
353 ; SSE3-NEXT: movapd %xmm1, %xmm0
356 ; SSSE3-LABEL: @shuffle_v2i64_30
357 ; SSSE3: palignr {{.*}} # xmm0 = xmm1[8,9,10,11,12,13,14,15],xmm0[0,1,2,3,4,5,6,7]
359 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 3, i32 0>
360 ret <2 x i64> %shuffle
362 define <2 x i64> @shuffle_v2i64_30_copy(<2 x i64> %nonce, <2 x i64> %a, <2 x i64> %b) {
363 ; SSE2-LABEL: @shuffle_v2i64_30_copy
364 ; SSE2: shufpd {{.*}} # xmm2 = xmm2[1],xmm1[0]
365 ; SSE2-NEXT: movapd %xmm2, %xmm0
368 ; SSE3-LABEL: @shuffle_v2i64_30_copy
369 ; SSE3: shufpd {{.*}} # xmm2 = xmm2[1],xmm1[0]
370 ; SSE3-NEXT: movapd %xmm2, %xmm0
373 ; SSSE3-LABEL: @shuffle_v2i64_30_copy
374 ; SSSE3: palignr {{.*}} # xmm1 = xmm2[8,9,10,11,12,13,14,15],xmm1[0,1,2,3,4,5,6,7]
375 ; SSSE3-NEXT: movdqa %xmm1, %xmm0
378 ; SSE41-LABEL: @shuffle_v2i64_30_copy
379 ; SSE41: palignr {{.*}} # xmm1 = xmm2[8,9,10,11,12,13,14,15],xmm1[0,1,2,3,4,5,6,7]
380 ; SSE41-NEXT: movdqa %xmm1, %xmm0
382 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 3, i32 0>
383 ret <2 x i64> %shuffle
385 define <2 x i64> @shuffle_v2i64_31(<2 x i64> %a, <2 x i64> %b) {
386 ; ALL-LABEL: @shuffle_v2i64_31
387 ; ALL: punpckhqdq {{.*}} # xmm1 = xmm1[1],xmm0[1]
388 ; ALL-NEXT: movdqa %xmm1, %xmm0
390 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 3, i32 1>
391 ret <2 x i64> %shuffle
393 define <2 x i64> @shuffle_v2i64_31_copy(<2 x i64> %nonce, <2 x i64> %a, <2 x i64> %b) {
394 ; ALL-LABEL: @shuffle_v2i64_31_copy
395 ; ALL: punpckhqdq {{.*}} # xmm2 = xmm2[1],xmm1[1]
396 ; ALL-NEXT: movdqa %xmm2, %xmm0
398 %shuffle = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 3, i32 1>
399 ret <2 x i64> %shuffle
403 define <2 x i64> @insert_reg_and_zero_v2i64(i64 %a) {
404 ; ALL-LABEL: @insert_reg_and_zero_v2i64
405 ; ALL: movd %rdi, %xmm0
407 %v = insertelement <2 x i64> undef, i64 %a, i32 0
408 %shuffle = shufflevector <2 x i64> %v, <2 x i64> zeroinitializer, <2 x i32> <i32 0, i32 3>
409 ret <2 x i64> %shuffle
412 define <2 x i64> @insert_mem_and_zero_v2i64(i64* %ptr) {
413 ; ALL-LABEL: @insert_mem_and_zero_v2i64
414 ; ALL: movq (%rdi), %xmm0
417 %v = insertelement <2 x i64> undef, i64 %a, i32 0
418 %shuffle = shufflevector <2 x i64> %v, <2 x i64> zeroinitializer, <2 x i32> <i32 0, i32 3>
419 ret <2 x i64> %shuffle
422 define <2 x double> @insert_reg_and_zero_v2f64(double %a) {
423 ; ALL-LABEL: @insert_reg_and_zero_v2f64
424 ; ALL: movq %xmm0, %xmm0
426 %v = insertelement <2 x double> undef, double %a, i32 0
427 %shuffle = shufflevector <2 x double> %v, <2 x double> zeroinitializer, <2 x i32> <i32 0, i32 3>
428 ret <2 x double> %shuffle
431 define <2 x double> @insert_mem_and_zero_v2f64(double* %ptr) {
432 ; ALL-LABEL: @insert_mem_and_zero_v2f64
433 ; ALL: movsd (%rdi), %xmm0
435 %a = load double* %ptr
436 %v = insertelement <2 x double> undef, double %a, i32 0
437 %shuffle = shufflevector <2 x double> %v, <2 x double> zeroinitializer, <2 x i32> <i32 0, i32 3>
438 ret <2 x double> %shuffle
441 define <2 x double> @insert_dup_reg_v2f64(double %a) {
442 ; SSE2-LABEL: @insert_dup_reg_v2f64
443 ; SSE2: movlhps {{.*}} # xmm0 = xmm0[0,0]
446 ; FIXME: This should match movddup as well!
447 ; SSE3-LABEL: @insert_dup_reg_v2f64
448 ; SSE3: unpcklpd {{.*}} # xmm0 = xmm0[0,0]
451 ; FIXME: This should match movddup as well!
452 ; SSSE3-LABEL: @insert_dup_reg_v2f64
453 ; SSSE3: unpcklpd {{.*}} # xmm0 = xmm0[0,0]
456 ; FIXME: This should match movddup as well!
457 ; SSE41-LABEL: @insert_dup_reg_v2f64
458 ; SSE41: unpcklpd {{.*}} # xmm0 = xmm0[0,0]
460 %v = insertelement <2 x double> undef, double %a, i32 0
461 %shuffle = shufflevector <2 x double> %v, <2 x double> undef, <2 x i32> <i32 0, i32 0>
462 ret <2 x double> %shuffle
464 define <2 x double> @insert_dup_mem_v2f64(double* %ptr) {
465 ; SSE2-LABEL: @insert_dup_mem_v2f64
466 ; SSE2: movsd {{.*}}, %xmm0
467 ; SSE2-NEXT: movlhps {{.*}} # xmm0 = xmm0[0,0]
470 ; SSE3-LABEL: @insert_dup_mem_v2f64
471 ; SSE3: movddup {{.*}}, %xmm0
474 ; SSSE3-LABEL: @insert_dup_mem_v2f64
475 ; SSSE3: movddup {{.*}}, %xmm0
478 ; SSE41-LABEL: @insert_dup_mem_v2f64
479 ; SSE41: movddup {{.*}}, %xmm0
481 %a = load double* %ptr
482 %v = insertelement <2 x double> undef, double %a, i32 0
483 %shuffle = shufflevector <2 x double> %v, <2 x double> undef, <2 x i32> <i32 0, i32 0>
484 ret <2 x double> %shuffle