[compiler-rt] [compiler-rt][AArch64][FMV] Use the hw.optional.arm.caps fast path (PR #95275)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 12 10:41:16 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 c5790206f719c8fac168ae488420f31800d55cf0 9235a34b9110f881a52ef05c937f1b869fa9d71c -- compiler-rt/lib/builtins/cpu_model/aarch64/fmv/apple.inc
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/builtins/cpu_model/aarch64/fmv/apple.inc b/compiler-rt/lib/builtins/cpu_model/aarch64/fmv/apple.inc
index 6c6a71eed4..cada3fd797 100644
--- a/compiler-rt/lib/builtins/cpu_model/aarch64/fmv/apple.inc
+++ b/compiler-rt/lib/builtins/cpu_model/aarch64/fmv/apple.inc
@@ -3,8 +3,8 @@
#include <sys/sysctl.h>
#if __has_include(<arm/cpu_capabilities_public.h>)
-# include <arm/cpu_capabilities_public.h>
-# define HAS_CPU_CAPABILITIES_PUBLIC_H 1
+#include <arm/cpu_capabilities_public.h>
+#define HAS_CPU_CAPABILITIES_PUBLIC_H 1
#endif
static bool isKnownAndSupported(const char *name) {
@@ -34,12 +34,13 @@ void __init_cpu_features_resolver(void) {
// ~20-something sysctls path.
if (!sysctlbyname("hw.optional.arm.caps", &feats_bitvec, &len, 0, 0)) {
- #define CHECK_BIT(FROM, TO) do { \
- _Static_assert(FROM < CAP_BIT_NB, BROKEN_ABI_MESSAGE); \
- if (feats_bitvec[FROM / 8] & (1u << ((FROM) & 7))) { \
- features |= (1ULL << TO); \
- } \
- } while(0)
+#define CHECK_BIT(FROM, TO) \
+ do { \
+ _Static_assert(FROM < CAP_BIT_NB, BROKEN_ABI_MESSAGE); \
+ if (feats_bitvec[FROM / 8] & (1u << ((FROM) & 7))) { \
+ features |= (1ULL << TO); \
+ } \
+ } while (0)
CHECK_BIT(CAP_BIT_FEAT_FlagM, FEAT_FLAGM);
CHECK_BIT(CAP_BIT_FEAT_FlagM2, FEAT_FLAGM2);
@@ -78,7 +79,7 @@ void __init_cpu_features_resolver(void) {
features |= (1ULL << FEAT_INIT);
__atomic_store(&__aarch64_cpu_features.features, &features,
- __ATOMIC_RELAXED);
+ __ATOMIC_RELAXED);
return;
}
#endif
``````````
</details>
https://github.com/llvm/llvm-project/pull/95275
More information about the llvm-commits
mailing list