power_enums: fix RC1 predicates conversion
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 18 Dec 2022 19:13:20 +0000 (22:13 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 15 Jan 2023 19:47:22 +0000 (22:47 +0300)
src/openpower/decoder/power_enums.py

index 72532ec7ce1b1b844813b7c0faf7c4376a4eb5b2..4651102e1915f26cc324b0f5bdf9cd7aea7f3e55 100644 (file)
@@ -407,14 +407,10 @@ class SVP64PredRC1(Enum):
 
     @classmethod
     def _missing_(cls, desc):
-        if isinstance(desc, str):
-            value = desc.upper()
-            if value.startswith("~"):
-                value = f"~{value[1:].strip()}"
-
-            return cls.__members__.get(value)
-
-        return super()._missing_(desc)
+        return {
+            "RC1": SVP64PredRC1.RC1,
+            "~RC1": SVP64PredRC1.RC1_N,
+        }.get(desc)
 
     def __int__(self):
         return 1