power_enums: convert SVExtra to RegType
authorDmitry Selyutin <ghostmansd@gmail.com>
Tue, 13 Sep 2022 13:09:52 +0000 (16:09 +0300)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 13 Sep 2022 23:23:33 +0000 (00:23 +0100)
src/openpower/decoder/power_enums.py

index 6c71462a0683bcfedcdb5c3e515d86ecf541cd9c..7af2e63e627d79e97646dbd335ad1c924bcf2162 100644 (file)
@@ -404,6 +404,12 @@ class RegType(Enum):
     BI = CR_BIT
     BT = CR_BIT
 
+    @classmethod
+    def _missing_(cls, value):
+        if isinstance(value, SVExtraReg):
+            return cls.__members__[value.name]
+        return super()._missing_(value)
+
 
 FPTRANS_INSNS = (
     "fatan2", "fatan2s",