Relax an invariant that block placement was trying to assert a bit
[oota-llvm.git] / test / CodeGen / X86 / avx-unpack.ll
1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s
2
3 ; CHECK: vunpckhps
4 define <8 x float> @unpackhips(<8 x float> %src1, <8 x float> %src2) nounwind uwtable readnone ssp {
5 entry:
6   %shuffle.i = shufflevector <8 x float> %src1, <8 x float> %src2, <8 x i32> <i32 2, i32 10, i32 3, i32 11, i32 6, i32 14, i32 7, i32 15>
7   ret <8 x float> %shuffle.i
8 }
9
10 ; CHECK: vunpckhpd
11 define <4 x double> @unpackhipd(<4 x double> %src1, <4 x double> %src2) nounwind uwtable readnone ssp {
12 entry:
13   %shuffle.i = shufflevector <4 x double> %src1, <4 x double> %src2, <4 x i32> <i32 1, i32 5, i32 3, i32 7>
14   ret <4 x double> %shuffle.i
15 }
16
17 ; CHECK: vunpcklps
18 define <8 x float> @unpacklops(<8 x float> %src1, <8 x float> %src2) nounwind uwtable readnone ssp {
19 entry:
20   %shuffle.i = shufflevector <8 x float> %src1, <8 x float> %src2, <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 4, i32 12, i32 5, i32 13>
21   ret <8 x float> %shuffle.i
22 }
23
24 ; CHECK: vunpcklpd
25 define <4 x double> @unpacklopd(<4 x double> %src1, <4 x double> %src2) nounwind uwtable readnone ssp {
26 entry:
27   %shuffle.i = shufflevector <4 x double> %src1, <4 x double> %src2, <4 x i32> <i32 0, i32 4, i32 2, i32 6>
28   ret <4 x double> %shuffle.i
29 }
30
31 ; CHECK-NOT: vunpcklps %ymm
32 define <8 x float> @unpacklops-not(<8 x float> %src1, <8 x float> %src2) nounwind uwtable readnone ssp {
33 entry:
34   %shuffle.i = shufflevector <8 x float> %src1, <8 x float> %src2, <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11>
35   ret <8 x float> %shuffle.i
36 }
37
38 ; CHECK-NOT: vunpcklpd %ymm
39 define <4 x double> @unpacklopd-not(<4 x double> %src1, <4 x double> %src2) nounwind uwtable readnone ssp {
40 entry:
41   %shuffle.i = shufflevector <4 x double> %src1, <4 x double> %src2, <4 x i32> <i32 0, i32 4, i32 1, i32 5>
42   ret <4 x double> %shuffle.i
43 }
44
45 ; CHECK-NOT: vunpckhps %ymm
46 define <8 x float> @unpackhips-not(<8 x float> %src1, <8 x float> %src2) nounwind uwtable readnone ssp {
47 entry:
48   %shuffle.i = shufflevector <8 x float> %src1, <8 x float> %src2, <8 x i32> <i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13>
49   ret <8 x float> %shuffle.i
50 }
51
52 ; CHECK-NOT: vunpckhpd %ymm
53 define <4 x double> @unpackhipd-not(<4 x double> %src1, <4 x double> %src2) nounwind uwtable readnone ssp {
54 entry:
55   %shuffle.i = shufflevector <4 x double> %src1, <4 x double> %src2, <4 x i32> <i32 2, i32 6, i32 3, i32 7>
56   ret <4 x double> %shuffle.i
57 }
58
59 ;;;;
60 ;;;; Unpack versions using the fp unit for int unpacking
61 ;;;;
62
63 ; CHECK: vunpckhps
64 define <8 x i32> @unpackhips1(<8 x i32> %src1, <8 x i32> %src2) nounwind uwtable readnone ssp {
65 entry:
66   %shuffle.i = shufflevector <8 x i32> %src1, <8 x i32> %src2, <8 x i32> <i32 2, i32 10, i32 3, i32 11, i32 6, i32 14, i32 7, i32 15>
67   ret <8 x i32> %shuffle.i
68 }
69
70 ; CHECK: vunpckhpd
71 define <4 x i64> @unpackhipd1(<4 x i64> %src1, <4 x i64> %src2) nounwind uwtable readnone ssp {
72 entry:
73   %shuffle.i = shufflevector <4 x i64> %src1, <4 x i64> %src2, <4 x i32> <i32 1, i32 5, i32 3, i32 7>
74   ret <4 x i64> %shuffle.i
75 }
76
77 ; CHECK: vunpcklps
78 define <8 x i32> @unpacklops1(<8 x i32> %src1, <8 x i32> %src2) nounwind uwtable readnone ssp {
79 entry:
80   %shuffle.i = shufflevector <8 x i32> %src1, <8 x i32> %src2, <8 x i32> <i32 0, i32 8, i32 1, i32 9, i32 4, i32 12, i32 5, i32 13>
81   ret <8 x i32> %shuffle.i
82 }
83
84 ; CHECK: vunpcklpd
85 define <4 x i64> @unpacklopd1(<4 x i64> %src1, <4 x i64> %src2) nounwind uwtable readnone ssp {
86 entry:
87   %shuffle.i = shufflevector <4 x i64> %src1, <4 x i64> %src2, <4 x i32> <i32 0, i32 4, i32 2, i32 6>
88   ret <4 x i64> %shuffle.i
89 }