power_enums: support subvl conversions
authorDmitry Selyutin <ghostmansd@gmail.com>
Tue, 15 Nov 2022 20:04:53 +0000 (23:04 +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 3311b10931e49e49301038221dbfca54b218aacc..3025c25508ce2db5ca05886efa987e3eaaa167c1 100644 (file)
@@ -480,6 +480,18 @@ class SVP64subvl(Enum):
     VEC3 = 2
     VEC4 = 3
 
+    @classmethod
+    def _missing_(cls, desc):
+        if isinstance(desc, str):
+            name = desc.upper()
+            value = cls.__members__.get(name)
+            if value is None:
+                raise ValueError(desc)
+            return value
+        return super()._missing_(desc)
+
+SVP64SubVL = SVP64subvl
+
 
 @unique
 class SVP64sat(Enum):