[llvm] [RISCV] Add extension information to RISCVFeatures.td. NFC (PR #89326)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 21:58:08 PDT 2024


================
@@ -10,115 +10,129 @@
 // RISC-V subtarget features and instruction predicates.
 //===----------------------------------------------------------------------===//
 
+class RISCVExtension<string n, int major, int minor, string f, string v,
+                     string d, list<RISCVExtension> i = []>
+  : SubtargetFeature<n, f, v, d,
+                     !foreach(feature, i, !cast<SubtargetFeature>(feature))> {
+  int MajorVersion = major;
+  int MinorVersion = minor;
+  bit Experimental = false;
+}
+
+class RISCVExperimentalExtension<string n, int major, int minor, string f,
----------------
topperc wrote:

That seems like unnecessary file re-arranging to remove it from experimental since you have to move the Predicates too.

It seems more readable to search for the extension and look for the Experimental than to have to scroll up to see what section it is in.

RISCVExperimentalExtension also automatically adds the "experimental-" to the feature name.

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


More information about the llvm-commits mailing list