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


        
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to