[llvm] [RISCV] Add groupid/bitmask for RISC-V extension (PR #94440)

Brandon Wu via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 5 03:24:40 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,
----------------
4vtomat wrote:

Can we just use 1 operator here
```
bool operator()(const RISCVExtensionBitmaskTable::RISCVExtensionBitmask &LHS,
                           const RISCVExtensionBitmaskTable::RISCVExtensionBitmask &RHS)
```
and wrap the `ExtName` in `getExtensionBitmask` with `RISCVExtensionBitmask`?

https://github.com/llvm/llvm-project/pull/94440


More information about the llvm-commits mailing list