power_enums: support 8/16/32 in SVP64Width
authorDmitry Selyutin <ghostmansd@gmail.com>
Wed, 16 Nov 2022 19:47:40 +0000 (22:47 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 15 Jan 2023 19:47:22 +0000 (22:47 +0300)
src/openpower/decoder/power_enums.py

index 3025c25508ce2db5ca05886efa987e3eaaa167c1..a12a5dec3fdd38c7300db003fd452d0897dd7865 100644 (file)
@@ -472,6 +472,19 @@ class SVP64width(Enum):
     EW_16 = 2
     EW_8 = 3
 
+    @classmethod
+    def _missing_(cls, desc):
+        if isinstance(desc, str):
+            return {
+                "32": SVP64width.EW_32,
+                "16": SVP64width.EW_16,
+                "8": SVP64width.EW_8,
+            }.get(desc)
+
+        return super()._missing_(desc)
+
+SVP64Width = SVP64width
+
 
 @unique
 class SVP64subvl(Enum):