e5373c575c1ad5c3cde659a796874c48b7271509
[oota-llvm.git] / test / CodeGen / X86 / avx512-build-vector.ll
1 ; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck %s
2
3 define <16 x i32> @test2(<16 x i32> %x) {
4 ; CHECK-LABEL: test2:
5 ; CHECK:       ## BB#0:
6 ; CHECK-NEXT:    vpaddd {{.*}}(%rip){1to16}, %zmm0, %zmm0
7 ; CHECK-NEXT:    retq
8    %res = add <16 x i32><i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>, %x
9    ret <16 x i32>%res
10 }
11
12 define <16 x float> @test3(<4 x float> %a) {
13 ; CHECK-LABEL: test3:
14 ; CHECK:       ## BB#0:
15 ; CHECK-NEXT:    vpermilpd {{.*#+}} xmm1 = xmm0[1,0]
16 ; CHECK-NEXT:    vxorps %xmm2, %xmm2, %xmm2
17 ; CHECK-NEXT:    vmovss %xmm0, %xmm2, %xmm0
18 ; CHECK-NEXT:    vmovss %xmm1, %xmm2, %xmm1
19 ; CHECK-NEXT:    vshufps {{.*#+}} xmm0 = xmm1[1,0],xmm0[0,1]
20 ; CHECK-NEXT:    vinsertf128 $1, %xmm0, %ymm2, %ymm0
21 ; CHECK-NEXT:    vxorps %ymm1, %ymm1, %ymm1
22 ; CHECK-NEXT:    vinsertf64x4 $1, %ymm1, %zmm0, %zmm0
23 ; CHECK-NEXT:    retq
24   %b = extractelement <4 x float> %a, i32 2
25   %c = insertelement <16 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float undef, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0.000000e+00>, float %b, i32 5
26   %b1 = extractelement <4 x float> %a, i32 0
27   %c1 = insertelement <16 x float> %c, float %b1, i32 6
28   ret <16 x float>%c1
29 }