blob: 978f59eec71640c7dbce4bfa0e67bb9e12544e64 [file] [log] [blame]
Rafael Espindola23e31012011-07-22 18:56:05 +00001; RUN: llc < %s -march=x86-64 | FileCheck %s
2
3define <2 x double> @ld(<2 x double> %p) nounwind optsize ssp {
4; CHECK: unpcklpd
5 %shuffle = shufflevector <2 x double> %p, <2 x double> undef, <2 x i32> zeroinitializer
6 ret <2 x double> %shuffle
7}
8
9define <2 x double> @hd(<2 x double> %p) nounwind optsize ssp {
10; CHECK: unpckhpd
11 %shuffle = shufflevector <2 x double> %p, <2 x double> undef, <2 x i32> <i32 1, i32 1>
12 ret <2 x double> %shuffle
13}
14
15define <2 x i64> @ldi(<2 x i64> %p) nounwind optsize ssp {
16; CHECK: punpcklqdq
17 %shuffle = shufflevector <2 x i64> %p, <2 x i64> undef, <2 x i32> zeroinitializer
18 ret <2 x i64> %shuffle
19}
20
21define <2 x i64> @hdi(<2 x i64> %p) nounwind optsize ssp {
22; CHECK: punpckhqdq
23 %shuffle = shufflevector <2 x i64> %p, <2 x i64> undef, <2 x i32> <i32 1, i32 1>
24 ret <2 x i64> %shuffle
25}
26
Evan Cheng0899f5c2011-08-31 02:05:24 +000027; rdar://10050549
28%struct.Float2 = type { float, float }
29
30define <4 x float> @loadhpi(%struct.Float2* %vPtr, <4 x float> %vecin1) nounwind readonly ssp {
31entry:
32; CHECK: loadhpi
33; CHECK-NOT: movq
34; CHECK: movhps (
35 %tmp1 = bitcast %struct.Float2* %vPtr to <1 x i64>*
36 %addptr7 = getelementptr inbounds <1 x i64>* %tmp1, i64 0
37 %tmp2 = bitcast <1 x i64>* %addptr7 to float*
38 %tmp3 = load float* %tmp2, align 4
39 %vec = insertelement <4 x float> undef, float %tmp3, i32 0
40 %addptr.i12 = getelementptr inbounds float* %tmp2, i64 1
41 %tmp4 = load float* %addptr.i12, align 4
42 %vecin2 = insertelement <4 x float> %vec, float %tmp4, i32 1
43 %shuffle = shufflevector <4 x float> %vecin1, <4 x float> %vecin2, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
44 ret <4 x float> %shuffle
45}