diff --git a/llvm/test/CodeGen/X86/avx512-insert-extract.ll b/llvm/test/CodeGen/X86/avx512-insert-extract.ll index c22b960ec46c..43c447022585 100644 --- a/llvm/test/CodeGen/X86/avx512-insert-extract.ll +++ b/llvm/test/CodeGen/X86/avx512-insert-extract.ll @@ -1,28 +1,18 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck --check-prefix=KNL %s -; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=skx | FileCheck --check-prefix=SKX --check-prefix=SKX_ONLY %s -; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=skx -mattr=avx512vbmi | FileCheck --check-prefix=SKX --check-prefix=SKX_VBMI %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck --check-prefix=CHECK --check-prefix=KNL %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=skx | FileCheck --check-prefix=CHECK --check-prefix=SKX --check-prefix=SKX_ONLY %s +; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=skx -mattr=avx512vbmi | FileCheck --check-prefix=CHECK --check-prefix=SKX --check-prefix=SKX_VBMI %s define <16 x float> @test1(<16 x float> %x, float* %br, float %y) nounwind { -; KNL-LABEL: test1: -; KNL: ## BB#0: -; KNL-NEXT: vinsertps {{.*#+}} xmm2 = xmm0[0],mem[0],xmm0[2,3] -; KNL-NEXT: vinsertf32x4 $0, %xmm2, %zmm0, %zmm2 -; KNL-NEXT: vextractf32x4 $3, %zmm0, %xmm0 -; KNL-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0],xmm0[3] -; KNL-NEXT: vinsertf32x4 $3, %xmm0, %zmm2, %zmm0 -; KNL-NEXT: retq -; KNL-NEXT: ## -- End function -; -; SKX-LABEL: test1: -; SKX: ## BB#0: -; SKX-NEXT: vinsertps {{.*#+}} xmm2 = xmm0[0],mem[0],xmm0[2,3] -; SKX-NEXT: vinsertf32x4 $0, %xmm2, %zmm0, %zmm2 -; SKX-NEXT: vextractf32x4 $3, %zmm0, %xmm0 -; SKX-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0],xmm0[3] -; SKX-NEXT: vinsertf32x4 $3, %xmm0, %zmm2, %zmm0 -; SKX-NEXT: retq -; SKX-NEXT: ## -- End function +; CHECK-LABEL: test1: +; CHECK: ## BB#0: +; CHECK-NEXT: vinsertps {{.*#+}} xmm2 = xmm0[0],mem[0],xmm0[2,3] +; CHECK-NEXT: vinsertf32x4 $0, %xmm2, %zmm0, %zmm2 +; CHECK-NEXT: vextractf32x4 $3, %zmm0, %xmm0 +; CHECK-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0],xmm0[3] +; CHECK-NEXT: vinsertf32x4 $3, %xmm0, %zmm2, %zmm0 +; CHECK-NEXT: retq +; CHECK-NEXT: ## -- End function %rrr = load float, float* %br %rrr2 = insertelement <16 x float> %x, float %rrr, i32 1 %rrr3 = insertelement <16 x float> %rrr2, float %y, i32 14 @@ -56,21 +46,13 @@ define <8 x double> @test2(<8 x double> %x, double* %br, double %y) nounwind { } define <16 x float> @test3(<16 x float> %x) nounwind { -; KNL-LABEL: test3: -; KNL: ## BB#0: -; KNL-NEXT: vextractf32x4 $1, %zmm0, %xmm1 -; KNL-NEXT: vinsertps {{.*#+}} xmm1 = xmm0[0],xmm1[0],xmm0[2,3] -; KNL-NEXT: vinsertf32x4 $0, %xmm1, %zmm0, %zmm0 -; KNL-NEXT: retq -; KNL-NEXT: ## -- End function -; -; SKX-LABEL: test3: -; SKX: ## BB#0: -; SKX-NEXT: vextractf32x4 $1, %zmm0, %xmm1 -; SKX-NEXT: vinsertps {{.*#+}} xmm1 = xmm0[0],xmm1[0],xmm0[2,3] -; SKX-NEXT: vinsertf32x4 $0, %xmm1, %zmm0, %zmm0 -; SKX-NEXT: retq -; SKX-NEXT: ## -- End function +; CHECK-LABEL: test3: +; CHECK: ## BB#0: +; CHECK-NEXT: vextractf32x4 $1, %zmm0, %xmm1 +; CHECK-NEXT: vinsertps {{.*#+}} xmm1 = xmm0[0],xmm1[0],xmm0[2,3] +; CHECK-NEXT: vinsertf32x4 $0, %xmm1, %zmm0, %zmm0 +; CHECK-NEXT: retq +; CHECK-NEXT: ## -- End function %eee = extractelement <16 x float> %x, i32 4 %rrr2 = insertelement <16 x float> %x, float %eee, i32 1 ret <16 x float> %rrr2 @@ -100,34 +82,22 @@ define <8 x i64> @test4(<8 x i64> %x) nounwind { } define i32 @test5(<4 x float> %x) nounwind { -; KNL-LABEL: test5: -; KNL: ## BB#0: -; KNL-NEXT: vextractps $3, %xmm0, %eax -; KNL-NEXT: retq -; KNL-NEXT: ## -- End function -; -; SKX-LABEL: test5: -; SKX: ## BB#0: -; SKX-NEXT: vextractps $3, %xmm0, %eax -; SKX-NEXT: retq -; SKX-NEXT: ## -- End function +; CHECK-LABEL: test5: +; CHECK: ## BB#0: +; CHECK-NEXT: vextractps $3, %xmm0, %eax +; CHECK-NEXT: retq +; CHECK-NEXT: ## -- End function %ef = extractelement <4 x float> %x, i32 3 %ei = bitcast float %ef to i32 ret i32 %ei } define void @test6(<4 x float> %x, float* %out) nounwind { -; KNL-LABEL: test6: -; KNL: ## BB#0: -; KNL-NEXT: vextractps $3, %xmm0, (%rdi) -; KNL-NEXT: retq -; KNL-NEXT: ## -- End function -; -; SKX-LABEL: test6: -; SKX: ## BB#0: -; SKX-NEXT: vextractps $3, %xmm0, (%rdi) -; SKX-NEXT: retq -; SKX-NEXT: ## -- End function +; CHECK-LABEL: test6: +; CHECK: ## BB#0: +; CHECK-NEXT: vextractps $3, %xmm0, (%rdi) +; CHECK-NEXT: retq +; CHECK-NEXT: ## -- End function %ef = extractelement <4 x float> %x, i32 3 store float %ef, float* %out, align 4 ret void @@ -408,23 +378,14 @@ define i64 @test14(<8 x i64>%a, <8 x i64>%b, i64 %a1, i64 %b1) { } define i16 @test15(i1 *%addr) { -; KNL-LABEL: test15: -; KNL: ## BB#0: -; KNL-NEXT: movb (%rdi), %al -; KNL-NEXT: xorl %ecx, %ecx -; KNL-NEXT: testb %al, %al -; KNL-NEXT: movw $-1, %ax -; KNL-NEXT: cmovew %cx, %ax -; KNL-NEXT: retq -; -; SKX-LABEL: test15: -; SKX: ## BB#0: -; SKX-NEXT: movb (%rdi), %al -; SKX-NEXT: xorl %ecx, %ecx -; SKX-NEXT: testb %al, %al -; SKX-NEXT: movw $-1, %ax -; SKX-NEXT: cmovew %cx, %ax -; SKX-NEXT: retq +; CHECK-LABEL: test15: +; CHECK: ## BB#0: +; CHECK-NEXT: movb (%rdi), %al +; CHECK-NEXT: xorl %ecx, %ecx +; CHECK-NEXT: testb %al, %al +; CHECK-NEXT: movw $-1, %ax +; CHECK-NEXT: cmovew %cx, %ax +; CHECK-NEXT: retq %x = load i1 , i1 * %addr, align 1 %x1 = insertelement <16 x i1> undef, i1 %x, i32 10 %x2 = bitcast <16 x i1>%x1 to i16 @@ -548,17 +509,11 @@ define i64 @extract_v4i64(<4 x i64> %x, i64* %dst) { } define i64 @extract_v2i64(<2 x i64> %x, i64* %dst) { -; KNL-LABEL: extract_v2i64: -; KNL: ## BB#0: -; KNL-NEXT: vmovq %xmm0, %rax -; KNL-NEXT: vpextrq $1, %xmm0, (%rdi) -; KNL-NEXT: retq -; -; SKX-LABEL: extract_v2i64: -; SKX: ## BB#0: -; SKX-NEXT: vmovq %xmm0, %rax -; SKX-NEXT: vpextrq $1, %xmm0, (%rdi) -; SKX-NEXT: retq +; CHECK-LABEL: extract_v2i64: +; CHECK: ## BB#0: +; CHECK-NEXT: vmovq %xmm0, %rax +; CHECK-NEXT: vpextrq $1, %xmm0, (%rdi) +; CHECK-NEXT: retq %r1 = extractelement <2 x i64> %x, i32 0 %r2 = extractelement <2 x i64> %x, i32 1 store i64 %r2, i64* %dst, align 1 @@ -608,17 +563,11 @@ define i32 @extract_v8i32(<8 x i32> %x, i32* %dst) { } define i32 @extract_v4i32(<4 x i32> %x, i32* %dst) { -; KNL-LABEL: extract_v4i32: -; KNL: ## BB#0: -; KNL-NEXT: vpextrd $1, %xmm0, %eax -; KNL-NEXT: vpextrd $3, %xmm0, (%rdi) -; KNL-NEXT: retq -; -; SKX-LABEL: extract_v4i32: -; SKX: ## BB#0: -; SKX-NEXT: vpextrd $1, %xmm0, %eax -; SKX-NEXT: vpextrd $3, %xmm0, (%rdi) -; SKX-NEXT: retq +; CHECK-LABEL: extract_v4i32: +; CHECK: ## BB#0: +; CHECK-NEXT: vpextrd $1, %xmm0, %eax +; CHECK-NEXT: vpextrd $3, %xmm0, (%rdi) +; CHECK-NEXT: retq %r1 = extractelement <4 x i32> %x, i32 1 %r2 = extractelement <4 x i32> %x, i32 3 store i32 %r2, i32* %dst, align 1 @@ -672,19 +621,12 @@ define i16 @extract_v16i16(<16 x i16> %x, i16* %dst) { } define i16 @extract_v8i16(<8 x i16> %x, i16* %dst) { -; KNL-LABEL: extract_v8i16: -; KNL: ## BB#0: -; KNL-NEXT: vpextrw $1, %xmm0, %eax -; KNL-NEXT: vpextrw $3, %xmm0, (%rdi) -; KNL-NEXT: ## kill: %AX %AX %EAX -; KNL-NEXT: retq -; -; SKX-LABEL: extract_v8i16: -; SKX: ## BB#0: -; SKX-NEXT: vpextrw $1, %xmm0, %eax -; SKX-NEXT: vpextrw $3, %xmm0, (%rdi) -; SKX-NEXT: ## kill: %AX %AX %EAX -; SKX-NEXT: retq +; CHECK-LABEL: extract_v8i16: +; CHECK: ## BB#0: +; CHECK-NEXT: vpextrw $1, %xmm0, %eax +; CHECK-NEXT: vpextrw $3, %xmm0, (%rdi) +; CHECK-NEXT: ## kill: %AX %AX %EAX +; CHECK-NEXT: retq %r1 = extractelement <8 x i16> %x, i32 1 %r2 = extractelement <8 x i16> %x, i32 3 store i16 %r2, i16* %dst, align 1 @@ -738,19 +680,12 @@ define i8 @extract_v32i8(<32 x i8> %x, i8* %dst) { } define i8 @extract_v16i8(<16 x i8> %x, i8* %dst) { -; KNL-LABEL: extract_v16i8: -; KNL: ## BB#0: -; KNL-NEXT: vpextrb $1, %xmm0, %eax -; KNL-NEXT: vpextrb $3, %xmm0, (%rdi) -; KNL-NEXT: ## kill: %AL %AL %EAX -; KNL-NEXT: retq -; -; SKX-LABEL: extract_v16i8: -; SKX: ## BB#0: -; SKX-NEXT: vpextrb $1, %xmm0, %eax -; SKX-NEXT: vpextrb $3, %xmm0, (%rdi) -; SKX-NEXT: ## kill: %AL %AL %EAX -; SKX-NEXT: retq +; CHECK-LABEL: extract_v16i8: +; CHECK: ## BB#0: +; CHECK-NEXT: vpextrb $1, %xmm0, %eax +; CHECK-NEXT: vpextrb $3, %xmm0, (%rdi) +; CHECK-NEXT: ## kill: %AL %AL %EAX +; CHECK-NEXT: retq %r1 = extractelement <16 x i8> %x, i32 1 %r2 = extractelement <16 x i8> %x, i32 3 store i8 %r2, i8* %dst, align 1 @@ -782,23 +717,14 @@ define <8 x i64> @insert_v8i64(<8 x i64> %x, i64 %y , i64* %ptr) { } define <4 x i64> @insert_v4i64(<4 x i64> %x, i64 %y , i64* %ptr) { -; KNL-LABEL: insert_v4i64: -; KNL: ## BB#0: -; KNL-NEXT: vpinsrq $1, (%rsi), %xmm0, %xmm1 -; KNL-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7] -; KNL-NEXT: vextracti128 $1, %ymm0, %xmm0 -; KNL-NEXT: vpinsrq $1, %rdi, %xmm0, %xmm0 -; KNL-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0 -; KNL-NEXT: retq -; -; SKX-LABEL: insert_v4i64: -; SKX: ## BB#0: -; SKX-NEXT: vpinsrq $1, (%rsi), %xmm0, %xmm1 -; SKX-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7] -; SKX-NEXT: vextracti128 $1, %ymm0, %xmm0 -; SKX-NEXT: vpinsrq $1, %rdi, %xmm0, %xmm0 -; SKX-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0 -; SKX-NEXT: retq +; CHECK-LABEL: insert_v4i64: +; CHECK: ## BB#0: +; CHECK-NEXT: vpinsrq $1, (%rsi), %xmm0, %xmm1 +; CHECK-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7] +; CHECK-NEXT: vextracti128 $1, %ymm0, %xmm0 +; CHECK-NEXT: vpinsrq $1, %rdi, %xmm0, %xmm0 +; CHECK-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0 +; CHECK-NEXT: retq %val = load i64, i64* %ptr %r1 = insertelement <4 x i64> %x, i64 %val, i32 1 %r2 = insertelement <4 x i64> %r1, i64 %y, i32 3 @@ -806,17 +732,11 @@ define <4 x i64> @insert_v4i64(<4 x i64> %x, i64 %y , i64* %ptr) { } define <2 x i64> @insert_v2i64(<2 x i64> %x, i64 %y , i64* %ptr) { -; KNL-LABEL: insert_v2i64: -; KNL: ## BB#0: -; KNL-NEXT: vpinsrq $0, %rdi, %xmm0, %xmm0 -; KNL-NEXT: vpinsrq $1, (%rsi), %xmm0, %xmm0 -; KNL-NEXT: retq -; -; SKX-LABEL: insert_v2i64: -; SKX: ## BB#0: -; SKX-NEXT: vpinsrq $0, %rdi, %xmm0, %xmm0 -; SKX-NEXT: vpinsrq $1, (%rsi), %xmm0, %xmm0 -; SKX-NEXT: retq +; CHECK-LABEL: insert_v2i64: +; CHECK: ## BB#0: +; CHECK-NEXT: vpinsrq $0, %rdi, %xmm0, %xmm0 +; CHECK-NEXT: vpinsrq $1, (%rsi), %xmm0, %xmm0 +; CHECK-NEXT: retq %val = load i64, i64* %ptr %r1 = insertelement <2 x i64> %x, i64 %val, i32 1 %r2 = insertelement <2 x i64> %r1, i64 %y, i32 0 @@ -824,23 +744,14 @@ define <2 x i64> @insert_v2i64(<2 x i64> %x, i64 %y , i64* %ptr) { } define <16 x i32> @insert_v16i32(<16 x i32> %x, i32 %y, i32* %ptr) { -; KNL-LABEL: insert_v16i32: -; KNL: ## BB#0: -; KNL-NEXT: vpinsrd $1, (%rsi), %xmm0, %xmm1 -; KNL-NEXT: vinserti32x4 $0, %xmm1, %zmm0, %zmm1 -; KNL-NEXT: vextracti32x4 $1, %zmm0, %xmm0 -; KNL-NEXT: vpinsrd $1, %edi, %xmm0, %xmm0 -; KNL-NEXT: vinserti32x4 $1, %xmm0, %zmm1, %zmm0 -; KNL-NEXT: retq -; -; SKX-LABEL: insert_v16i32: -; SKX: ## BB#0: -; SKX-NEXT: vpinsrd $1, (%rsi), %xmm0, %xmm1 -; SKX-NEXT: vinserti32x4 $0, %xmm1, %zmm0, %zmm1 -; SKX-NEXT: vextracti32x4 $1, %zmm0, %xmm0 -; SKX-NEXT: vpinsrd $1, %edi, %xmm0, %xmm0 -; SKX-NEXT: vinserti32x4 $1, %xmm0, %zmm1, %zmm0 -; SKX-NEXT: retq +; CHECK-LABEL: insert_v16i32: +; CHECK: ## BB#0: +; CHECK-NEXT: vpinsrd $1, (%rsi), %xmm0, %xmm1 +; CHECK-NEXT: vinserti32x4 $0, %xmm1, %zmm0, %zmm1 +; CHECK-NEXT: vextracti32x4 $1, %zmm0, %xmm0 +; CHECK-NEXT: vpinsrd $1, %edi, %xmm0, %xmm0 +; CHECK-NEXT: vinserti32x4 $1, %xmm0, %zmm1, %zmm0 +; CHECK-NEXT: retq %val = load i32, i32* %ptr %r1 = insertelement <16 x i32> %x, i32 %val, i32 1 %r2 = insertelement <16 x i32> %r1, i32 %y, i32 5 @@ -848,23 +759,14 @@ define <16 x i32> @insert_v16i32(<16 x i32> %x, i32 %y, i32* %ptr) { } define <8 x i32> @insert_v8i32(<8 x i32> %x, i32 %y, i32* %ptr) { -; KNL-LABEL: insert_v8i32: -; KNL: ## BB#0: -; KNL-NEXT: vpinsrd $1, (%rsi), %xmm0, %xmm1 -; KNL-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7] -; KNL-NEXT: vextracti128 $1, %ymm0, %xmm0 -; KNL-NEXT: vpinsrd $1, %edi, %xmm0, %xmm0 -; KNL-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0 -; KNL-NEXT: retq -; -; SKX-LABEL: insert_v8i32: -; SKX: ## BB#0: -; SKX-NEXT: vpinsrd $1, (%rsi), %xmm0, %xmm1 -; SKX-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7] -; SKX-NEXT: vextracti128 $1, %ymm0, %xmm0 -; SKX-NEXT: vpinsrd $1, %edi, %xmm0, %xmm0 -; SKX-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0 -; SKX-NEXT: retq +; CHECK-LABEL: insert_v8i32: +; CHECK: ## BB#0: +; CHECK-NEXT: vpinsrd $1, (%rsi), %xmm0, %xmm1 +; CHECK-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7] +; CHECK-NEXT: vextracti128 $1, %ymm0, %xmm0 +; CHECK-NEXT: vpinsrd $1, %edi, %xmm0, %xmm0 +; CHECK-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0 +; CHECK-NEXT: retq %val = load i32, i32* %ptr %r1 = insertelement <8 x i32> %x, i32 %val, i32 1 %r2 = insertelement <8 x i32> %r1, i32 %y, i32 5 @@ -872,17 +774,11 @@ define <8 x i32> @insert_v8i32(<8 x i32> %x, i32 %y, i32* %ptr) { } define <4 x i32> @insert_v4i32(<4 x i32> %x, i32 %y, i32* %ptr) { -; KNL-LABEL: insert_v4i32: -; KNL: ## BB#0: -; KNL-NEXT: vpinsrd $1, (%rsi), %xmm0, %xmm0 -; KNL-NEXT: vpinsrd $3, %edi, %xmm0, %xmm0 -; KNL-NEXT: retq -; -; SKX-LABEL: insert_v4i32: -; SKX: ## BB#0: -; SKX-NEXT: vpinsrd $1, (%rsi), %xmm0, %xmm0 -; SKX-NEXT: vpinsrd $3, %edi, %xmm0, %xmm0 -; SKX-NEXT: retq +; CHECK-LABEL: insert_v4i32: +; CHECK: ## BB#0: +; CHECK-NEXT: vpinsrd $1, (%rsi), %xmm0, %xmm0 +; CHECK-NEXT: vpinsrd $3, %edi, %xmm0, %xmm0 +; CHECK-NEXT: retq %val = load i32, i32* %ptr %r1 = insertelement <4 x i32> %x, i32 %val, i32 1 %r2 = insertelement <4 x i32> %r1, i32 %y, i32 3 @@ -914,23 +810,14 @@ define <32 x i16> @insert_v32i16(<32 x i16> %x, i16 %y, i16* %ptr) { } define <16 x i16> @insert_v16i16(<16 x i16> %x, i16 %y, i16* %ptr) { -; KNL-LABEL: insert_v16i16: -; KNL: ## BB#0: -; KNL-NEXT: vpinsrw $1, (%rsi), %xmm0, %xmm1 -; KNL-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7] -; KNL-NEXT: vextracti128 $1, %ymm0, %xmm0 -; KNL-NEXT: vpinsrw $1, %edi, %xmm0, %xmm0 -; KNL-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0 -; KNL-NEXT: retq -; -; SKX-LABEL: insert_v16i16: -; SKX: ## BB#0: -; SKX-NEXT: vpinsrw $1, (%rsi), %xmm0, %xmm1 -; SKX-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7] -; SKX-NEXT: vextracti128 $1, %ymm0, %xmm0 -; SKX-NEXT: vpinsrw $1, %edi, %xmm0, %xmm0 -; SKX-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0 -; SKX-NEXT: retq +; CHECK-LABEL: insert_v16i16: +; CHECK: ## BB#0: +; CHECK-NEXT: vpinsrw $1, (%rsi), %xmm0, %xmm1 +; CHECK-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7] +; CHECK-NEXT: vextracti128 $1, %ymm0, %xmm0 +; CHECK-NEXT: vpinsrw $1, %edi, %xmm0, %xmm0 +; CHECK-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0 +; CHECK-NEXT: retq %val = load i16, i16* %ptr %r1 = insertelement <16 x i16> %x, i16 %val, i32 1 %r2 = insertelement <16 x i16> %r1, i16 %y, i32 9 @@ -938,17 +825,11 @@ define <16 x i16> @insert_v16i16(<16 x i16> %x, i16 %y, i16* %ptr) { } define <8 x i16> @insert_v8i16(<8 x i16> %x, i16 %y, i16* %ptr) { -; KNL-LABEL: insert_v8i16: -; KNL: ## BB#0: -; KNL-NEXT: vpinsrw $1, (%rsi), %xmm0, %xmm0 -; KNL-NEXT: vpinsrw $5, %edi, %xmm0, %xmm0 -; KNL-NEXT: retq -; -; SKX-LABEL: insert_v8i16: -; SKX: ## BB#0: -; SKX-NEXT: vpinsrw $1, (%rsi), %xmm0, %xmm0 -; SKX-NEXT: vpinsrw $5, %edi, %xmm0, %xmm0 -; SKX-NEXT: retq +; CHECK-LABEL: insert_v8i16: +; CHECK: ## BB#0: +; CHECK-NEXT: vpinsrw $1, (%rsi), %xmm0, %xmm0 +; CHECK-NEXT: vpinsrw $5, %edi, %xmm0, %xmm0 +; CHECK-NEXT: retq %val = load i16, i16* %ptr %r1 = insertelement <8 x i16> %x, i16 %val, i32 1 %r2 = insertelement <8 x i16> %r1, i16 %y, i32 5 @@ -980,23 +861,14 @@ define <64 x i8> @insert_v64i8(<64 x i8> %x, i8 %y, i8* %ptr) { } define <32 x i8> @insert_v32i8(<32 x i8> %x, i8 %y, i8* %ptr) { -; KNL-LABEL: insert_v32i8: -; KNL: ## BB#0: -; KNL-NEXT: vpinsrb $1, (%rsi), %xmm0, %xmm1 -; KNL-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7] -; KNL-NEXT: vextracti128 $1, %ymm0, %xmm0 -; KNL-NEXT: vpinsrb $1, %edi, %xmm0, %xmm0 -; KNL-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0 -; KNL-NEXT: retq -; -; SKX-LABEL: insert_v32i8: -; SKX: ## BB#0: -; SKX-NEXT: vpinsrb $1, (%rsi), %xmm0, %xmm1 -; SKX-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7] -; SKX-NEXT: vextracti128 $1, %ymm0, %xmm0 -; SKX-NEXT: vpinsrb $1, %edi, %xmm0, %xmm0 -; SKX-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0 -; SKX-NEXT: retq +; CHECK-LABEL: insert_v32i8: +; CHECK: ## BB#0: +; CHECK-NEXT: vpinsrb $1, (%rsi), %xmm0, %xmm1 +; CHECK-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7] +; CHECK-NEXT: vextracti128 $1, %ymm0, %xmm0 +; CHECK-NEXT: vpinsrb $1, %edi, %xmm0, %xmm0 +; CHECK-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0 +; CHECK-NEXT: retq %val = load i8, i8* %ptr %r1 = insertelement <32 x i8> %x, i8 %val, i32 1 %r2 = insertelement <32 x i8> %r1, i8 %y, i32 17 @@ -1004,17 +876,11 @@ define <32 x i8> @insert_v32i8(<32 x i8> %x, i8 %y, i8* %ptr) { } define <16 x i8> @insert_v16i8(<16 x i8> %x, i8 %y, i8* %ptr) { -; KNL-LABEL: insert_v16i8: -; KNL: ## BB#0: -; KNL-NEXT: vpinsrb $3, (%rsi), %xmm0, %xmm0 -; KNL-NEXT: vpinsrb $10, %edi, %xmm0, %xmm0 -; KNL-NEXT: retq -; -; SKX-LABEL: insert_v16i8: -; SKX: ## BB#0: -; SKX-NEXT: vpinsrb $3, (%rsi), %xmm0, %xmm0 -; SKX-NEXT: vpinsrb $10, %edi, %xmm0, %xmm0 -; SKX-NEXT: retq +; CHECK-LABEL: insert_v16i8: +; CHECK: ## BB#0: +; CHECK-NEXT: vpinsrb $3, (%rsi), %xmm0, %xmm0 +; CHECK-NEXT: vpinsrb $10, %edi, %xmm0, %xmm0 +; CHECK-NEXT: retq %val = load i8, i8* %ptr %r1 = insertelement <16 x i8> %x, i8 %val, i32 3 %r2 = insertelement <16 x i8> %r1, i8 %y, i32 10 @@ -1038,17 +904,11 @@ define <8 x i64> @test_insert_128_v8i64(<8 x i64> %x, i64 %y) { } define <16 x i32> @test_insert_128_v16i32(<16 x i32> %x, i32 %y) { -; KNL-LABEL: test_insert_128_v16i32: -; KNL: ## BB#0: -; KNL-NEXT: vpinsrd $1, %edi, %xmm0, %xmm1 -; KNL-NEXT: vinserti32x4 $0, %xmm1, %zmm0, %zmm0 -; KNL-NEXT: retq -; -; SKX-LABEL: test_insert_128_v16i32: -; SKX: ## BB#0: -; SKX-NEXT: vpinsrd $1, %edi, %xmm0, %xmm1 -; SKX-NEXT: vinserti32x4 $0, %xmm1, %zmm0, %zmm0 -; SKX-NEXT: retq +; CHECK-LABEL: test_insert_128_v16i32: +; CHECK: ## BB#0: +; CHECK-NEXT: vpinsrd $1, %edi, %xmm0, %xmm1 +; CHECK-NEXT: vinserti32x4 $0, %xmm1, %zmm0, %zmm0 +; CHECK-NEXT: retq %r = insertelement <16 x i32> %x, i32 %y, i32 1 ret <16 x i32> %r } @@ -1070,53 +930,33 @@ define <8 x double> @test_insert_128_v8f64(<8 x double> %x, double %y) { } define <16 x float> @test_insert_128_v16f32(<16 x float> %x, float %y) { -; KNL-LABEL: test_insert_128_v16f32: -; KNL: ## BB#0: -; KNL-NEXT: vinsertps {{.*#+}} xmm1 = xmm0[0],xmm1[0],xmm0[2,3] -; KNL-NEXT: vinsertf32x4 $0, %xmm1, %zmm0, %zmm0 -; KNL-NEXT: retq -; -; SKX-LABEL: test_insert_128_v16f32: -; SKX: ## BB#0: -; SKX-NEXT: vinsertps {{.*#+}} xmm1 = xmm0[0],xmm1[0],xmm0[2,3] -; SKX-NEXT: vinsertf32x4 $0, %xmm1, %zmm0, %zmm0 -; SKX-NEXT: retq +; CHECK-LABEL: test_insert_128_v16f32: +; CHECK: ## BB#0: +; CHECK-NEXT: vinsertps {{.*#+}} xmm1 = xmm0[0],xmm1[0],xmm0[2,3] +; CHECK-NEXT: vinsertf32x4 $0, %xmm1, %zmm0, %zmm0 +; CHECK-NEXT: retq %r = insertelement <16 x float> %x, float %y, i32 1 ret <16 x float> %r } define <16 x i16> @test_insert_128_v16i16(<16 x i16> %x, i16 %y) { -; KNL-LABEL: test_insert_128_v16i16: -; KNL: ## BB#0: -; KNL-NEXT: vextracti128 $1, %ymm0, %xmm1 -; KNL-NEXT: vpinsrw $2, %edi, %xmm1, %xmm1 -; KNL-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0 -; KNL-NEXT: retq -; -; SKX-LABEL: test_insert_128_v16i16: -; SKX: ## BB#0: -; SKX-NEXT: vextracti128 $1, %ymm0, %xmm1 -; SKX-NEXT: vpinsrw $2, %edi, %xmm1, %xmm1 -; SKX-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0 -; SKX-NEXT: retq +; CHECK-LABEL: test_insert_128_v16i16: +; CHECK: ## BB#0: +; CHECK-NEXT: vextracti128 $1, %ymm0, %xmm1 +; CHECK-NEXT: vpinsrw $2, %edi, %xmm1, %xmm1 +; CHECK-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0 +; CHECK-NEXT: retq %r = insertelement <16 x i16> %x, i16 %y, i32 10 ret <16 x i16> %r } define <32 x i8> @test_insert_128_v32i8(<32 x i8> %x, i8 %y) { -; KNL-LABEL: test_insert_128_v32i8: -; KNL: ## BB#0: -; KNL-NEXT: vextracti128 $1, %ymm0, %xmm1 -; KNL-NEXT: vpinsrb $4, %edi, %xmm1, %xmm1 -; KNL-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0 -; KNL-NEXT: retq -; -; SKX-LABEL: test_insert_128_v32i8: -; SKX: ## BB#0: -; SKX-NEXT: vextracti128 $1, %ymm0, %xmm1 -; SKX-NEXT: vpinsrb $4, %edi, %xmm1, %xmm1 -; SKX-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0 -; SKX-NEXT: retq +; CHECK-LABEL: test_insert_128_v32i8: +; CHECK: ## BB#0: +; CHECK-NEXT: vextracti128 $1, %ymm0, %xmm1 +; CHECK-NEXT: vpinsrb $4, %edi, %xmm1, %xmm1 +; CHECK-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0 +; CHECK-NEXT: retq %r = insertelement <32 x i8> %x, i8 %y, i32 20 ret <32 x i8> %r } @@ -1591,21 +1431,13 @@ define zeroext i8 @extractelement_v64i1_alt(<64 x i8> %a, <64 x i8> %b) { } define i64 @test_extractelement_variable_v2i64(<2 x i64> %t1, i32 %index) { -; KNL-LABEL: test_extractelement_variable_v2i64: -; KNL: ## BB#0: -; KNL-NEXT: ## kill: %EDI %EDI %RDI -; KNL-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp) -; KNL-NEXT: andl $1, %edi -; KNL-NEXT: movq -24(%rsp,%rdi,8), %rax -; KNL-NEXT: retq -; -; SKX-LABEL: test_extractelement_variable_v2i64: -; SKX: ## BB#0: -; SKX-NEXT: ## kill: %EDI %EDI %RDI -; SKX-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp) -; SKX-NEXT: andl $1, %edi -; SKX-NEXT: movq -24(%rsp,%rdi,8), %rax -; SKX-NEXT: retq +; CHECK-LABEL: test_extractelement_variable_v2i64: +; CHECK: ## BB#0: +; CHECK-NEXT: ## kill: %EDI %EDI %RDI +; CHECK-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp) +; CHECK-NEXT: andl $1, %edi +; CHECK-NEXT: movq -24(%rsp,%rdi,8), %rax +; CHECK-NEXT: retq %t2 = extractelement <2 x i64> %t1, i32 %index ret i64 %t2 } @@ -1701,21 +1533,13 @@ define i64 @test_extractelement_variable_v8i64(<8 x i64> %t1, i32 %index) { } define double @test_extractelement_variable_v2f64(<2 x double> %t1, i32 %index) { -; KNL-LABEL: test_extractelement_variable_v2f64: -; KNL: ## BB#0: -; KNL-NEXT: ## kill: %EDI %EDI %RDI -; KNL-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp) -; KNL-NEXT: andl $1, %edi -; KNL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero -; KNL-NEXT: retq -; -; SKX-LABEL: test_extractelement_variable_v2f64: -; SKX: ## BB#0: -; SKX-NEXT: ## kill: %EDI %EDI %RDI -; SKX-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp) -; SKX-NEXT: andl $1, %edi -; SKX-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero -; SKX-NEXT: retq +; CHECK-LABEL: test_extractelement_variable_v2f64: +; CHECK: ## BB#0: +; CHECK-NEXT: ## kill: %EDI %EDI %RDI +; CHECK-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp) +; CHECK-NEXT: andl $1, %edi +; CHECK-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero +; CHECK-NEXT: retq %t2 = extractelement <2 x double> %t1, i32 %index ret double %t2 } @@ -1811,21 +1635,13 @@ define double @test_extractelement_variable_v8f64(<8 x double> %t1, i32 %index) } define i32 @test_extractelement_variable_v4i32(<4 x i32> %t1, i32 %index) { -; KNL-LABEL: test_extractelement_variable_v4i32: -; KNL: ## BB#0: -; KNL-NEXT: ## kill: %EDI %EDI %RDI -; KNL-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp) -; KNL-NEXT: andl $3, %edi -; KNL-NEXT: movl -24(%rsp,%rdi,4), %eax -; KNL-NEXT: retq -; -; SKX-LABEL: test_extractelement_variable_v4i32: -; SKX: ## BB#0: -; SKX-NEXT: ## kill: %EDI %EDI %RDI -; SKX-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp) -; SKX-NEXT: andl $3, %edi -; SKX-NEXT: movl -24(%rsp,%rdi,4), %eax -; SKX-NEXT: retq +; CHECK-LABEL: test_extractelement_variable_v4i32: +; CHECK: ## BB#0: +; CHECK-NEXT: ## kill: %EDI %EDI %RDI +; CHECK-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp) +; CHECK-NEXT: andl $3, %edi +; CHECK-NEXT: movl -24(%rsp,%rdi,4), %eax +; CHECK-NEXT: retq %t2 = extractelement <4 x i32> %t1, i32 %index ret i32 %t2 } @@ -1921,21 +1737,13 @@ define i32 @test_extractelement_variable_v16i32(<16 x i32> %t1, i32 %index) { } define float @test_extractelement_variable_v4f32(<4 x float> %t1, i32 %index) { -; KNL-LABEL: test_extractelement_variable_v4f32: -; KNL: ## BB#0: -; KNL-NEXT: ## kill: %EDI %EDI %RDI -; KNL-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp) -; KNL-NEXT: andl $3, %edi -; KNL-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; KNL-NEXT: retq -; -; SKX-LABEL: test_extractelement_variable_v4f32: -; SKX: ## BB#0: -; SKX-NEXT: ## kill: %EDI %EDI %RDI -; SKX-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp) -; SKX-NEXT: andl $3, %edi -; SKX-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; SKX-NEXT: retq +; CHECK-LABEL: test_extractelement_variable_v4f32: +; CHECK: ## BB#0: +; CHECK-NEXT: ## kill: %EDI %EDI %RDI +; CHECK-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp) +; CHECK-NEXT: andl $3, %edi +; CHECK-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; CHECK-NEXT: retq %t2 = extractelement <4 x float> %t1, i32 %index ret float %t2 }