From 082ec98a12d37130065c73f696a4b2452425acfe Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 15 Nov 2022 23:04:53 +0300 Subject: [PATCH] power_enums: support subvl conversions --- src/openpower/decoder/power_enums.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/openpower/decoder/power_enums.py b/src/openpower/decoder/power_enums.py index 3311b109..3025c255 100644 --- a/src/openpower/decoder/power_enums.py +++ b/src/openpower/decoder/power_enums.py @@ -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): -- 2.30.2