[AVX-512] Remove 128/256-bit masked vpermilvar builtins and replace with select and the avx unmasked builtins.

llvm-svn: 289338
This commit is contained in:
Craig Topper 2016-12-10 20:27:39 +00:00
parent fbc728853f
commit 5391c98341
3 changed files with 48 additions and 62 deletions

View File

@ -1495,10 +1495,6 @@ TARGET_BUILTIN(__builtin_ia32_vpermt2vard512_maskz, "V16iV16iV16iV16iUs","","avx
TARGET_BUILTIN(__builtin_ia32_vpermt2varpd512_maskz, "V8dV8LLiV8dV8dUc","","avx512f")
TARGET_BUILTIN(__builtin_ia32_vpermt2varps512_maskz, "V16fV16iV16fV16fUs","","avx512f")
TARGET_BUILTIN(__builtin_ia32_vpermt2varq512_maskz, "V8LLiV8LLiV8LLiV8LLiUc","","avx512f")
TARGET_BUILTIN(__builtin_ia32_vpermilvarpd_mask, "V2dV2dV2LLiV2dUc","","avx512vl")
TARGET_BUILTIN(__builtin_ia32_vpermilvarpd256_mask, "V4dV4dV4LLiV4dUc","","avx512vl")
TARGET_BUILTIN(__builtin_ia32_vpermilvarps_mask, "V4fV4fV4iV4fUc","","avx512vl")
TARGET_BUILTIN(__builtin_ia32_vpermilvarps256_mask, "V8fV8fV8iV8fUc","","avx512vl")
TARGET_BUILTIN(__builtin_ia32_ptestmb512, "ULLiV64cV64cULLi","","avx512bw")
TARGET_BUILTIN(__builtin_ia32_ptestmw512, "UiV32sV32sUi","","avx512bw")
TARGET_BUILTIN(__builtin_ia32_ptestnmb512, "ULLiV64cV64cULLi","","avx512bw")

View File

@ -6424,85 +6424,67 @@ _mm256_maskz_rcp14_ps (__mmask8 __U, __m256 __A)
(__v8sf)_mm256_setzero_ps()); })
static __inline__ __m128d __DEFAULT_FN_ATTRS
_mm_mask_permutevar_pd (__m128d __W, __mmask8 __U, __m128d __A,
__m128i __C)
_mm_mask_permutevar_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128i __C)
{
return (__m128d) __builtin_ia32_vpermilvarpd_mask ((__v2df) __A,
(__v2di) __C,
(__v2df) __W,
(__mmask8) __U);
return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
(__v2df)_mm_permutevar_pd(__A, __C),
(__v2df)__W);
}
static __inline__ __m128d __DEFAULT_FN_ATTRS
_mm_maskz_permutevar_pd (__mmask8 __U, __m128d __A, __m128i __C)
_mm_maskz_permutevar_pd(__mmask8 __U, __m128d __A, __m128i __C)
{
return (__m128d) __builtin_ia32_vpermilvarpd_mask ((__v2df) __A,
(__v2di) __C,
(__v2df)
_mm_setzero_pd (),
(__mmask8) __U);
return (__m128d)__builtin_ia32_selectpd_128((__mmask8)__U,
(__v2df)_mm_permutevar_pd(__A, __C),
(__v2df)_mm_setzero_pd());
}
static __inline__ __m256d __DEFAULT_FN_ATTRS
_mm256_mask_permutevar_pd (__m256d __W, __mmask8 __U, __m256d __A,
__m256i __C)
_mm256_mask_permutevar_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256i __C)
{
return (__m256d) __builtin_ia32_vpermilvarpd256_mask ((__v4df) __A,
(__v4di) __C,
(__v4df) __W,
(__mmask8)
__U);
return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
(__v4df)_mm256_permutevar_pd(__A, __C),
(__v4df)__W);
}
static __inline__ __m256d __DEFAULT_FN_ATTRS
_mm256_maskz_permutevar_pd (__mmask8 __U, __m256d __A, __m256i __C)
_mm256_maskz_permutevar_pd(__mmask8 __U, __m256d __A, __m256i __C)
{
return (__m256d) __builtin_ia32_vpermilvarpd256_mask ((__v4df) __A,
(__v4di) __C,
(__v4df)
_mm256_setzero_pd (),
(__mmask8)
__U);
return (__m256d)__builtin_ia32_selectpd_256((__mmask8)__U,
(__v4df)_mm256_permutevar_pd(__A, __C),
(__v4df)_mm256_setzero_pd());
}
static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_mask_permutevar_ps (__m128 __W, __mmask8 __U, __m128 __A,
__m128i __C)
_mm_mask_permutevar_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128i __C)
{
return (__m128) __builtin_ia32_vpermilvarps_mask ((__v4sf) __A,
(__v4si) __C,
(__v4sf) __W,
(__mmask8) __U);
return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
(__v4sf)_mm_permutevar_ps(__A, __C),
(__v4sf)__W);
}
static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_maskz_permutevar_ps (__mmask8 __U, __m128 __A, __m128i __C)
_mm_maskz_permutevar_ps(__mmask8 __U, __m128 __A, __m128i __C)
{
return (__m128) __builtin_ia32_vpermilvarps_mask ((__v4sf) __A,
(__v4si) __C,
(__v4sf)
_mm_setzero_ps (),
(__mmask8) __U);
return (__m128)__builtin_ia32_selectps_128((__mmask8)__U,
(__v4sf)_mm_permutevar_ps(__A, __C),
(__v4sf)_mm_setzero_ps());
}
static __inline__ __m256 __DEFAULT_FN_ATTRS
_mm256_mask_permutevar_ps (__m256 __W, __mmask8 __U, __m256 __A,
__m256i __C)
_mm256_mask_permutevar_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256i __C)
{
return (__m256) __builtin_ia32_vpermilvarps256_mask ((__v8sf) __A,
(__v8si) __C,
(__v8sf) __W,
(__mmask8) __U);
return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
(__v8sf)_mm256_permutevar_ps(__A, __C),
(__v8sf)__W);
}
static __inline__ __m256 __DEFAULT_FN_ATTRS
_mm256_maskz_permutevar_ps (__mmask8 __U, __m256 __A, __m256i __C)
_mm256_maskz_permutevar_ps(__mmask8 __U, __m256 __A, __m256i __C)
{
return (__m256) __builtin_ia32_vpermilvarps256_mask ((__v8sf) __A,
(__v8si) __C,
(__v8sf)
_mm256_setzero_ps (),
(__mmask8) __U);
return (__m256)__builtin_ia32_selectps_256((__mmask8)__U,
(__v8sf)_mm256_permutevar_ps(__A, __C),
(__v8sf)_mm256_setzero_ps());
}
static __inline__ __mmask8 __DEFAULT_FN_ATTRS

View File

@ -5064,49 +5064,57 @@ __m256 test_mm256_maskz_permute_ps(__mmask8 __U, __m256 __X) {
__m128d test_mm_mask_permutevar_pd(__m128d __W, __mmask8 __U, __m128d __A, __m128i __C) {
// CHECK-LABEL: @test_mm_mask_permutevar_pd
// CHECK: @llvm.x86.avx512.mask.vpermilvar.pd
// CHECK: @llvm.x86.avx.vpermilvar.pd
// CHECK: select <2 x i1> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}}
return _mm_mask_permutevar_pd(__W, __U, __A, __C);
}
__m128d test_mm_maskz_permutevar_pd(__mmask8 __U, __m128d __A, __m128i __C) {
// CHECK-LABEL: @test_mm_maskz_permutevar_pd
// CHECK: @llvm.x86.avx512.mask.vpermilvar.pd
// CHECK: @llvm.x86.avx.vpermilvar.pd
// CHECK: select <2 x i1> %{{.*}}, <2 x double> %{{.*}}, <2 x double> %{{.*}}
return _mm_maskz_permutevar_pd(__U, __A, __C);
}
__m256d test_mm256_mask_permutevar_pd(__m256d __W, __mmask8 __U, __m256d __A, __m256i __C) {
// CHECK-LABEL: @test_mm256_mask_permutevar_pd
// CHECK: @llvm.x86.avx512.mask.vpermilvar.pd.256
// CHECK: @llvm.x86.avx.vpermilvar.pd.256
// CHECK: select <4 x i1> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}}
return _mm256_mask_permutevar_pd(__W, __U, __A, __C);
}
__m256d test_mm256_maskz_permutevar_pd(__mmask8 __U, __m256d __A, __m256i __C) {
// CHECK-LABEL: @test_mm256_maskz_permutevar_pd
// CHECK: @llvm.x86.avx512.mask.vpermilvar.pd.256
// CHECK: @llvm.x86.avx.vpermilvar.pd.256
// CHECK: select <4 x i1> %{{.*}}, <4 x double> %{{.*}}, <4 x double> %{{.*}}
return _mm256_maskz_permutevar_pd(__U, __A, __C);
}
__m128 test_mm_mask_permutevar_ps(__m128 __W, __mmask8 __U, __m128 __A, __m128i __C) {
// CHECK-LABEL: @test_mm_mask_permutevar_ps
// CHECK: @llvm.x86.avx512.mask.vpermilvar.ps
// CHECK: @llvm.x86.avx.vpermilvar.ps
// CHECK: select <4 x i1> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}
return _mm_mask_permutevar_ps(__W, __U, __A, __C);
}
__m128 test_mm_maskz_permutevar_ps(__mmask8 __U, __m128 __A, __m128i __C) {
// CHECK-LABEL: @test_mm_maskz_permutevar_ps
// CHECK: @llvm.x86.avx512.mask.vpermilvar.ps
// CHECK: @llvm.x86.avx.vpermilvar.ps
// CHECK: select <4 x i1> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}
return _mm_maskz_permutevar_ps(__U, __A, __C);
}
__m256 test_mm256_mask_permutevar_ps(__m256 __W, __mmask8 __U, __m256 __A, __m256i __C) {
// CHECK-LABEL: @test_mm256_mask_permutevar_ps
// CHECK: @llvm.x86.avx512.mask.vpermilvar.ps.256
// CHECK: @llvm.x86.avx.vpermilvar.ps.256
// CHECK: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
return _mm256_mask_permutevar_ps(__W, __U, __A, __C);
}
__m256 test_mm256_maskz_permutevar_ps(__mmask8 __U, __m256 __A, __m256i __C) {
// CHECK-LABEL: @test_mm256_maskz_permutevar_ps
// CHECK: @llvm.x86.avx512.mask.vpermilvar.ps.256
// CHECK: @llvm.x86.avx.vpermilvar.ps.256
// CHECK: select <8 x i1> %{{.*}}, <8 x float> %{{.*}}, <8 x float> %{{.*}}
return _mm256_maskz_permutevar_ps(__U, __A, __C);
}