power_enums: support subvl conversions
authorDmitry Selyutin <ghostmansd@gmail.com>
Tue, 15 Nov 2022 20:04:53 +0000 (23:04 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 15 Jan 2023 19:47:22 +0000 (22:47 +0300)
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):