[PATCH] D131851: [RISCV] Add rv32 or rv64 suffix to generic cpu name
luxufan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 14 20:12:24 PDT 2022
StephenFan updated this revision to Diff 452581.
StephenFan added a comment.
Determine if it is rv32 or rv64 by __riscv_xlen
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131851/new/
https://reviews.llvm.org/D131851
Files:
llvm/lib/Support/Host.cpp
Index: llvm/lib/Support/Host.cpp
===================================================================
--- llvm/lib/Support/Host.cpp
+++ llvm/lib/Support/Host.cpp
@@ -406,7 +406,13 @@
return StringSwitch<const char *>(UArch)
.Case("sifive,u74-mc", "sifive-u74")
.Case("sifive,bullet0", "sifive-u74")
+#if __riscv_xlen == 64
+ .Default("generic-rv64");
+#elif __riscv_xlen == 32
+ .Default("generic-rv32");
+#else
.Default("generic");
+#endif
}
StringRef sys::detail::getHostCPUNameForBPF() {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131851.452581.patch
Type: text/x-patch
Size: 528 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220815/5ae93e3c/attachment.bin>
More information about the llvm-commits
mailing list