[PATCH] D105274: Define sys::getHostCPUName for RISC-V
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 7 09:12:39 PDT 2021
craig.topper added inline comments.
================
Comment at: llvm/lib/Support/Host.cpp:1325
+ return "generic-rv64";
+#else
+ return "generic-rv32";
----------------
schwab wrote:
> craig.topper wrote:
> > Should we check __riscv_xlen == 32 here and leave some assert return "generic" if its not one of the 2 values. That would cover us better if __riscv_xlen isn't defined for some reason
> What do you want to assert?
I was thinking something like
```
#if __riscv_xlen == 64
return "generic-rv64";
#elsif __riscv_xlen == 32
return "generic-rv32";
#else
assert(false && "Couldn't determine xlen")
return "generic";
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105274/new/
https://reviews.llvm.org/D105274
More information about the llvm-commits
mailing list