From: Dmitry Selyutin Date: Tue, 15 Nov 2022 20:04:53 +0000 (+0300) Subject: power_enums: support subvl conversions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=082ec98a12d37130065c73f696a4b2452425acfe;p=openpower-isa.git power_enums: support subvl conversions --- 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):