power_enums: introduce Reg as alias of SVExtraReg
authorDmitry Selyutin <ghostmansd@gmail.com>
Wed, 31 May 2023 19:46:21 +0000 (22:46 +0300)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 2 Jun 2023 18:51:19 +0000 (19:51 +0100)
src/openpower/decoder/power_enums.py

index 66298f989b669b5c59cf913e7aadd9081e774389..0c2d6231dcda982efad163b8bd4850242fba8233 100644 (file)
@@ -253,7 +253,7 @@ class SVExtra(Enum):
 SVEXTRA = SVExtra
 
 
-class SVExtraReg(Enum):
+class Reg(Enum):
     NONE = auto()
     RA = auto()
     RA_OR_ZERO = RA
@@ -301,19 +301,19 @@ class SVExtraReg(Enum):
     @property
     def alias(self):
         alias = {
-            SVExtraReg.RSp: SVExtraReg.RS,
-            SVExtraReg.RTp: SVExtraReg.RT,
-            SVExtraReg.FRAp: SVExtraReg.FRA,
-            SVExtraReg.FRBp: SVExtraReg.FRB,
-            SVExtraReg.FRSp: SVExtraReg.FRS,
-            SVExtraReg.FRTp: SVExtraReg.FRT,
+            Reg.RSp: Reg.RS,
+            Reg.RTp: Reg.RT,
+            Reg.FRAp: Reg.FRA,
+            Reg.FRBp: Reg.FRB,
+            Reg.FRSp: Reg.FRS,
+            Reg.FRTp: Reg.FRT,
         }.get(self)
         if alias is not None:
             return alias
 
         alias = {
-            SVExtraReg.RA_OR_ZERO: SVExtraReg.RA,
-            SVExtraReg.RT_OR_ZERO: SVExtraReg.RT,
+            Reg.RA_OR_ZERO: Reg.RA,
+            Reg.RT_OR_ZERO: Reg.RT,
         }.get(self)
         if alias is not None:
             return alias
@@ -321,6 +321,9 @@ class SVExtraReg(Enum):
         return self
 
 
+SVExtraReg = Reg
+
+
 @unique
 class SVP64PredMode(Enum):
     ALWAYS = 0
@@ -642,7 +645,7 @@ class RegType(Enum):
 
     @classmethod
     def _missing_(cls, value):
-        if isinstance(value, SVExtraReg):
+        if isinstance(value, Reg):
             return cls.__members__.get(value.name)
 
         return super()._missing_(value)