[clang] [Headers][X86] Allow AVX cast intrinsics to be used in constexpr (PR #152730)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 8 07:18:32 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions c,h -- clang/lib/Headers/avxintrin.h clang/test/CodeGen/X86/avx-builtins.c
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Headers/avxintrin.h b/clang/lib/Headers/avxintrin.h
index 5a6d48bc2..9a8249994 100644
--- a/clang/lib/Headers/avxintrin.h
+++ b/clang/lib/Headers/avxintrin.h
@@ -4368,8 +4368,7 @@ _mm256_setzero_si256(void) {
 /// \returns A 256-bit floating-point vector of [8 x float] containing the same
 ///    bitwise pattern as the parameter.
 static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
-_mm256_castpd_ps(__m256d __a)
-{
+_mm256_castpd_ps(__m256d __a) {
   return (__m256)__a;
 }
 
@@ -4385,8 +4384,7 @@ _mm256_castpd_ps(__m256d __a)
 /// \returns A 256-bit integer vector containing the same bitwise pattern as the
 ///    parameter.
 static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
-_mm256_castpd_si256(__m256d __a)
-{
+_mm256_castpd_si256(__m256d __a) {
   return (__m256i)__a;
 }
 
@@ -4402,8 +4400,7 @@ _mm256_castpd_si256(__m256d __a)
 /// \returns A 256-bit floating-point vector of [4 x double] containing the same
 ///    bitwise pattern as the parameter.
 static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
-_mm256_castps_pd(__m256 __a)
-{
+_mm256_castps_pd(__m256 __a) {
   return (__m256d)__a;
 }
 
@@ -4419,8 +4416,7 @@ _mm256_castps_pd(__m256 __a)
 /// \returns A 256-bit integer vector containing the same bitwise pattern as the
 ///    parameter.
 static __inline __m256i __DEFAULT_FN_ATTRS_CONSTEXPR
-_mm256_castps_si256(__m256 __a)
-{
+_mm256_castps_si256(__m256 __a) {
   return (__m256i)__a;
 }
 
@@ -4436,8 +4432,7 @@ _mm256_castps_si256(__m256 __a)
 /// \returns A 256-bit floating-point vector of [8 x float] containing the same
 ///    bitwise pattern as the parameter.
 static __inline __m256 __DEFAULT_FN_ATTRS_CONSTEXPR
-_mm256_castsi256_ps(__m256i __a)
-{
+_mm256_castsi256_ps(__m256i __a) {
   return (__m256)__a;
 }
 
@@ -4453,8 +4448,7 @@ _mm256_castsi256_ps(__m256i __a)
 /// \returns A 256-bit floating-point vector of [4 x double] containing the same
 ///    bitwise pattern as the parameter.
 static __inline __m256d __DEFAULT_FN_ATTRS_CONSTEXPR
-_mm256_castsi256_pd(__m256i __a)
-{
+_mm256_castsi256_pd(__m256i __a) {
   return (__m256d)__a;
 }
 
@@ -4470,8 +4464,7 @@ _mm256_castsi256_pd(__m256i __a)
 /// \returns A 128-bit floating-point vector of [2 x double] containing the
 ///    lower 128 bits of the parameter.
 static __inline __m128d __DEFAULT_FN_ATTRS_CONSTEXPR
-_mm256_castpd256_pd128(__m256d __a)
-{
+_mm256_castpd256_pd128(__m256d __a) {
   return __builtin_shufflevector((__v4df)__a, (__v4df)__a, 0, 1);
 }
 
@@ -4487,8 +4480,7 @@ _mm256_castpd256_pd128(__m256d __a)
 /// \returns A 128-bit floating-point vector of [4 x float] containing the
 ///    lower 128 bits of the parameter.
 static __inline __m128 __DEFAULT_FN_ATTRS_CONSTEXPR
-_mm256_castps256_ps128(__m256 __a)
-{
+_mm256_castps256_ps128(__m256 __a) {
   return __builtin_shufflevector((__v8sf)__a, (__v8sf)__a, 0, 1, 2, 3);
 }
 
@@ -4503,8 +4495,7 @@ _mm256_castps256_ps128(__m256 __a)
 /// \returns A 128-bit integer vector containing the lower 128 bits of the
 ///    parameter.
 static __inline __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
-_mm256_castsi256_si128(__m256i __a)
-{
+_mm256_castsi256_si128(__m256i __a) {
   return __builtin_shufflevector((__v4di)__a, (__v4di)__a, 0, 1);
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/152730


More information about the cfe-commits mailing list