28fdd2f5ce17070b585d9bcd76e699bc13ccffc5
[oota-llvm.git] / test / CodeGen / X86 / vec_shuffle-41.ll
1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx | FileCheck %s
2
3 ; Use buildFromShuffleMostly which allows this to be generated as two 128-bit
4 ; shuffles and an insert.
5
6 ; This is the (somewhat questionable) LLVM IR that is generated for:
7 ;    x8.s0123456 = x8.s1234567;  // x8 is a <8 x float> type
8 ;    x8.s7 = f;                  // f is float
9
10
11 define <8 x float> @test1(<8 x float> %a, float %b) {
12 ; CHECK-LABEL: test1:
13 ; CHECK: vinsertps
14 ; CHECK-NOT: vinsertps
15 entry:
16   %shift = shufflevector <8 x float> %a, <8 x float> undef, <7 x i32> <i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
17   %extend = shufflevector <7 x float> %shift, <7 x float> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 undef>
18   %insert = insertelement <8 x float> %extend, float %b, i32 7
19
20   ret <8 x float> %insert
21 }