[clang] [X86] Allow XOP rotate intrinsics to be used in constexpr (PR #157643)

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 9 03:57:02 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 origin/main HEAD --extensions h,c -- clang/lib/Headers/xopintrin.h clang/test/CodeGen/X86/xop-builtins.c
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/clang/lib/Headers/xopintrin.h b/clang/lib/Headers/xopintrin.h
index aba632f94..40915402f 100644
--- a/clang/lib/Headers/xopintrin.h
+++ b/clang/lib/Headers/xopintrin.h
@@ -209,26 +209,22 @@ _mm_perm_epi8(__m128i __A, __m128i __B, __m128i __C)
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
-_mm_rot_epi8(__m128i __A, __m128i __B)
-{
+_mm_rot_epi8(__m128i __A, __m128i __B) {
   return (__m128i)__builtin_elementwise_fshl((__v16qu)__A, (__v16qu)__A, (__v16qu)__B);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
-_mm_rot_epi16(__m128i __A, __m128i __B)
-{
+_mm_rot_epi16(__m128i __A, __m128i __B) {
   return (__m128i)__builtin_elementwise_fshl((__v8hu)__A, (__v8hu)__A, (__v8hu)__B);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
-_mm_rot_epi32(__m128i __A, __m128i __B)
-{
+_mm_rot_epi32(__m128i __A, __m128i __B) {
   return (__m128i)__builtin_elementwise_fshl((__v4su)__A, (__v4su)__A, (__v4su)__B);
 }
 
 static __inline__ __m128i __DEFAULT_FN_ATTRS_CONSTEXPR
-_mm_rot_epi64(__m128i __A, __m128i __B)
-{
+_mm_rot_epi64(__m128i __A, __m128i __B) {
   return (__m128i)__builtin_elementwise_fshl((__v2du)__A, (__v2du)__A, (__v2du)__B);
 }
 

``````````

</details>


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


More information about the cfe-commits mailing list