[clang] [clang][x86] Add constexpr support for LZCNT/TZCNT intrinsics (PR #110499)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 30 05:29:03 PDT 2024
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 c0e97c4dfc936ed13ae9696f0615d7e648268bc9 b61842abda168ea02bb6b25598ce6d08757bb4f7 --extensions cpp,h,c -- clang/lib/AST/ExprConstant.cpp clang/lib/Headers/bmiintrin.h clang/lib/Headers/lzcntintrin.h clang/test/CodeGen/X86/bmi-builtins.c clang/test/CodeGen/X86/lzcnt-builtins.c
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/Headers/bmiintrin.h b/clang/lib/Headers/bmiintrin.h
index b0f4436763..634fa39bfa 100644
--- a/clang/lib/Headers/bmiintrin.h
+++ b/clang/lib/Headers/bmiintrin.h
@@ -18,7 +18,8 @@
instruction behaves as BSF on non-BMI targets, there is code that expects
to use it as a potentially faster version of BSF. */
#if defined(__cplusplus) && (__cplusplus >= 201103L)
-#define __RELAXED_FN_ATTRS __attribute__((__always_inline__, __nodebug__)) constexpr
+#define __RELAXED_FN_ATTRS \
+ __attribute__((__always_inline__, __nodebug__)) constexpr
#else
#define __RELAXED_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
#endif
diff --git a/clang/lib/Headers/lzcntintrin.h b/clang/lib/Headers/lzcntintrin.h
index d746d91d9f..881ca52917 100644
--- a/clang/lib/Headers/lzcntintrin.h
+++ b/clang/lib/Headers/lzcntintrin.h
@@ -16,7 +16,8 @@
/* Define the default attributes for the functions in this file. */
#if defined(__cplusplus) && (__cplusplus >= 201103L)
-#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("lzcnt"))) constexpr
+#define __DEFAULT_FN_ATTRS \
+ __attribute__((__always_inline__, __nodebug__, __target__("lzcnt"))) constexpr
#else
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("lzcnt")))
#endif
``````````
</details>
https://github.com/llvm/llvm-project/pull/110499
More information about the cfe-commits
mailing list