power_enums: introduce SelType as alias of SVExtraRegType
authorDmitry Selyutin <ghostmansd@gmail.com>
Wed, 31 May 2023 18:48:42 +0000 (21:48 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Thu, 1 Jun 2023 08:19:38 +0000 (11:19 +0300)
src/openpower/decoder/power_enums.py

index 9d6a9ff183b261e1e71705228cefe12234fe8448..2a7456021a34b5e3b33b88350e6d651df3e466c5 100644 (file)
@@ -253,12 +253,6 @@ class SVExtra(Enum):
 SVEXTRA = SVExtra
 
 
-class SVExtraRegType(Enum):
-    NONE = None
-    SRC = 's'
-    DST = 'd'
-
-
 class SVExtraReg(Enum):
     NONE = auto()
     RA = auto()
@@ -952,6 +946,22 @@ class MicrOp(Enum):
     OP_MADDRS = 105
 
 
+class SelType(Enum):
+    NONE = None
+    SRC = 's'
+    DST = 'd'
+
+    def __repr__(self):
+        return {
+            SelType.NONE: "none",
+            SelType.SRC: "src",
+            SelType.DST: "dst",
+        }[self]
+
+
+SVExtraRegType = SelType
+
+
 class In1Sel(Enum):
     NONE = 0
     RA = 1