Bruno Cardoso Lopes | cea34e4 | 2011-07-27 00:56:34 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s |
| 2 | |
| 3 | ; CHECK: vpermilps |
| 4 | define <8 x float> @funcA(<8 x float> %a) nounwind uwtable readnone ssp { |
| 5 | entry: |
| 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 |
| 11 | define <4 x double> @funcB(<4 x double> %a) nounwind uwtable readnone ssp { |
| 12 | entry: |
| 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 Lopes | e89c7d4 | 2011-07-29 01:31:07 +0000 | [diff] [blame] | 17 | ; CHECK: vpermilps |
| 18 | define <8 x i32> @funcC(<8 x i32> %a) nounwind uwtable readnone ssp { |
| 19 | entry: |
| 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 |
| 25 | define <4 x i64> @funcD(<4 x i64> %a) nounwind uwtable readnone ssp { |
| 26 | entry: |
| 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 Lopes | dd63530 | 2011-07-29 01:31:15 +0000 | [diff] [blame] | 30 | |
Craig Topper | 36e36ac | 2011-11-29 07:49:05 +0000 | [diff] [blame] | 31 | ; CHECK: vpermilpd |
| 32 | define <4 x i64> @funcQ(<4 x i64>* %a) nounwind uwtable readnone ssp { |
| 33 | entry: |
| 34 | %a2 = load <4 x i64>* %a |
| 35 | %shuffle = shufflevector <4 x i64> %a2, <4 x i64> undef, <4 x i32> <i32 1, i32 0, i32 3, i32 3> |
| 36 | ret <4 x i64> %shuffle |
| 37 | } |
| 38 | |
Bruno Cardoso Lopes | dd63530 | 2011-07-29 01:31:15 +0000 | [diff] [blame] | 39 | ; vpermil should match masks like this: <u,3,1,2,4,u,5,6>. Check that the |
| 40 | ; target specific mask was correctly generated. |
| 41 | ; CHECK: vpermilps $-100 |
Bruno Cardoso Lopes | 6126005 | 2011-07-29 02:05:28 +0000 | [diff] [blame] | 42 | define <8 x float> @funcE(<8 x float> %a) nounwind uwtable readnone ssp { |
Bruno Cardoso Lopes | dd63530 | 2011-07-29 01:31:15 +0000 | [diff] [blame] | 43 | entry: |
| 44 | %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> |
| 45 | ret <8 x float> %shuffle |
| 46 | } |
| 47 | |
Craig Topper | 9a2b6e1 | 2012-04-06 07:45:23 +0000 | [diff] [blame^] | 48 | ; CHECK: palignr |
| 49 | ; CHECK: palignr |
Bruno Cardoso Lopes | 155a92a | 2011-08-10 01:54:17 +0000 | [diff] [blame] | 50 | define <8 x float> @funcF(<8 x float> %a) nounwind uwtable readnone ssp { |
| 51 | entry: |
| 52 | %shuffle = shufflevector <8 x float> %a, <8 x float> zeroinitializer, <8 x i32> <i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9> |
| 53 | ret <8 x float> %shuffle |
| 54 | } |