diff options
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/X86/avx512-vec-cmp.ll | 426 |
1 files changed, 283 insertions, 143 deletions
diff --git a/llvm/test/CodeGen/X86/avx512-vec-cmp.ll b/llvm/test/CodeGen/X86/avx512-vec-cmp.ll index 236bde56e7e..a141b8773a0 100644 --- a/llvm/test/CodeGen/X86/avx512-vec-cmp.ll +++ b/llvm/test/CodeGen/X86/avx512-vec-cmp.ll @@ -1,5 +1,6 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx512f | FileCheck %s --check-prefix=CHECK --check-prefix=KNL +; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx512f | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=KNL +; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512BW ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+avx512f,+avx512bw,+avx512vl,+avx512dq | FileCheck %s --check-prefix=CHECK --check-prefix=SKX define <16 x float> @test1(<16 x float> %x, <16 x float> %y) nounwind { @@ -70,16 +71,16 @@ define <8 x i64> @test6_unsigned(<8 x i64> %x, <8 x i64> %y, <8 x i64> %x1) noun } define <4 x float> @test7(<4 x float> %a, <4 x float> %b) { -; KNL-LABEL: test7: -; KNL: ## %bb.0: -; KNL-NEXT: ## kill: def %xmm1 killed %xmm1 def %zmm1 -; KNL-NEXT: ## kill: def %xmm0 killed %xmm0 def %zmm0 -; KNL-NEXT: vxorps %xmm2, %xmm2, %xmm2 -; KNL-NEXT: vcmpltps %zmm2, %zmm0, %k1 -; KNL-NEXT: vblendmps %zmm0, %zmm1, %zmm0 {%k1} -; KNL-NEXT: ## kill: def %xmm0 killed %xmm0 killed %zmm0 -; KNL-NEXT: vzeroupper -; KNL-NEXT: retq +; AVX512-LABEL: test7: +; AVX512: ## %bb.0: +; AVX512-NEXT: ## kill: def %xmm1 killed %xmm1 def %zmm1 +; AVX512-NEXT: ## kill: def %xmm0 killed %xmm0 def %zmm0 +; AVX512-NEXT: vxorps %xmm2, %xmm2, %xmm2 +; AVX512-NEXT: vcmpltps %zmm2, %zmm0, %k1 +; AVX512-NEXT: vblendmps %zmm0, %zmm1, %zmm0 {%k1} +; AVX512-NEXT: ## kill: def %xmm0 killed %xmm0 killed %zmm0 +; AVX512-NEXT: vzeroupper +; AVX512-NEXT: retq ; ; SKX-LABEL: test7: ; SKX: ## %bb.0: @@ -94,16 +95,16 @@ define <4 x float> @test7(<4 x float> %a, <4 x float> %b) { } define <2 x double> @test8(<2 x double> %a, <2 x double> %b) { -; KNL-LABEL: test8: -; KNL: ## %bb.0: -; KNL-NEXT: ## kill: def %xmm1 killed %xmm1 def %zmm1 -; KNL-NEXT: ## kill: def %xmm0 killed %xmm0 def %zmm0 -; KNL-NEXT: vxorpd %xmm2, %xmm2, %xmm2 -; KNL-NEXT: vcmpltpd %zmm2, %zmm0, %k1 -; KNL-NEXT: vblendmpd %zmm0, %zmm1, %zmm0 {%k1} -; KNL-NEXT: ## kill: def %xmm0 killed %xmm0 killed %zmm0 -; KNL-NEXT: vzeroupper -; KNL-NEXT: retq +; AVX512-LABEL: test8: +; AVX512: ## %bb.0: +; AVX512-NEXT: ## kill: def %xmm1 killed %xmm1 def %zmm1 +; AVX512-NEXT: ## kill: def %xmm0 killed %xmm0 def %zmm0 +; AVX512-NEXT: vxorpd %xmm2, %xmm2, %xmm2 +; AVX512-NEXT: vcmpltpd %zmm2, %zmm0, %k1 +; AVX512-NEXT: vblendmpd %zmm0, %zmm1, %zmm0 {%k1} +; AVX512-NEXT: ## kill: def %xmm0 killed %xmm0 killed %zmm0 +; AVX512-NEXT: vzeroupper +; AVX512-NEXT: retq ; ; SKX-LABEL: test8: ; SKX: ## %bb.0: @@ -117,14 +118,14 @@ define <2 x double> @test8(<2 x double> %a, <2 x double> %b) { } define <8 x i32> @test9(<8 x i32> %x, <8 x i32> %y) nounwind { -; KNL-LABEL: test9: -; KNL: ## %bb.0: -; KNL-NEXT: ## kill: def %ymm1 killed %ymm1 def %zmm1 -; KNL-NEXT: ## kill: def %ymm0 killed %ymm0 def %zmm0 -; KNL-NEXT: vpcmpeqd %zmm1, %zmm0, %k1 -; KNL-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1} -; KNL-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 -; KNL-NEXT: retq +; AVX512-LABEL: test9: +; AVX512: ## %bb.0: +; AVX512-NEXT: ## kill: def %ymm1 killed %ymm1 def %zmm1 +; AVX512-NEXT: ## kill: def %ymm0 killed %ymm0 def %zmm0 +; AVX512-NEXT: vpcmpeqd %zmm1, %zmm0, %k1 +; AVX512-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1} +; AVX512-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 +; AVX512-NEXT: retq ; ; SKX-LABEL: test9: ; SKX: ## %bb.0: @@ -137,14 +138,14 @@ define <8 x i32> @test9(<8 x i32> %x, <8 x i32> %y) nounwind { } define <8 x float> @test10(<8 x float> %x, <8 x float> %y) nounwind { -; KNL-LABEL: test10: -; KNL: ## %bb.0: -; KNL-NEXT: ## kill: def %ymm1 killed %ymm1 def %zmm1 -; KNL-NEXT: ## kill: def %ymm0 killed %ymm0 def %zmm0 -; KNL-NEXT: vcmpeqps %zmm1, %zmm0, %k1 -; KNL-NEXT: vblendmps %zmm0, %zmm1, %zmm0 {%k1} -; KNL-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 -; KNL-NEXT: retq +; AVX512-LABEL: test10: +; AVX512: ## %bb.0: +; AVX512-NEXT: ## kill: def %ymm1 killed %ymm1 def %zmm1 +; AVX512-NEXT: ## kill: def %ymm0 killed %ymm0 def %zmm0 +; AVX512-NEXT: vcmpeqps %zmm1, %zmm0, %k1 +; AVX512-NEXT: vblendmps %zmm0, %zmm1, %zmm0 {%k1} +; AVX512-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 +; AVX512-NEXT: retq ; ; SKX-LABEL: test10: ; SKX: ## %bb.0: @@ -178,6 +179,16 @@ define i16 @test12(<16 x i64> %a, <16 x i64> %b) nounwind { ; KNL-NEXT: vzeroupper ; KNL-NEXT: retq ; +; AVX512BW-LABEL: test12: +; AVX512BW: ## %bb.0: +; AVX512BW-NEXT: vpcmpeqq %zmm2, %zmm0, %k0 +; AVX512BW-NEXT: vpcmpeqq %zmm3, %zmm1, %k1 +; AVX512BW-NEXT: kunpckbw %k0, %k1, %k0 +; AVX512BW-NEXT: kmovd %k0, %eax +; AVX512BW-NEXT: ## kill: def %ax killed %ax killed %eax +; AVX512BW-NEXT: vzeroupper +; AVX512BW-NEXT: retq +; ; SKX-LABEL: test12: ; SKX: ## %bb.0: ; SKX-NEXT: vpcmpeqq %zmm2, %zmm0, %k0 @@ -217,6 +228,15 @@ define i32 @test12_v32i32(<32 x i32> %a, <32 x i32> %b) nounwind { ; KNL-NEXT: vzeroupper ; KNL-NEXT: retq ; +; AVX512BW-LABEL: test12_v32i32: +; AVX512BW: ## %bb.0: +; AVX512BW-NEXT: vpcmpeqd %zmm2, %zmm0, %k0 +; AVX512BW-NEXT: vpcmpeqd %zmm3, %zmm1, %k1 +; AVX512BW-NEXT: kunpckwd %k0, %k1, %k0 +; AVX512BW-NEXT: kmovd %k0, %eax +; AVX512BW-NEXT: vzeroupper +; AVX512BW-NEXT: retq +; ; SKX-LABEL: test12_v32i32: ; SKX: ## %bb.0: ; SKX-NEXT: vpcmpeqd %zmm2, %zmm0, %k0 @@ -270,6 +290,15 @@ define i64 @test12_v64i16(<64 x i16> %a, <64 x i16> %b) nounwind { ; KNL-NEXT: vzeroupper ; KNL-NEXT: retq ; +; AVX512BW-LABEL: test12_v64i16: +; AVX512BW: ## %bb.0: +; AVX512BW-NEXT: vpcmpeqw %zmm2, %zmm0, %k0 +; AVX512BW-NEXT: vpcmpeqw %zmm3, %zmm1, %k1 +; AVX512BW-NEXT: kunpckdq %k0, %k1, %k0 +; AVX512BW-NEXT: kmovq %k0, %rax +; AVX512BW-NEXT: vzeroupper +; AVX512BW-NEXT: retq +; ; SKX-LABEL: test12_v64i16: ; SKX: ## %bb.0: ; SKX-NEXT: vpcmpeqw %zmm2, %zmm0, %k0 @@ -493,14 +522,14 @@ define <8 x i64> @test27(<8 x i64> %x, i64* %yb.ptr, <8 x i64> %x1, <8 x i64> %y } define <8 x i32>@test28(<8 x i64> %x, <8 x i64> %y, <8 x i64> %x1, <8 x i64> %y1) { -; KNL-LABEL: test28: -; KNL: ## %bb.0: -; KNL-NEXT: vpcmpgtq %zmm1, %zmm0, %k0 -; KNL-NEXT: vpcmpgtq %zmm3, %zmm2, %k1 -; KNL-NEXT: kxnorw %k1, %k0, %k1 -; KNL-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z} -; KNL-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 -; KNL-NEXT: retq +; AVX512-LABEL: test28: +; AVX512: ## %bb.0: +; AVX512-NEXT: vpcmpgtq %zmm1, %zmm0, %k0 +; AVX512-NEXT: vpcmpgtq %zmm3, %zmm2, %k1 +; AVX512-NEXT: kxnorw %k1, %k0, %k1 +; AVX512-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z} +; AVX512-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 +; AVX512-NEXT: retq ; ; SKX-LABEL: test28: ; SKX: ## %bb.0: @@ -527,6 +556,16 @@ define <16 x i8>@test29(<16 x i32> %x, <16 x i32> %y, <16 x i32> %x1, <16 x i32> ; KNL-NEXT: vzeroupper ; KNL-NEXT: retq ; +; AVX512BW-LABEL: test29: +; AVX512BW: ## %bb.0: +; AVX512BW-NEXT: vpcmpgtd %zmm1, %zmm0, %k0 +; AVX512BW-NEXT: vpcmpgtd %zmm3, %zmm2, %k1 +; AVX512BW-NEXT: kxorw %k1, %k0, %k0 +; AVX512BW-NEXT: vpmovm2b %k0, %zmm0 +; AVX512BW-NEXT: ## kill: def %xmm0 killed %xmm0 killed %zmm0 +; AVX512BW-NEXT: vzeroupper +; AVX512BW-NEXT: retq +; ; SKX-LABEL: test29: ; SKX: ## %bb.0: ; SKX-NEXT: vpcmpgtd %zmm1, %zmm0, %k0 @@ -543,14 +582,14 @@ define <16 x i8>@test29(<16 x i32> %x, <16 x i32> %y, <16 x i32> %x1, <16 x i32> } define <4 x double> @test30(<4 x double> %x, <4 x double> %y) nounwind { -; KNL-LABEL: test30: -; KNL: ## %bb.0: -; KNL-NEXT: ## kill: def %ymm1 killed %ymm1 def %zmm1 -; KNL-NEXT: ## kill: def %ymm0 killed %ymm0 def %zmm0 -; KNL-NEXT: vcmpeqpd %zmm1, %zmm0, %k1 -; KNL-NEXT: vblendmpd %zmm0, %zmm1, %zmm0 {%k1} -; KNL-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 -; KNL-NEXT: retq +; AVX512-LABEL: test30: +; AVX512: ## %bb.0: +; AVX512-NEXT: ## kill: def %ymm1 killed %ymm1 def %zmm1 +; AVX512-NEXT: ## kill: def %ymm0 killed %ymm0 def %zmm0 +; AVX512-NEXT: vcmpeqpd %zmm1, %zmm0, %k1 +; AVX512-NEXT: vblendmpd %zmm0, %zmm1, %zmm0 {%k1} +; AVX512-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 +; AVX512-NEXT: retq ; ; SKX-LABEL: test30: ; SKX: ## %bb.0: @@ -564,16 +603,16 @@ define <4 x double> @test30(<4 x double> %x, <4 x double> %y) nounwind { } define <2 x double> @test31(<2 x double> %x, <2 x double> %x1, <2 x double>* %yp) nounwind { -; KNL-LABEL: test31: -; KNL: ## %bb.0: -; KNL-NEXT: ## kill: def %xmm1 killed %xmm1 def %zmm1 -; KNL-NEXT: ## kill: def %xmm0 killed %xmm0 def %zmm0 -; KNL-NEXT: vmovupd (%rdi), %xmm2 -; KNL-NEXT: vcmpltpd %zmm2, %zmm0, %k1 -; KNL-NEXT: vblendmpd %zmm0, %zmm1, %zmm0 {%k1} -; KNL-NEXT: ## kill: def %xmm0 killed %xmm0 killed %zmm0 -; KNL-NEXT: vzeroupper -; KNL-NEXT: retq +; AVX512-LABEL: test31: +; AVX512: ## %bb.0: +; AVX512-NEXT: ## kill: def %xmm1 killed %xmm1 def %zmm1 +; AVX512-NEXT: ## kill: def %xmm0 killed %xmm0 def %zmm0 +; AVX512-NEXT: vmovupd (%rdi), %xmm2 +; AVX512-NEXT: vcmpltpd %zmm2, %zmm0, %k1 +; AVX512-NEXT: vblendmpd %zmm0, %zmm1, %zmm0 {%k1} +; AVX512-NEXT: ## kill: def %xmm0 killed %xmm0 killed %zmm0 +; AVX512-NEXT: vzeroupper +; AVX512-NEXT: retq ; ; SKX-LABEL: test31: ; SKX: ## %bb.0: @@ -588,15 +627,15 @@ define <2 x double> @test31(<2 x double> %x, <2 x double> %x1, <2 x double>* %yp } define <4 x double> @test32(<4 x double> %x, <4 x double> %x1, <4 x double>* %yp) nounwind { -; KNL-LABEL: test32: -; KNL: ## %bb.0: -; KNL-NEXT: ## kill: def %ymm1 killed %ymm1 def %zmm1 -; KNL-NEXT: ## kill: def %ymm0 killed %ymm0 def %zmm0 -; KNL-NEXT: vmovupd (%rdi), %ymm2 -; KNL-NEXT: vcmpltpd %zmm2, %zmm0, %k1 -; KNL-NEXT: vblendmpd %zmm0, %zmm1, %zmm0 {%k1} -; KNL-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 -; KNL-NEXT: retq +; AVX512-LABEL: test32: +; AVX512: ## %bb.0: +; AVX512-NEXT: ## kill: def %ymm1 killed %ymm1 def %zmm1 +; AVX512-NEXT: ## kill: def %ymm0 killed %ymm0 def %zmm0 +; AVX512-NEXT: vmovupd (%rdi), %ymm2 +; AVX512-NEXT: vcmpltpd %zmm2, %zmm0, %k1 +; AVX512-NEXT: vblendmpd %zmm0, %zmm1, %zmm0 {%k1} +; AVX512-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 +; AVX512-NEXT: retq ; ; SKX-LABEL: test32: ; SKX: ## %bb.0: @@ -623,16 +662,16 @@ define <8 x double> @test33(<8 x double> %x, <8 x double> %x1, <8 x double>* %yp } define <4 x float> @test34(<4 x float> %x, <4 x float> %x1, <4 x float>* %yp) nounwind { -; KNL-LABEL: test34: -; KNL: ## %bb.0: -; KNL-NEXT: ## kill: def %xmm1 killed %xmm1 def %zmm1 -; KNL-NEXT: ## kill: def %xmm0 killed %xmm0 def %zmm0 -; KNL-NEXT: vmovups (%rdi), %xmm2 -; KNL-NEXT: vcmpltps %zmm2, %zmm0, %k1 -; KNL-NEXT: vblendmps %zmm0, %zmm1, %zmm0 {%k1} -; KNL-NEXT: ## kill: def %xmm0 killed %xmm0 killed %zmm0 -; KNL-NEXT: vzeroupper -; KNL-NEXT: retq +; AVX512-LABEL: test34: +; AVX512: ## %bb.0: +; AVX512-NEXT: ## kill: def %xmm1 killed %xmm1 def %zmm1 +; AVX512-NEXT: ## kill: def %xmm0 killed %xmm0 def %zmm0 +; AVX512-NEXT: vmovups (%rdi), %xmm2 +; AVX512-NEXT: vcmpltps %zmm2, %zmm0, %k1 +; AVX512-NEXT: vblendmps %zmm0, %zmm1, %zmm0 {%k1} +; AVX512-NEXT: ## kill: def %xmm0 killed %xmm0 killed %zmm0 +; AVX512-NEXT: vzeroupper +; AVX512-NEXT: retq ; ; SKX-LABEL: test34: ; SKX: ## %bb.0: @@ -646,15 +685,15 @@ define <4 x float> @test34(<4 x float> %x, <4 x float> %x1, <4 x float>* %yp) no } define <8 x float> @test35(<8 x float> %x, <8 x float> %x1, <8 x float>* %yp) nounwind { -; KNL-LABEL: test35: -; KNL: ## %bb.0: -; KNL-NEXT: ## kill: def %ymm1 killed %ymm1 def %zmm1 -; KNL-NEXT: ## kill: def %ymm0 killed %ymm0 def %zmm0 -; KNL-NEXT: vmovups (%rdi), %ymm2 -; KNL-NEXT: vcmpltps %zmm2, %zmm0, %k1 -; KNL-NEXT: vblendmps %zmm0, %zmm1, %zmm0 {%k1} -; KNL-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 -; KNL-NEXT: retq +; AVX512-LABEL: test35: +; AVX512: ## %bb.0: +; AVX512-NEXT: ## kill: def %ymm1 killed %ymm1 def %zmm1 +; AVX512-NEXT: ## kill: def %ymm0 killed %ymm0 def %zmm0 +; AVX512-NEXT: vmovups (%rdi), %ymm2 +; AVX512-NEXT: vcmpltps %zmm2, %zmm0, %k1 +; AVX512-NEXT: vblendmps %zmm0, %zmm1, %zmm0 {%k1} +; AVX512-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 +; AVX512-NEXT: retq ; ; SKX-LABEL: test35: ; SKX: ## %bb.0: @@ -697,15 +736,15 @@ define <8 x double> @test37(<8 x double> %x, <8 x double> %x1, double* %ptr) nou } define <4 x double> @test38(<4 x double> %x, <4 x double> %x1, double* %ptr) nounwind { -; KNL-LABEL: test38: -; KNL: ## %bb.0: -; KNL-NEXT: ## kill: def %ymm1 killed %ymm1 def %zmm1 -; KNL-NEXT: ## kill: def %ymm0 killed %ymm0 def %zmm0 -; KNL-NEXT: vbroadcastsd (%rdi), %ymm2 -; KNL-NEXT: vcmpltpd %zmm2, %zmm0, %k1 -; KNL-NEXT: vblendmpd %zmm0, %zmm1, %zmm0 {%k1} -; KNL-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 -; KNL-NEXT: retq +; AVX512-LABEL: test38: +; AVX512: ## %bb.0: +; AVX512-NEXT: ## kill: def %ymm1 killed %ymm1 def %zmm1 +; AVX512-NEXT: ## kill: def %ymm0 killed %ymm0 def %zmm0 +; AVX512-NEXT: vbroadcastsd (%rdi), %ymm2 +; AVX512-NEXT: vcmpltpd %zmm2, %zmm0, %k1 +; AVX512-NEXT: vblendmpd %zmm0, %zmm1, %zmm0 {%k1} +; AVX512-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 +; AVX512-NEXT: retq ; ; SKX-LABEL: test38: ; SKX: ## %bb.0: @@ -723,16 +762,16 @@ define <4 x double> @test38(<4 x double> %x, <4 x double> %x1, double* %ptr) nou } define <2 x double> @test39(<2 x double> %x, <2 x double> %x1, double* %ptr) nounwind { -; KNL-LABEL: test39: -; KNL: ## %bb.0: -; KNL-NEXT: ## kill: def %xmm1 killed %xmm1 def %zmm1 -; KNL-NEXT: ## kill: def %xmm0 killed %xmm0 def %zmm0 -; KNL-NEXT: vmovddup {{.*#+}} xmm2 = mem[0,0] -; KNL-NEXT: vcmpltpd %zmm2, %zmm0, %k1 -; KNL-NEXT: vblendmpd %zmm0, %zmm1, %zmm0 {%k1} -; KNL-NEXT: ## kill: def %xmm0 killed %xmm0 killed %zmm0 -; KNL-NEXT: vzeroupper -; KNL-NEXT: retq +; AVX512-LABEL: test39: +; AVX512: ## %bb.0: +; AVX512-NEXT: ## kill: def %xmm1 killed %xmm1 def %zmm1 +; AVX512-NEXT: ## kill: def %xmm0 killed %xmm0 def %zmm0 +; AVX512-NEXT: vmovddup {{.*#+}} xmm2 = mem[0,0] +; AVX512-NEXT: vcmpltpd %zmm2, %zmm0, %k1 +; AVX512-NEXT: vblendmpd %zmm0, %zmm1, %zmm0 {%k1} +; AVX512-NEXT: ## kill: def %xmm0 killed %xmm0 killed %zmm0 +; AVX512-NEXT: vzeroupper +; AVX512-NEXT: retq ; ; SKX-LABEL: test39: ; SKX: ## %bb.0: @@ -767,15 +806,15 @@ define <16 x float> @test40(<16 x float> %x, <16 x float> %x1, float* %ptr) n } define <8 x float> @test41(<8 x float> %x, <8 x float> %x1, float* %ptr) nounwind { -; KNL-LABEL: test41: -; KNL: ## %bb.0: -; KNL-NEXT: ## kill: def %ymm1 killed %ymm1 def %zmm1 -; KNL-NEXT: ## kill: def %ymm0 killed %ymm0 def %zmm0 -; KNL-NEXT: vbroadcastss (%rdi), %ymm2 -; KNL-NEXT: vcmpltps %zmm2, %zmm0, %k1 -; KNL-NEXT: vblendmps %zmm0, %zmm1, %zmm0 {%k1} -; KNL-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 -; KNL-NEXT: retq +; AVX512-LABEL: test41: +; AVX512: ## %bb.0: +; AVX512-NEXT: ## kill: def %ymm1 killed %ymm1 def %zmm1 +; AVX512-NEXT: ## kill: def %ymm0 killed %ymm0 def %zmm0 +; AVX512-NEXT: vbroadcastss (%rdi), %ymm2 +; AVX512-NEXT: vcmpltps %zmm2, %zmm0, %k1 +; AVX512-NEXT: vblendmps %zmm0, %zmm1, %zmm0 {%k1} +; AVX512-NEXT: ## kill: def %ymm0 killed %ymm0 killed %zmm0 +; AVX512-NEXT: retq ; ; SKX-LABEL: test41: ; SKX: ## %bb.0: @@ -793,16 +832,16 @@ define <8 x float> @test41(<8 x float> %x, <8 x float> %x1, float* %ptr) noun } define <4 x float> @test42(<4 x float> %x, <4 x float> %x1, float* %ptr) nounwind { -; KNL-LABEL: test42: -; KNL: ## %bb.0: -; KNL-NEXT: ## kill: def %xmm1 killed %xmm1 def %zmm1 -; KNL-NEXT: ## kill: def %xmm0 killed %xmm0 def %zmm0 -; KNL-NEXT: vbroadcastss (%rdi), %xmm2 -; KNL-NEXT: vcmpltps %zmm2, %zmm0, %k1 -; KNL-NEXT: vblendmps %zmm0, %zmm1, %zmm0 {%k1} -; KNL-NEXT: ## kill: def %xmm0 killed %xmm0 killed %zmm0 -; KNL-NEXT: vzeroupper -; KNL-NEXT: retq +; AVX512-LABEL: test42: +; AVX512: ## %bb.0: +; AVX512-NEXT: ## kill: def %xmm1 killed %xmm1 def %zmm1 +; AVX512-NEXT: ## kill: def %xmm0 killed %xmm0 def %zmm0 +; AVX512-NEXT: vbroadcastss (%rdi), %xmm2 +; AVX512-NEXT: vcmpltps %zmm2, %zmm0, %k1 +; AVX512-NEXT: vblendmps %zmm0, %zmm1, %zmm0 {%k1} +; AVX512-NEXT: ## kill: def %xmm0 killed %xmm0 killed %zmm0 +; AVX512-NEXT: vzeroupper +; AVX512-NEXT: retq ; ; SKX-LABEL: test42: ; SKX: ## %bb.0: @@ -829,6 +868,14 @@ define <8 x double> @test43(<8 x double> %x, <8 x double> %x1, double* %ptr,<8 x ; KNL-NEXT: vblendmpd %zmm0, %zmm1, %zmm0 {%k1} ; KNL-NEXT: retq ; +; AVX512BW-LABEL: test43: +; AVX512BW: ## %bb.0: +; AVX512BW-NEXT: vpsllw $15, %xmm2, %xmm2 +; AVX512BW-NEXT: vpmovw2m %zmm2, %k1 +; AVX512BW-NEXT: vcmpltpd (%rdi){1to8}, %zmm0, %k1 {%k1} +; AVX512BW-NEXT: vblendmpd %zmm0, %zmm1, %zmm0 {%k1} +; AVX512BW-NEXT: retq +; ; SKX-LABEL: test43: ; SKX: ## %bb.0: ; SKX-NEXT: vpsllw $15, %xmm2, %xmm2 @@ -861,14 +908,14 @@ define <4 x i32> @test44(<4 x i16> %x, <4 x i16> %y) #0 { } define <2 x i64> @test45(<2 x i16> %x, <2 x i16> %y) #0 { -; KNL-LABEL: test45: -; KNL: ## %bb.0: -; KNL-NEXT: vpxor %xmm2, %xmm2, %xmm2 -; KNL-NEXT: vpblendw {{.*#+}} xmm1 = xmm1[0],xmm2[1,2,3],xmm1[4],xmm2[5,6,7] -; KNL-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0],xmm2[1,2,3],xmm0[4],xmm2[5,6,7] -; KNL-NEXT: vpcmpeqq %xmm1, %xmm0, %xmm0 -; KNL-NEXT: vpsrlq $63, %xmm0, %xmm0 -; KNL-NEXT: retq +; AVX512-LABEL: test45: +; AVX512: ## %bb.0: +; AVX512-NEXT: vpxor %xmm2, %xmm2, %xmm2 +; AVX512-NEXT: vpblendw {{.*#+}} xmm1 = xmm1[0],xmm2[1,2,3],xmm1[4],xmm2[5,6,7] +; AVX512-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0],xmm2[1,2,3],xmm0[4],xmm2[5,6,7] +; AVX512-NEXT: vpcmpeqq %xmm1, %xmm0, %xmm0 +; AVX512-NEXT: vpsrlq $63, %xmm0, %xmm0 +; AVX512-NEXT: retq ; ; SKX-LABEL: test45: ; SKX: ## %bb.0: @@ -884,12 +931,12 @@ define <2 x i64> @test45(<2 x i16> %x, <2 x i16> %y) #0 { } define <2 x i64> @test46(<2 x float> %x, <2 x float> %y) #0 { -; KNL-LABEL: test46: -; KNL: ## %bb.0: -; KNL-NEXT: vcmpeqps %xmm1, %xmm0, %xmm0 -; KNL-NEXT: vpmovsxdq %xmm0, %xmm0 -; KNL-NEXT: vpsrlq $63, %xmm0, %xmm0 -; KNL-NEXT: retq +; AVX512-LABEL: test46: +; AVX512: ## %bb.0: +; AVX512-NEXT: vcmpeqps %xmm1, %xmm0, %xmm0 +; AVX512-NEXT: vpmovsxdq %xmm0, %xmm0 +; AVX512-NEXT: vpsrlq $63, %xmm0, %xmm0 +; AVX512-NEXT: retq ; ; SKX-LABEL: test46: ; SKX: ## %bb.0: @@ -900,3 +947,96 @@ define <2 x i64> @test46(<2 x float> %x, <2 x float> %y) #0 { %1 = zext <2 x i1> %mask to <2 x i64> ret <2 x i64> %1 } + +define <16 x i8> @test47(<16 x i32> %a, <16 x i8> %b, <16 x i8> %c) { +; KNL-LABEL: test47: +; KNL: ## %bb.0: +; KNL-NEXT: vpxor %xmm3, %xmm3, %xmm3 +; KNL-NEXT: vpcmpeqd %zmm3, %zmm0, %k1 +; KNL-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z} +; KNL-NEXT: vpmovdb %zmm0, %xmm0 +; KNL-NEXT: vpblendvb %xmm0, %xmm1, %xmm2, %xmm0 +; KNL-NEXT: vzeroupper +; KNL-NEXT: retq +; +; AVX512BW-LABEL: test47: +; AVX512BW: ## %bb.0: +; AVX512BW-NEXT: vpxor %xmm3, %xmm3, %xmm3 +; AVX512BW-NEXT: vpcmpeqd %zmm3, %zmm0, %k0 +; AVX512BW-NEXT: vpmovm2b %k0, %zmm0 +; AVX512BW-NEXT: vpblendvb %xmm0, %xmm1, %xmm2, %xmm0 +; AVX512BW-NEXT: vzeroupper +; AVX512BW-NEXT: retq +; +; SKX-LABEL: test47: +; SKX: ## %bb.0: +; SKX-NEXT: vpxor %xmm3, %xmm3, %xmm3 +; SKX-NEXT: vpcmpeqd %zmm3, %zmm0, %k1 +; SKX-NEXT: vpblendmb %xmm1, %xmm2, %xmm0 {%k1} +; SKX-NEXT: vzeroupper +; SKX-NEXT: retq + %cmp = icmp eq <16 x i32> %a, zeroinitializer + %res = select <16 x i1> %cmp, <16 x i8> %b, <16 x i8> %c + ret <16 x i8> %res +} + +define <16 x i16> @test48(<16 x i32> %a, <16 x i16> %b, <16 x i16> %c) { +; KNL-LABEL: test48: +; KNL: ## %bb.0: +; KNL-NEXT: vpxor %xmm3, %xmm3, %xmm3 +; KNL-NEXT: vpcmpeqd %zmm3, %zmm0, %k1 +; KNL-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z} +; KNL-NEXT: vpmovdw %zmm0, %ymm0 +; KNL-NEXT: vpblendvb %ymm0, %ymm1, %ymm2, %ymm0 +; KNL-NEXT: retq +; +; AVX512BW-LABEL: test48: +; AVX512BW: ## %bb.0: +; AVX512BW-NEXT: vpxor %xmm3, %xmm3, %xmm3 +; AVX512BW-NEXT: vpcmpeqd %zmm3, %zmm0, %k0 +; AVX512BW-NEXT: vpmovm2w %k0, %zmm0 +; AVX512BW-NEXT: vpblendvb %ymm0, %ymm1, %ymm2, %ymm0 +; AVX512BW-NEXT: retq +; +; SKX-LABEL: test48: +; SKX: ## %bb.0: +; SKX-NEXT: vpxor %xmm3, %xmm3, %xmm3 +; SKX-NEXT: vpcmpeqd %zmm3, %zmm0, %k1 +; SKX-NEXT: vpblendmw %ymm1, %ymm2, %ymm0 {%k1} +; SKX-NEXT: retq + %cmp = icmp eq <16 x i32> %a, zeroinitializer + %res = select <16 x i1> %cmp, <16 x i16> %b, <16 x i16> %c + ret <16 x i16> %res +} + +define <8 x i16> @test49(<8 x i64> %a, <8 x i16> %b, <8 x i16> %c) { +; KNL-LABEL: test49: +; KNL: ## %bb.0: +; KNL-NEXT: vpxor %xmm3, %xmm3, %xmm3 +; KNL-NEXT: vpcmpeqq %zmm3, %zmm0, %k1 +; KNL-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z} +; KNL-NEXT: vpmovdw %zmm0, %ymm0 +; KNL-NEXT: vpblendvb %xmm0, %xmm1, %xmm2, %xmm0 +; KNL-NEXT: vzeroupper +; KNL-NEXT: retq +; +; AVX512BW-LABEL: test49: +; AVX512BW: ## %bb.0: +; AVX512BW-NEXT: vpxor %xmm3, %xmm3, %xmm3 +; AVX512BW-NEXT: vpcmpeqq %zmm3, %zmm0, %k0 +; AVX512BW-NEXT: vpmovm2w %k0, %zmm0 +; AVX512BW-NEXT: vpblendvb %xmm0, %xmm1, %xmm2, %xmm0 +; AVX512BW-NEXT: vzeroupper +; AVX512BW-NEXT: retq +; +; SKX-LABEL: test49: +; SKX: ## %bb.0: +; SKX-NEXT: vpxor %xmm3, %xmm3, %xmm3 +; SKX-NEXT: vpcmpeqq %zmm3, %zmm0, %k1 +; SKX-NEXT: vpblendmw %xmm1, %xmm2, %xmm0 {%k1} +; SKX-NEXT: vzeroupper +; SKX-NEXT: retq + %cmp = icmp eq <8 x i64> %a, zeroinitializer + %res = select <8 x i1> %cmp, <8 x i16> %b, <8 x i16> %c + ret <8 x i16> %res +} |

