r351029 - [X86] Remove mask parameter from vpshufbitqmb intrinsics. Change result to a vXi1 vector.
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Sun Jan 13 16:03:55 PST 2019
Author: ctopper
Date: Sun Jan 13 16:03:55 2019
New Revision: 351029
URL: http://llvm.org/viewvc/llvm-project?rev=351029&view=rev
Log:
[X86] Remove mask parameter from vpshufbitqmb intrinsics. Change result to a vXi1 vector.
We'll do the scalar<->vXi1 conversions with bitcasts in IR.
Fixes PR40258
Modified:
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/test/CodeGen/avx512bitalg-builtins.c
cfe/trunk/test/CodeGen/avx512vlbitalg-builtins.c
Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=351029&r1=351028&r2=351029&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Sun Jan 13 16:03:55 2019
@@ -11152,6 +11152,31 @@ Value *CodeGenFunction::EmitX86BuiltinEx
return EmitX86MaskedCompareResult(*this, Fpclass, NumElts, MaskIn);
}
+ case X86::BI__builtin_ia32_vpshufbitqmb128_mask:
+ case X86::BI__builtin_ia32_vpshufbitqmb256_mask:
+ case X86::BI__builtin_ia32_vpshufbitqmb512_mask: {
+ unsigned NumElts = Ops[0]->getType()->getVectorNumElements();
+ Value *MaskIn = Ops[2];
+ Ops.erase(&Ops[2]);
+
+ Intrinsic::ID ID;
+ switch (BuiltinID) {
+ default: llvm_unreachable("Unsupported intrinsic!");
+ case X86::BI__builtin_ia32_vpshufbitqmb128_mask:
+ ID = Intrinsic::x86_avx512_vpshufbitqmb_128;
+ break;
+ case X86::BI__builtin_ia32_vpshufbitqmb256_mask:
+ ID = Intrinsic::x86_avx512_vpshufbitqmb_256;
+ break;
+ case X86::BI__builtin_ia32_vpshufbitqmb512_mask:
+ ID = Intrinsic::x86_avx512_vpshufbitqmb_512;
+ break;
+ }
+
+ Value *Fpclass = Builder.CreateCall(CGM.getIntrinsic(ID), Ops);
+ return EmitX86MaskedCompareResult(*this, Fpclass, NumElts, MaskIn);
+ }
+
// packed comparison intrinsics
case X86::BI__builtin_ia32_cmpeqps:
case X86::BI__builtin_ia32_cmpeqpd:
Modified: cfe/trunk/test/CodeGen/avx512bitalg-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512bitalg-builtins.c?rev=351029&r1=351028&r2=351029&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512bitalg-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512bitalg-builtins.c Sun Jan 13 16:03:55 2019
@@ -42,13 +42,14 @@ __m512i test_mm512_maskz_popcnt_epi8(__m
__mmask64 test_mm512_mask_bitshuffle_epi64_mask(__mmask64 __U, __m512i __A, __m512i __B) {
// CHECK-LABEL: @test_mm512_mask_bitshuffle_epi64_mask
- // CHECK: @llvm.x86.avx512.mask.vpshufbitqmb.512
+ // CHECK: @llvm.x86.avx512.vpshufbitqmb.512
+ // CHECK: and <64 x i1> %{{.*}}, %{{.*}}
return _mm512_mask_bitshuffle_epi64_mask(__U, __A, __B);
}
__mmask64 test_mm512_bitshuffle_epi64_mask(__m512i __A, __m512i __B) {
// CHECK-LABEL: @test_mm512_bitshuffle_epi64_mask
- // CHECK: @llvm.x86.avx512.mask.vpshufbitqmb.512
+ // CHECK: @llvm.x86.avx512.vpshufbitqmb.512
return _mm512_bitshuffle_epi64_mask(__A, __B);
}
Modified: cfe/trunk/test/CodeGen/avx512vlbitalg-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512vlbitalg-builtins.c?rev=351029&r1=351028&r2=351029&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512vlbitalg-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512vlbitalg-builtins.c Sun Jan 13 16:03:55 2019
@@ -80,25 +80,27 @@ __m128i test_mm_maskz_popcnt_epi8(__mmas
__mmask32 test_mm256_mask_bitshuffle_epi64_mask(__mmask32 __U, __m256i __A, __m256i __B) {
// CHECK-LABEL: @test_mm256_mask_bitshuffle_epi64_mask
- // CHECK: @llvm.x86.avx512.mask.vpshufbitqmb.256
+ // CHECK: @llvm.x86.avx512.vpshufbitqmb.256
+ // CHECK: and <32 x i1> %{{.*}}, %{{.*}}
return _mm256_mask_bitshuffle_epi64_mask(__U, __A, __B);
}
__mmask32 test_mm256_bitshuffle_epi64_mask(__m256i __A, __m256i __B) {
// CHECK-LABEL: @test_mm256_bitshuffle_epi64_mask
- // CHECK: @llvm.x86.avx512.mask.vpshufbitqmb.256
+ // CHECK: @llvm.x86.avx512.vpshufbitqmb.256
return _mm256_bitshuffle_epi64_mask(__A, __B);
}
__mmask16 test_mm_mask_bitshuffle_epi64_mask(__mmask16 __U, __m128i __A, __m128i __B) {
// CHECK-LABEL: @test_mm_mask_bitshuffle_epi64_mask
- // CHECK: @llvm.x86.avx512.mask.vpshufbitqmb.128
+ // CHECK: @llvm.x86.avx512.vpshufbitqmb.128
+ // CHECK: and <16 x i1> %{{.*}}, %{{.*}}
return _mm_mask_bitshuffle_epi64_mask(__U, __A, __B);
}
__mmask16 test_mm_bitshuffle_epi64_mask(__m128i __A, __m128i __B) {
// CHECK-LABEL: @test_mm_bitshuffle_epi64_mask
- // CHECK: @llvm.x86.avx512.mask.vpshufbitqmb.128
+ // CHECK: @llvm.x86.avx512.vpshufbitqmb.128
return _mm_bitshuffle_epi64_mask(__A, __B);
}
More information about the cfe-commits
mailing list