1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=nehalem | FileCheck %s
4 define <4 x float> @a(ptr %y) nounwind {
7 ; CHECK-NEXT: movups (%rdi), %xmm0
8 ; CHECK-NEXT: shufps {{.*#+}} xmm0 = xmm0[3,2,1,0]
10 %x = load <4 x float>, ptr %y, align 4
11 %a = extractelement <4 x float> %x, i32 0
12 %b = extractelement <4 x float> %x, i32 1
13 %c = extractelement <4 x float> %x, i32 2
14 %d = extractelement <4 x float> %x, i32 3
15 %p = insertelement <4 x float> undef, float %d, i32 0
16 %q = insertelement <4 x float> %p, float %c, i32 1
17 %r = insertelement <4 x float> %q, float %b, i32 2
18 %s = insertelement <4 x float> %r, float %a, i32 3
22 define <4 x float> @b(ptr %y, <4 x float> %z) nounwind {
25 ; CHECK-NEXT: movups (%rdi), %xmm1
26 ; CHECK-NEXT: unpckhps {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
28 %x = load <4 x float>, ptr %y, align 4
29 %a = extractelement <4 x float> %x, i32 2
30 %b = extractelement <4 x float> %x, i32 3
31 %c = extractelement <4 x float> %z, i32 2
32 %d = extractelement <4 x float> %z, i32 3
33 %p = insertelement <4 x float> undef, float %c, i32 0
34 %q = insertelement <4 x float> %p, float %a, i32 1
35 %r = insertelement <4 x float> %q, float %d, i32 2
36 %s = insertelement <4 x float> %r, float %b, i32 3
40 define <2 x double> @c(ptr %y) nounwind {
43 ; CHECK-NEXT: movups (%rdi), %xmm0
44 ; CHECK-NEXT: shufps {{.*#+}} xmm0 = xmm0[2,3,0,1]
46 %x = load <2 x double>, ptr %y, align 8
47 %a = extractelement <2 x double> %x, i32 0
48 %c = extractelement <2 x double> %x, i32 1
49 %p = insertelement <2 x double> undef, double %c, i32 0
50 %r = insertelement <2 x double> %p, double %a, i32 1
54 define <2 x double> @d(ptr %y, <2 x double> %z) nounwind {
57 ; CHECK-NEXT: movups (%rdi), %xmm1
58 ; CHECK-NEXT: unpckhpd {{.*#+}} xmm0 = xmm0[1],xmm1[1]
60 %x = load <2 x double>, ptr %y, align 8
61 %a = extractelement <2 x double> %x, i32 1
62 %c = extractelement <2 x double> %z, i32 1
63 %p = insertelement <2 x double> undef, double %c, i32 0
64 %r = insertelement <2 x double> %p, double %a, i32 1