-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[Headers][X86] Add constexpr support for some AVX[512] intrinsics. #156567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Headers][X86] Add constexpr support for some AVX[512] intrinsics. #156567
Conversation
You can test this locally with the following command:git-clang-format --diff origin/main HEAD --extensions h,c -- clang/lib/Headers/avx512dqintrin.h clang/lib/Headers/avx512vlintrin.h clang/test/CodeGen/X86/avx512dq-builtins.c clang/test/CodeGen/X86/avx512vl-builtins.c
View the diff from clang-format here.diff --git a/clang/lib/Headers/avx512dqintrin.h b/clang/lib/Headers/avx512dqintrin.h
index ee211d3ea..a8435d1cb 100644
--- a/clang/lib/Headers/avx512dqintrin.h
+++ b/clang/lib/Headers/avx512dqintrin.h
@@ -483,8 +483,8 @@ _mm512_maskz_cvtps_epu64 (__mmask8 __U, __m256 __A) {
(__v8di)_mm512_setzero_si512(), \
(__mmask8)(U), (int)(R)))
-static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
-_mm512_cvtepi64_pd(__m512i __A) {
+static __inline__ __m512d
+ __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_cvtepi64_pd(__m512i __A) {
return (__m512d)__builtin_convertvector((__v8di)__A, __v8df);
}
@@ -713,8 +713,8 @@ _mm512_maskz_cvttps_epu64 (__mmask8 __U, __m256 __A) {
(__v8di)_mm512_setzero_si512(), \
(__mmask8)(U), (int)(R)))
-static __inline__ __m512d __DEFAULT_FN_ATTRS512_CONSTEXPR
-_mm512_cvtepu64_pd(__m512i __A) {
+static __inline__ __m512d
+ __DEFAULT_FN_ATTRS512_CONSTEXPR _mm512_cvtepu64_pd(__m512i __A) {
return (__m512d)__builtin_convertvector((__v8du)__A, __v8df);
}
|
@RKSimon |
No I don't think those are necessary changes tbh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - cheers
The following AVX[512] intrinsics are now constexpr:
_mm_mask_cvtepi32_pd
_mm_maskz_cvtepi32_pd
_mm_mask_cvtepi32_ps
_mm_maskz_cvtepi32_ps
_mm_cvtepu32_pd
_mm_mask_cvtepu32_pd
_mm_maskz_cvtepu32_pd
_mm_cvtepu32_ps
_mm_mask_cvtepu32_ps
_mm_maskz_cvtepu32_ps
_mm256_mask_cvtepi32_pd
_mm256_maskz_cvtepi32_pd
_mm256_mask_cvtepi32_ps
_mm256_maskz_cvtepi32_ps
_mm256_cvtepu32_pd
_mm256_mask_cvtepu32_pd
_mm256_maskz_cvtepu32_pd
_mm256_cvtepu32_ps
_mm256_mask_cvtepu32_ps
_mm256_maskz_cvtepu32_ps
_mm512_cvtepi64_pd
_mm512_mask_cvtepi64_pd
_mm512_maskz_cvtepi64_pd
_mm512_cvtepu64_pd
_mm512_mask_cvtepu64_pd
_mm512_maskz_cvtepu64_pd
This PR is part 2 [part 1] of a series of PRs fixing #155798