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

Pengcheng Wang via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 21:45: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,
----------------
wangpc-pp wrote:

I have one thought: what about not providing `RISCVExperimentalExtension`, instead, we add a scope:
```
let Experimental = true in {
  def ... : RISCVExtension<...>;
  // ...
}
```
We put all experimental extensions in this scope together, and once an experimental extension is ratified, we will ***move it out*** from experimental scope. This make moving an extension out from expermental concrete.

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


More information about the llvm-commits mailing list