I added several lines in X86 code generator that allow to choose
[oota-llvm.git] / test / CodeGen / X86 / avx-vshufp.ll
1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s
2
3 ; CHECK: vshufps  $-53, %ymm
4 define <8 x float> @A(<8 x float> %a, <8 x float> %b) nounwind uwtable readnone ssp {
5 entry:
6   %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 3, i32 2, i32 8, i32 11, i32 7, i32 6, i32 12, i32 15>
7   ret <8 x float> %shuffle
8 }
9
10 ; CHECK: vshufpd  $10, %ymm
11 define <4 x double> @B(<4 x double> %a, <4 x double> %b) nounwind uwtable readnone ssp {
12 entry:
13   %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 5, i32 2, i32 7>
14   ret <4 x double> %shuffle
15 }
16
17 ; CHECK: vshufps  $-53, %ymm
18 define <8 x float> @C(<8 x float> %a, <8 x float> %b) nounwind uwtable readnone ssp {
19 entry:
20   %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 3, i32 undef, i32 undef, i32 11, i32 undef, i32 6, i32 12, i32 undef>
21   ret <8 x float> %shuffle
22 }
23
24 ; CHECK: vshufpd  $2, %ymm
25 define <4 x double> @D(<4 x double> %a, <4 x double> %b) nounwind uwtable readnone ssp {
26 entry:
27   %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 5, i32 2, i32 undef>
28   ret <4 x double> %shuffle
29 }
30
31 ; CHECK: vshufps $-55, %ymm
32 define <8 x float> @E(<8 x float> %a, <8 x float> %b) nounwind uwtable readnone ssp {
33 entry:
34   %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 9, i32 10, i32 0, i32 3, i32 13, i32 14, i32 4, i32 7>
35   ret <8 x float> %shuffle
36 }
37
38 ; CHECK: vshufpd  $8, %ymm
39 define <4 x double> @F(<4 x double> %a, <4 x double> %b) nounwind uwtable readnone ssp {
40 entry:
41   %shuffle = shufflevector <4 x double> %a, <4 x double> %b, <4 x i32> <i32 0, i32 4, i32 2, i32 7>
42   ret <4 x double> %shuffle
43 }