From b4ac3d281fc2ca82413011d451722aacbfe5ce93 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sun, 1 Feb 2015 10:15:11 +0000 Subject: [PATCH] [X86] Add all intrinsics for scalar rsqrt28/rcp28 to avx512erintrin.h. Add parentheses around all macro arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227722 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Headers/avx512erintrin.h | 115 ++++++++++++++++++++++++++++++----- 1 file changed, 99 insertions(+), 16 deletions(-) diff --git a/lib/Headers/avx512erintrin.h b/lib/Headers/avx512erintrin.h index 54db997544..323f4f0d67 100644 --- a/lib/Headers/avx512erintrin.h +++ b/lib/Headers/avx512erintrin.h @@ -45,13 +45,13 @@ (__mmask8)(M), (R)); }) #define _mm512_rsqrt28_pd(A) \ - _mm512_rsqrt28_round_pd(A, _MM_FROUND_CUR_DIRECTION) + _mm512_rsqrt28_round_pd((A), _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_rsqrt28_pd(S, M, A) \ - _mm512_mask_rsqrt28_round_pd(S, M, A, _MM_FROUND_CUR_DIRECTION) + _mm512_mask_rsqrt28_round_pd((S), (M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_rsqrt28_pd(M, A) \ - _mm512_maskz_rsqrt28_round_pd(M, A, _MM_FROUND_CUR_DIRECTION) + _mm512_maskz_rsqrt28_round_pd((M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm512_rsqrt28_round_ps(A, R) __extension__ ({ \ (__m512)__builtin_ia32_rsqrt28ps_mask((__v16sf)(__m512)(A), \ @@ -69,13 +69,13 @@ (__mmask16)(M), (R)); }) #define _mm512_rsqrt28_ps(A) \ - _mm512_rsqrt28_round_ps(A, _MM_FROUND_CUR_DIRECTION) + _mm512_rsqrt28_round_ps((A), _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_rsqrt28_ps(S, M, A) \ - _mm512_mask_rsqrt28_round_ps(S, M, A, _MM_FROUND_CUR_DIRECTION) + _mm512_mask_rsqrt28_round_ps((S), (M), A, _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_rsqrt28_ps(M, A) \ - _mm512_maskz_rsqrt28_round_ps(M, A, _MM_FROUND_CUR_DIRECTION) + _mm512_maskz_rsqrt28_round_ps((M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm_rsqrt28_round_ss(A, B, R) __extension__ ({ \ (__m128)__builtin_ia32_rsqrt28ss_mask((__v4sf)(__m128)(A), \ @@ -83,12 +83,53 @@ (__v4sf)_mm_setzero_ps(), \ (__mmask8)-1, (R)); }) +#define _mm_mask_rsqrt28_round_ss(S, M, A, B, R) __extension__ ({ \ + (__m128)__builtin_ia32_rsqrt28ss_mask((__v4sf)(__m128)(A), \ + (__v4sf)(__m128)(B), \ + (__v4sf)(__m128)(S), \ + (__mmask8)(M), (R)); }) + +#define _mm_maskz_rsqrt28_round_ss(M, A, B, R) __extension__ ({ \ + (__m128)__builtin_ia32_rsqrt28ss_mask((__v4sf)(__m128)(A), \ + (__v4sf)(__m128)(B), \ + (__v4sf)_mm_setzero_ps(), \ + (__mmask8)(M), (R)); }) + +#define _mm_rsqrt28_ss(A, B) \ + _mm_rsqrt28_round_ss((A), (B), _MM_FROUND_CUR_DIRECTION) + +#define _mm_mask_rsqrt28_ss(S, M, A, B) \ + _mm_mask_rsqrt28_round_ss((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION) + +#define _mm_maskz_rsqrt28_ss(M, A, B) \ + _mm_maskz_rsqrt28_round_ss((M), (A), (B), _MM_FROUND_CUR_DIRECTION) + #define _mm_rsqrt28_round_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_rsqrt28sd_mask((__v2df)(__m128d)(A), \ (__v2df)(__m128d)(B), \ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (R)); }) +#define _mm_mask_rsqrt28_round_sd(S, M, A, B, R) __extension__ ({ \ + (__m128d)__builtin_ia32_rsqrt28sd_mask((__v2df)(__m128d)(A), \ + (__v2df)(__m128d)(B), \ + (__v2df)(__m128d)(S), \ + (__mmask8)(M), (R)); }) + +#define _mm_maskz_rsqrt28_round_sd(M, A, B, R) __extension__ ({ \ + (__m128d)__builtin_ia32_rsqrt28sd_mask((__v2df)(__m128d)(A), \ + (__v2df)(__m128d)(B), \ + (__v2df)_mm_setzero_pd(), \ + (__mmask8)(M), (R)); }) + +#define _mm_rsqrt28_sd(A, B) \ + _mm_rsqrt28_round_sd((A), (B), _MM_FROUND_CUR_DIRECTION) + +#define _mm_mask_rsqrt28_sd(S, M, A, B) \ + _mm_mask_rsqrt28_round_sd((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION) + +#define _mm_maskz_rsqrt28_sd(M, A, B) \ + _mm_mask_rsqrt28_round_sd((M), (A), (B), _MM_FROUND_CUR_DIRECTION) // rcp28 #define _mm512_rcp28_round_pd(A, R) __extension__ ({ \ @@ -107,13 +148,13 @@ (__mmask8)(M), (R)); }) #define _mm512_rcp28_pd(A) \ - _mm512_rcp28_round_pd(A, _MM_FROUND_CUR_DIRECTION) + _mm512_rcp28_round_pd((A), _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_rcp28_pd(S, M, A) \ - _mm512_mask_rcp28_round_pd(S, M, A, _MM_FROUND_CUR_DIRECTION) + _mm512_mask_rcp28_round_pd((S), (M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_rcp28_pd(M, A) \ - _mm512_maskz_rcp28_round_pd(M, A, _MM_FROUND_CUR_DIRECTION) + _mm512_maskz_rcp28_round_pd((M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm512_rcp28_round_ps(A, R) __extension__ ({ \ (__m512)__builtin_ia32_rcp28ps_mask((__v16sf)(__m512)(A), \ @@ -131,19 +172,40 @@ (__mmask16)(M), (R)); }) #define _mm512_rcp28_ps(A) \ - _mm512_rcp28_round_ps(A, _MM_FROUND_CUR_DIRECTION) + _mm512_rcp28_round_ps((A), _MM_FROUND_CUR_DIRECTION) #define _mm512_mask_rcp28_ps(S, M, A) \ - _mm512_mask_rcp28_round_ps(S, M, A, _MM_FROUND_CUR_DIRECTION) + _mm512_mask_rcp28_round_ps((S), (M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm512_maskz_rcp28_ps(M, A) \ - _mm512_maskz_rcp28_round_ps(M, A, _MM_FROUND_CUR_DIRECTION) + _mm512_maskz_rcp28_round_ps((M), (A), _MM_FROUND_CUR_DIRECTION) #define _mm_rcp28_round_ss(A, B, R) __extension__ ({ \ - (__m128) __builtin_ia32_rcp28ss_mask ((__v4sf)(__m128)(A), \ - (__v4sf)(__m128)(B), \ - (__v4sf)_mm_setzero_ps(), \ - (__mmask8)-1, (R)); }) + (__m128)__builtin_ia32_rcp28ss_mask((__v4sf)(__m128)(A), \ + (__v4sf)(__m128)(B), \ + (__v4sf)_mm_setzero_ps(), \ + (__mmask8)-1, (R)); }) + +#define _mm_mask_rcp28_round_ss(S, M, A, B, R) __extension__ ({ \ + (__m128)__builtin_ia32_rcp28ss_mask((__v4sf)(__m128)(A), \ + (__v4sf)(__m128)(B), \ + (__v4sf)(__m128)(S), \ + (__mmask8)(M), (R)); }) + +#define _mm_maskz_rcp28_round_ss(M, A, B, R) __extension__ ({ \ + (__m128)__builtin_ia32_rcp28ss_mask((__v4sf)(__m128)(A), \ + (__v4sf)(__m128)(B), \ + (__v4sf)_mm_setzero_ps(), \ + (__mmask8)(M), (R)); }) + +#define _mm_rcp28_ss(A, B) \ + _mm_rcp28_round_ss((A), (B), _MM_FROUND_CUR_DIRECTION) + +#define _mm_mask_rcp28_ss(S, M, A, B) \ + _mm_mask_rcp28_round_ss((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION) + +#define _mm_maskz_rcp28_ss(M, A, B) \ + _mm_maskz_rcp28_round_ss((M), (A), (B), _MM_FROUND_CUR_DIRECTION) #define _mm_rcp28_round_sd(A, B, R) __extension__ ({ \ (__m128d)__builtin_ia32_rcp28sd_mask((__v2df)(__m128d)(A), \ @@ -151,4 +213,25 @@ (__v2df)_mm_setzero_pd(), \ (__mmask8)-1, (R)); }) +#define _mm_mask_rcp28_round_sd(S, M, A, B, R) __extension__ ({ \ + (__m128d)__builtin_ia32_rcp28sd_mask((__v2df)(__m128d)(A), \ + (__v2df)(__m128d)(B), \ + (__v2df)(__m128d)(S), \ + (__mmask8)(M), (R)); }) + +#define _mm_maskz_rcp28_round_sd(M, A, B, R) __extension__ ({ \ + (__m128d)__builtin_ia32_rcp28sd_mask((__v2df)(__m128d)(A), \ + (__v2df)(__m128d)(B), \ + (__v2df)_mm_setzero_pd(), \ + (__mmask8)(M), (R)); }) + +#define _mm_rcp28_sd(A, B) \ + _mm_rcp28_round_sd((A), (B), _MM_FROUND_CUR_DIRECTION) + +#define _mm_mask_rcp28_sd(S, M, A, B) \ + _mm_mask_rcp28_round_sd((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION) + +#define _mm_maskz_rcp28_sd(M, A, B) \ + _mm_maskz_rcp28_round_sd((M), (A), (B), _MM_FROUND_CUR_DIRECTION) + #endif // __AVX512ERINTRIN_H -- 2.40.0