blob: a3e916dc1eb719d673251d19f71650d5ceb46ece [file] [log] [blame]
Bruno Cardoso Lopescea34e42011-07-27 00:56:34 +00001; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s
2
3; CHECK: vpermilps
4define <8 x float> @funcA(<8 x float> %a) nounwind uwtable readnone ssp {
5entry:
6 %shuffle = shufflevector <8 x float> %a, <8 x float> undef, <8 x i32> <i32 1, i32 2, i32 3, i32 1, i32 5, i32 6, i32 7, i32 5>
7 ret <8 x float> %shuffle
8}
9
10; CHECK: vpermilpd
11define <4 x double> @funcB(<4 x double> %a) nounwind uwtable readnone ssp {
12entry:
13 %shuffle = shufflevector <4 x double> %a, <4 x double> undef, <4 x i32> <i32 1, i32 0, i32 3, i32 3>
14 ret <4 x double> %shuffle
15}
16
Bruno Cardoso Lopese89c7d42011-07-29 01:31:07 +000017; CHECK: vpermilps
18define <8 x i32> @funcC(<8 x i32> %a) nounwind uwtable readnone ssp {
19entry:
20 %shuffle = shufflevector <8 x i32> %a, <8 x i32> undef, <8 x i32> <i32 1, i32 2, i32 3, i32 1, i32 5, i32 6, i32 7, i32 5>
21 ret <8 x i32> %shuffle
22}
23
24; CHECK: vpermilpd
25define <4 x i64> @funcD(<4 x i64> %a) nounwind uwtable readnone ssp {
26entry:
27 %shuffle = shufflevector <4 x i64> %a, <4 x i64> undef, <4 x i32> <i32 1, i32 0, i32 3, i32 3>
28 ret <4 x i64> %shuffle
29}
Bruno Cardoso Lopesdd635302011-07-29 01:31:15 +000030
31; vpermil should match masks like this: <u,3,1,2,4,u,5,6>. Check that the
32; target specific mask was correctly generated.
33; CHECK: vpermilps $-100
34define <8 x float> @funcA(<8 x float> %a) nounwind uwtable readnone ssp {
35entry:
36 %shuffle = shufflevector <8 x float> %a, <8 x float> undef, <8 x i32> <i32 8, i32 3, i32 1, i32 2, i32 4, i32 8, i32 5, i32 6>
37 ret <8 x float> %shuffle
38}
39