[compiler-rt] 0e5da2e - [compiler-rt] Fix the HWCAP2_EBF16 and HWCAP2_SVE_EBF16 macro value (#70905)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 27 16:44:40 PST 2023
Author: joyhou-hw
Date: 2023-11-23T10:17:55+08:00
New Revision: 0e5da2eceb89f1e947e8b9b4aa42804e4ea89acc
URL: https://github.com/llvm/llvm-project/commit/0e5da2eceb89f1e947e8b9b4aa42804e4ea89acc
DIFF: https://github.com/llvm/llvm-project/commit/0e5da2eceb89f1e947e8b9b4aa42804e4ea89acc.diff
LOG: [compiler-rt] Fix the HWCAP2_EBF16 and HWCAP2_SVE_EBF16 macro value (#70905)
HWCAP2_EBF16 (1UL << 32)
HWCAP2_SVE_EBF16 (1UL << 33)
this will overflow in aarch64 ilp32 abi, and make func
__init_cpu_features_constructor() wrong.
Added:
Modified:
compiler-rt/lib/builtins/cpu_model.c
Removed:
################################################################################
diff --git a/compiler-rt/lib/builtins/cpu_model.c b/compiler-rt/lib/builtins/cpu_model.c
index aefa56abcdd9535..b0ec5e51e96d491 100644
--- a/compiler-rt/lib/builtins/cpu_model.c
+++ b/compiler-rt/lib/builtins/cpu_model.c
@@ -1137,10 +1137,10 @@ typedef struct __ifunc_arg_t {
#define HWCAP2_WFXT (1UL << 31)
#endif
#ifndef HWCAP2_EBF16
-#define HWCAP2_EBF16 (1UL << 32)
+#define HWCAP2_EBF16 (1ULL << 32)
#endif
#ifndef HWCAP2_SVE_EBF16
-#define HWCAP2_SVE_EBF16 (1UL << 33)
+#define HWCAP2_SVE_EBF16 (1ULL << 33)
#endif
// Detect Exynos 9810 CPU
More information about the llvm-commits
mailing list