blob: 118e393b7baad7ff58f4e8f8a30133b54a62db24 [file] [log] [blame]
Jakob Stoklund Olesenbfcd61b2010-03-30 22:47:00 +00001; RUN: llc < %s -march=x86-64 | FileCheck %s
Dan Gohman7f55fcb2007-08-02 21:17:01 +00002
Jakob Stoklund Olesen932df5e2010-03-30 23:12:48 +00003; CHECK: a:
Jakob Stoklund Olesenbfcd61b2010-03-30 22:47:00 +00004; CHECK: movdqu
5; CHECK: pshufd
Evan Cheng687bcb22008-05-07 22:59:08 +00006define <4 x float> @a(<4 x float>* %y) nounwind {
Dan Gohman7f55fcb2007-08-02 21:17:01 +00007 %x = load <4 x float>* %y, align 4
8 %a = extractelement <4 x float> %x, i32 0
9 %b = extractelement <4 x float> %x, i32 1
10 %c = extractelement <4 x float> %x, i32 2
11 %d = extractelement <4 x float> %x, i32 3
12 %p = insertelement <4 x float> undef, float %d, i32 0
13 %q = insertelement <4 x float> %p, float %c, i32 1
14 %r = insertelement <4 x float> %q, float %b, i32 2
15 %s = insertelement <4 x float> %r, float %a, i32 3
16 ret <4 x float> %s
17}
Jakob Stoklund Olesenbfcd61b2010-03-30 22:47:00 +000018
Jakob Stoklund Olesen932df5e2010-03-30 23:12:48 +000019; CHECK: b:
Jakob Stoklund Olesenbfcd61b2010-03-30 22:47:00 +000020; CHECK: movups
21; CHECK: unpckhps
Evan Cheng687bcb22008-05-07 22:59:08 +000022define <4 x float> @b(<4 x float>* %y, <4 x float> %z) nounwind {
Dan Gohman7f55fcb2007-08-02 21:17:01 +000023 %x = load <4 x float>* %y, align 4
24 %a = extractelement <4 x float> %x, i32 2
25 %b = extractelement <4 x float> %x, i32 3
26 %c = extractelement <4 x float> %z, i32 2
27 %d = extractelement <4 x float> %z, i32 3
28 %p = insertelement <4 x float> undef, float %c, i32 0
29 %q = insertelement <4 x float> %p, float %a, i32 1
30 %r = insertelement <4 x float> %q, float %d, i32 2
31 %s = insertelement <4 x float> %r, float %b, i32 3
32 ret <4 x float> %s
33}
Jakob Stoklund Olesenbfcd61b2010-03-30 22:47:00 +000034
Jakob Stoklund Olesen932df5e2010-03-30 23:12:48 +000035; CHECK: c:
Jakob Stoklund Olesenbfcd61b2010-03-30 22:47:00 +000036; CHECK: movupd
37; CHECK: shufpd
Evan Cheng77f0b7a2008-05-13 08:35:03 +000038define <2 x double> @c(<2 x double>* %y) nounwind {
Dan Gohman7f55fcb2007-08-02 21:17:01 +000039 %x = load <2 x double>* %y, align 8
40 %a = extractelement <2 x double> %x, i32 0
41 %c = extractelement <2 x double> %x, i32 1
42 %p = insertelement <2 x double> undef, double %c, i32 0
43 %r = insertelement <2 x double> %p, double %a, i32 1
44 ret <2 x double> %r
45}
Jakob Stoklund Olesenbfcd61b2010-03-30 22:47:00 +000046
Jakob Stoklund Olesen932df5e2010-03-30 23:12:48 +000047; CHECK: d:
Jakob Stoklund Olesenbfcd61b2010-03-30 22:47:00 +000048; CHECK: movupd
49; CHECK: unpckhpd
Evan Cheng77f0b7a2008-05-13 08:35:03 +000050define <2 x double> @d(<2 x double>* %y, <2 x double> %z) nounwind {
Dan Gohman7f55fcb2007-08-02 21:17:01 +000051 %x = load <2 x double>* %y, align 8
52 %a = extractelement <2 x double> %x, i32 1
53 %c = extractelement <2 x double> %z, i32 1
54 %p = insertelement <2 x double> undef, double %c, i32 0
55 %r = insertelement <2 x double> %p, double %a, i32 1
56 ret <2 x double> %r
57}