diff options
Diffstat (limited to 'llvm/test/CodeGen/X86/avx512-intrinsics-fast-isel.ll')
| -rw-r--r-- | llvm/test/CodeGen/X86/avx512-intrinsics-fast-isel.ll | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/avx512-intrinsics-fast-isel.ll b/llvm/test/CodeGen/X86/avx512-intrinsics-fast-isel.ll index 061d0a406ce..84e12ba7974 100644 --- a/llvm/test/CodeGen/X86/avx512-intrinsics-fast-isel.ll +++ b/llvm/test/CodeGen/X86/avx512-intrinsics-fast-isel.ll @@ -264,6 +264,110 @@ define <16 x float> @test_mm512_maskz_permute_ps(i16 %a0, <16 x float> %a1) { ret <16 x float> %res1 } +define <8 x i64> @test_mm512_permutex_epi64(<8 x i64> %a0) { +; X32-LABEL: test_mm512_permutex_epi64: +; X32: # BB#0: +; X32-NEXT: vpermq {{.*#+}} zmm0 = zmm0[0,0,0,0,4,4,4,4] +; X32-NEXT: retl +; +; X64-LABEL: test_mm512_permutex_epi64: +; X64: # BB#0: +; X64-NEXT: vpermq {{.*#+}} zmm0 = zmm0[0,0,0,0,4,4,4,4] +; X64-NEXT: retq + %res = shufflevector <8 x i64> %a0, <8 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 4, i32 4, i32 4, i32 4> + ret <8 x i64> %res +} + +define <8 x i64> @test_mm512_mask_permutex_epi64(<8 x i64> %a0, i8 %a1, <8 x i64> %a2) { +; X32-LABEL: test_mm512_mask_permutex_epi64: +; X32: # BB#0: +; X32-NEXT: movb {{[0-9]+}}(%esp), %al +; X32-NEXT: kmovw %eax, %k1 +; X32-NEXT: vpermq {{.*#+}} zmm0 {%k1} = zmm1[0,0,0,0,4,4,4,4] +; X32-NEXT: retl +; +; X64-LABEL: test_mm512_mask_permutex_epi64: +; X64: # BB#0: +; X64-NEXT: kmovw %edi, %k1 +; X64-NEXT: vpermq {{.*#+}} zmm0 {%k1} = zmm1[0,0,0,0,4,4,4,4] +; X64-NEXT: retq + %arg1 = bitcast i8 %a1 to <8 x i1> + %res0 = shufflevector <8 x i64> %a2, <8 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 4, i32 4, i32 4, i32 4> + %res1 = select <8 x i1> %arg1, <8 x i64> %res0, <8 x i64> %a0 + ret <8 x i64> %res1 +} + +define <8 x i64> @test_mm512_maskz_permutex_epi64(i8 %a0, <8 x i64> %a1) { +; X32-LABEL: test_mm512_maskz_permutex_epi64: +; X32: # BB#0: +; X32-NEXT: movb {{[0-9]+}}(%esp), %al +; X32-NEXT: kmovw %eax, %k1 +; X32-NEXT: vpermq {{.*#+}} zmm0 {%k1} {z} = zmm0[0,0,0,0,4,4,4,4] +; X32-NEXT: retl +; +; X64-LABEL: test_mm512_maskz_permutex_epi64: +; X64: # BB#0: +; X64-NEXT: kmovw %edi, %k1 +; X64-NEXT: vpermq {{.*#+}} zmm0 {%k1} {z} = zmm0[0,0,0,0,4,4,4,4] +; X64-NEXT: retq + %arg0 = bitcast i8 %a0 to <8 x i1> + %res0 = shufflevector <8 x i64> %a1, <8 x i64> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 4, i32 4, i32 4, i32 4> + %res1 = select <8 x i1> %arg0, <8 x i64> %res0, <8 x i64> zeroinitializer + ret <8 x i64> %res1 +} + +define <8 x double> @test_mm512_permutex_pd(<8 x double> %a0) { +; X32-LABEL: test_mm512_permutex_pd: +; X32: # BB#0: +; X32-NEXT: vpermpd {{.*#+}} zmm0 = zmm0[0,0,0,0,4,4,4,4] +; X32-NEXT: retl +; +; X64-LABEL: test_mm512_permutex_pd: +; X64: # BB#0: +; X64-NEXT: vpermpd {{.*#+}} zmm0 = zmm0[0,0,0,0,4,4,4,4] +; X64-NEXT: retq + %res = shufflevector <8 x double> %a0, <8 x double> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 4, i32 4, i32 4, i32 4> + ret <8 x double> %res +} + +define <8 x double> @test_mm512_mask_permutex_pd(<8 x double> %a0, i8 %a1, <8 x double> %a2) { +; X32-LABEL: test_mm512_mask_permutex_pd: +; X32: # BB#0: +; X32-NEXT: movb {{[0-9]+}}(%esp), %al +; X32-NEXT: kmovw %eax, %k1 +; X32-NEXT: vpermpd {{.*#+}} zmm0 {%k1} = zmm1[0,0,0,0,4,4,4,4] +; X32-NEXT: retl +; +; X64-LABEL: test_mm512_mask_permutex_pd: +; X64: # BB#0: +; X64-NEXT: kmovw %edi, %k1 +; X64-NEXT: vpermpd {{.*#+}} zmm0 {%k1} = zmm1[0,0,0,0,4,4,4,4] +; X64-NEXT: retq + %arg1 = bitcast i8 %a1 to <8 x i1> + %res0 = shufflevector <8 x double> %a2, <8 x double> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 4, i32 4, i32 4, i32 4> + %res1 = select <8 x i1> %arg1, <8 x double> %res0, <8 x double> %a0 + ret <8 x double> %res1 +} + +define <8 x double> @test_mm512_maskz_permutex_pd(i8 %a0, <8 x double> %a1) { +; X32-LABEL: test_mm512_maskz_permutex_pd: +; X32: # BB#0: +; X32-NEXT: movb {{[0-9]+}}(%esp), %al +; X32-NEXT: kmovw %eax, %k1 +; X32-NEXT: vpermpd {{.*#+}} zmm0 {%k1} {z} = zmm0[0,0,0,0,4,4,4,4] +; X32-NEXT: retl +; +; X64-LABEL: test_mm512_maskz_permutex_pd: +; X64: # BB#0: +; X64-NEXT: kmovw %edi, %k1 +; X64-NEXT: vpermpd {{.*#+}} zmm0 {%k1} {z} = zmm0[0,0,0,0,4,4,4,4] +; X64-NEXT: retq + %arg0 = bitcast i8 %a0 to <8 x i1> + %res0 = shufflevector <8 x double> %a1, <8 x double> undef, <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 4, i32 4, i32 4, i32 4> + %res1 = select <8 x i1> %arg0, <8 x double> %res0, <8 x double> zeroinitializer + ret <8 x double> %res1 +} + define <8 x i64> @test_mm512_shuffle_epi32(<8 x i64> %a0) { ; X32-LABEL: test_mm512_shuffle_epi32: ; X32: # BB#0: |

