[llvm] [RISCV] Add groupid/bitmask for RISC-V extension (PR #94440)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 20 07:52:46 PDT 2024
================
@@ -119,6 +119,38 @@ void getFeaturesForCPU(StringRef CPU,
else
EnabledFeatures.push_back(F.substr(1));
}
+
+namespace RISCVExtensionBitmaskTable {
+#define GET_RISCVExtensionBitmaskTable_IMPL
+#include "llvm/TargetParser/RISCVTargetParserDef.inc"
+
+} // namespace RISCVExtensionBitmaskTable
+
+namespace {
+struct LessExtName {
+ bool operator()(const RISCVExtensionBitmaskTable::RISCVExtensionBitmask &LHS,
+ StringRef RHS) {
+ return StringRef(LHS.Name) < RHS;
+ }
+ bool
+ operator()(StringRef LHS,
+ const RISCVExtensionBitmaskTable::RISCVExtensionBitmask &RHS) {
+ return LHS < StringRef(RHS.Name);
+ }
+};
+} // namespace
+
+static RISCVExtensionBitmaskTable::RISCVExtensionBitmask
+getExtensionBitmask(StringRef ExtName) {
+ ArrayRef<RISCVExtensionBitmaskTable::RISCVExtensionBitmask> ExtBitmasks =
+ ArrayRef(RISCVExtensionBitmaskTable::ExtensionBitmask);
----------------
topperc wrote:
Do we need `ArrayRef` constructor on the right hand side?
https://github.com/llvm/llvm-project/pull/94440
More information about the llvm-commits
mailing list