[llvm] 7e186d3 - [LoongArch] Fix the procossor series mask
Weining Lu via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 2 22:01:19 PST 2024
Author: Weining Lu
Date: 2024-01-03T14:01:05+08:00
New Revision: 7e186d366d6c7def0543acc255931f617e76dff0
URL: https://github.com/llvm/llvm-project/commit/7e186d366d6c7def0543acc255931f617e76dff0
DIFF: https://github.com/llvm/llvm-project/commit/7e186d366d6c7def0543acc255931f617e76dff0.diff
LOG: [LoongArch] Fix the procossor series mask
Refer PRID_SERIES_MASK definition in linux kernel:
arch/loongarch/include/asm/cpu.h.
Added:
Modified:
llvm/lib/TargetParser/Host.cpp
Removed:
################################################################################
diff --git a/llvm/lib/TargetParser/Host.cpp b/llvm/lib/TargetParser/Host.cpp
index 2e08c7b12d9d5d..32941c013c66ef 100644
--- a/llvm/lib/TargetParser/Host.cpp
+++ b/llvm/lib/TargetParser/Host.cpp
@@ -1524,7 +1524,8 @@ StringRef sys::getHostCPUName() {
// Use processor id to detect cpu name.
uint32_t processor_id;
__asm__("cpucfg %[prid], $zero\n\t" : [prid] "=r"(processor_id));
- switch (processor_id & 0xff00) {
+ // Refer PRID_SERIES_MASK in linux kernel: arch/loongarch/include/asm/cpu.h.
+ switch (processor_id & 0xf000) {
case 0xc000: // Loongson 64bit, 4-issue
return "la464";
// TODO: Others.
More information about the llvm-commits
mailing list