[llvm] [Target][RISCV] Add HwMode support to subregister index size/offset. (PR #86368)

Björn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 16:17:15 PDT 2024


================
@@ -83,10 +83,24 @@ class RegInfoByHwMode<list<HwMode> Ms = [], list<RegInfo> Ts = []>
   list<RegInfo> Objects = Ts;
 }
 
+class SubRegRange<int size, int offset = 0> {
+  int Size = size;      // Sub register size in bits.
+  int Offset = offset;  // Offset of the first bit of the sub-reg index.
+}
+
+class SubRegRangeByHwMode<list<HwMode> Ms = [], list<SubRegRange> Ts = []>
+    : HwModeSelect<Ms> {
+  // The length of this list must be the same as the length of Ms.
+  list<SubRegRange> Objects = Ts;
+}
+
 // SubRegIndex - Use instances of SubRegIndex to identify subregisters.
 class SubRegIndex<int size, int offset = 0> {
   string Namespace = "";
 
+  // The size/offset information, parameterized by a HW mode.
+  SubRegRangeByHwMode SubRegRanges;
----------------
bjope wrote:

Isn't it a bit confusing when both having the Size and Offset below, plus this parameterized list. Should the below definitions be removed?

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


More information about the llvm-commits mailing list