forked from OSchip/llvm-project
[X86] Add the AVX512 exp2a23 intrinsics.
llvm-svn: 227769
This commit is contained in:
parent
95514e0422
commit
2a898bfc67
|
@ -838,6 +838,8 @@ BUILTIN(__builtin_ia32_rcp28sd_mask, "V2dV2dV2dV2dUcIi", "")
|
|||
BUILTIN(__builtin_ia32_rcp28ss_mask, "V4fV4fV4fV4fUcIi", "")
|
||||
BUILTIN(__builtin_ia32_rcp28pd_mask, "V8dV8dV8dUcIi", "")
|
||||
BUILTIN(__builtin_ia32_rcp28ps_mask, "V16fV16fV16fUsIi", "")
|
||||
BUILTIN(__builtin_ia32_exp2pd_mask, "V8dV8dV8dUcIi", "")
|
||||
BUILTIN(__builtin_ia32_exp2ps_mask, "V16fV16fV16fUsIi", "")
|
||||
BUILTIN(__builtin_ia32_cvttps2dq512_mask, "V16iV16fV16iUsIi", "")
|
||||
BUILTIN(__builtin_ia32_cvttps2udq512_mask, "V16iV16fV16iUsIi", "")
|
||||
BUILTIN(__builtin_ia32_cvttpd2dq512_mask, "V8iV8dV8iUcIi", "")
|
||||
|
|
|
@ -28,6 +28,55 @@
|
|||
#define __AVX512ERINTRIN_H
|
||||
|
||||
|
||||
// exp2a23
|
||||
#define _mm512_exp2a23_round_pd(A, R) __extension__ ({ \
|
||||
(__m512d)__builtin_ia32_exp2pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)_mm512_setzero_pd(), \
|
||||
(__mmask8)-1, (R)); })
|
||||
|
||||
#define _mm512_mask_exp2a23_round_pd(S, M, A, R) __extension__ ({ \
|
||||
(__m512d)__builtin_ia32_exp2pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)(__m512d)(S), \
|
||||
(__mmask8)(M), (R)); })
|
||||
|
||||
#define _mm512_maskz_exp2a23_round_pd(M, A, R) __extension__ ({ \
|
||||
(__m512d)__builtin_ia32_exp2pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)_mm512_setzero_pd(), \
|
||||
(__mmask8)(M), (R)); })
|
||||
|
||||
#define _mm512_exp2a23_pd(A) \
|
||||
_mm512_exp2a23_round_pd((A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_mask_exp2a23_pd(S, M, A) \
|
||||
_mm512_mask_exp2a23_round_pd((S), (M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_maskz_exp2a23_pd(M, A) \
|
||||
_mm512_maskz_exp2a23_round_pd((M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_exp2a23_round_ps(A, R) __extension__ ({ \
|
||||
(__m512)__builtin_ia32_exp2ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)_mm512_setzero_ps(), \
|
||||
(__mmask8)-1, (R)); })
|
||||
|
||||
#define _mm512_mask_exp2a23_round_ps(S, M, A, R) __extension__ ({ \
|
||||
(__m512)__builtin_ia32_exp2ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)(__m512)(S), \
|
||||
(__mmask8)(M), (R)); })
|
||||
|
||||
#define _mm512_maskz_exp2a23_round_ps(M, A, R) __extension__ ({ \
|
||||
(__m512)__builtin_ia32_exp2ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)_mm512_setzero_ps(), \
|
||||
(__mmask8)(M), (R)); })
|
||||
|
||||
#define _mm512_exp2a23_ps(A) \
|
||||
_mm512_exp2a23_round_ps((A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_mask_exp2a23_ps(S, M, A) \
|
||||
_mm512_mask_exp2a23_round_ps((S), (M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_maskz_exp2a23_ps(M, A) \
|
||||
_mm512_maskz_exp2a23_round_ps((M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
// rsqrt28
|
||||
#define _mm512_rsqrt28_round_pd(A, R) __extension__ ({ \
|
||||
(__m512d)__builtin_ia32_rsqrt28pd_mask((__v8df)(__m512d)(A), \
|
||||
|
|
|
@ -271,3 +271,76 @@ __m128d test_mm_maskz_rcp28_sd(__mmask8 m, __m128d a, __m128d b) {
|
|||
// CHECK: @llvm.x86.avx512.rcp28.sd
|
||||
return _mm_maskz_rcp28_sd(m, a, b);
|
||||
}
|
||||
|
||||
__m512d test_mm512_exp2a23_round_pd(__m512d a) {
|
||||
// CHECK-LABEL: @test_mm512_exp2a23_round_pd
|
||||
// CHECK: @llvm.x86.avx512.exp2.pd
|
||||
return _mm512_exp2a23_round_pd(a, _MM_FROUND_TO_NEAREST_INT);
|
||||
}
|
||||
|
||||
__m512d test_mm512_mask_exp2a23_round_pd(__m512d s, __mmask8 m, __m512d a) {
|
||||
// check-label: @test_mm512_mask_exp2a23_round_pd
|
||||
// check: @llvm.x86.avx512.exp2.pd
|
||||
return _mm512_mask_exp2a23_round_pd(s, m, a, _MM_FROUND_TO_NEAREST_INT);
|
||||
}
|
||||
|
||||
__m512d test_mm512_maskz_exp2a23_round_pd(__mmask8 m, __m512d a) {
|
||||
// check-label: @test_mm512_maskz_exp2a23_round_pd
|
||||
// check: @llvm.x86.avx512.exp2.pd
|
||||
return _mm512_maskz_exp2a23_round_pd(m, a, _MM_FROUND_TO_NEAREST_INT);
|
||||
}
|
||||
|
||||
__m512d test_mm512_exp2a23_pd(__m512d a) {
|
||||
// CHECK-LABEL: @test_mm512_exp2a23_pd
|
||||
// CHECK: @llvm.x86.avx512.exp2.pd
|
||||
return _mm512_exp2a23_pd(a);
|
||||
}
|
||||
|
||||
__m512d test_mm512_mask_exp2a23_pd(__m512d s, __mmask8 m, __m512d a) {
|
||||
// check-label: @test_mm512_mask_exp2a23_pd
|
||||
// check: @llvm.x86.avx512.exp2.pd
|
||||
return _mm512_mask_exp2a23_pd(s, m, a);
|
||||
}
|
||||
|
||||
__m512d test_mm512_maskz_exp2a23_pd(__mmask8 m, __m512d a) {
|
||||
// check-label: @test_mm512_maskz_exp2a23_pd
|
||||
// check: @llvm.x86.avx512.exp2.pd
|
||||
return _mm512_maskz_exp2a23_pd(m, a);
|
||||
}
|
||||
|
||||
__m512 test_mm512_exp2a23_round_ps(__m512 a) {
|
||||
// CHECK-LABEL: @test_mm512_exp2a23_round_ps
|
||||
// CHECK: @llvm.x86.avx512.exp2.ps
|
||||
return _mm512_exp2a23_round_ps(a, _MM_FROUND_TO_NEAREST_INT);
|
||||
}
|
||||
|
||||
__m512 test_mm512_mask_exp2a23_round_ps(__m512 s, __mmask16 m, __m512 a) {
|
||||
// CHECK-LABEL: @test_mm512_mask_exp2a23_round_ps
|
||||
// CHECK: @llvm.x86.avx512.exp2.ps
|
||||
return _mm512_mask_exp2a23_round_ps(s, m, a, _MM_FROUND_TO_NEAREST_INT);
|
||||
}
|
||||
|
||||
__m512 test_mm512_maskz_exp2a23_round_ps(__mmask16 m, __m512 a) {
|
||||
// CHECK-LABEL: @test_mm512_maskz_exp2a23_round_ps
|
||||
// CHECK: @llvm.x86.avx512.exp2.ps
|
||||
return _mm512_maskz_exp2a23_round_ps(m, a, _MM_FROUND_TO_NEAREST_INT);
|
||||
}
|
||||
|
||||
__m512 test_mm512_exp2a23_ps(__m512 a) {
|
||||
// CHECK-LABEL: @test_mm512_exp2a23_ps
|
||||
// CHECK: @llvm.x86.avx512.exp2.ps
|
||||
return _mm512_exp2a23_ps(a);
|
||||
}
|
||||
|
||||
__m512 test_mm512_mask_exp2a23_ps(__m512 s, __mmask16 m, __m512 a) {
|
||||
// CHECK-LABEL: @test_mm512_mask_exp2a23_ps
|
||||
// CHECK: @llvm.x86.avx512.exp2.ps
|
||||
return _mm512_mask_exp2a23_ps(s, m, a);
|
||||
}
|
||||
|
||||
__m512 test_mm512_maskz_exp2a23_ps(__mmask16 m, __m512 a) {
|
||||
// CHECK-LABEL: @test_mm512_maskz_exp2a23_ps
|
||||
// CHECK: @llvm.x86.avx512.exp2.ps
|
||||
return _mm512_maskz_exp2a23_ps(m, a);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue