[PATCH] D105274: Define sys::getHostCPUName for RISC-V

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 8 10:08:47 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa706a5ef2251: [Support] Define sys::getHostCPUName for RISC-V (authored by schwab, committed by MaskRay).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105274/new/

https://reviews.llvm.org/D105274

Files:
  llvm/lib/Support/Host.cpp


Index: llvm/lib/Support/Host.cpp
===================================================================
--- llvm/lib/Support/Host.cpp
+++ llvm/lib/Support/Host.cpp
@@ -1356,6 +1356,16 @@
     return "generic";
   }
 }
+#elif defined(__riscv)
+StringRef sys::getHostCPUName() {
+#if __riscv_xlen == 64
+  return "generic-rv64";
+#elif __riscv_xlen == 32
+  return "generic-rv32";
+#else
+#error "Unhandled value of __riscv_xlen"
+#endif
+}
 #else
 StringRef sys::getHostCPUName() { return "generic"; }
 namespace llvm {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105274.378287.patch
Type: text/x-patch
Size: 516 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211008/489607f2/attachment.bin>


More information about the llvm-commits mailing list