power_enums: fix RC1 predicates conversion
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 18 Dec 2022 19:13:20 +0000 (22:13 +0300)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 2 Jun 2023 18:51:16 +0000 (19:51 +0100)
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