From 25fc639662e7134d6d65bac3012c218cb5280f74 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Tue, 15 Nov 2022 23:56:13 +0300 Subject: [PATCH] power_insn: switch to SVP64SubVL enum --- src/openpower/decoder/power_insn.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index eaf89238..e62fda92 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -40,6 +40,7 @@ from openpower.decoder.power_enums import ( SVExtraReg as _SVExtraReg, SVP64Predicate as _SVP64Predicate, SVP64PredicateType as _SVP64PredicateType, + SVP64SubVL as _SVP64SubVL, ) from openpower.decoder.selectable_int import ( SelectableInt as _SelectableInt, @@ -2489,18 +2490,19 @@ class SpecifierWidth(Specifier): @_dataclasses.dataclass(eq=True, frozen=True) class SpecifierSubVL(Specifier): - value: int + value: _SVP64SubVL @classmethod def match(cls, desc, record): - value = {"vec2": 1, "vec3": 2, "vec4": 3}.get(desc) - if value is None: + try: + value = _SVP64SubVL(desc) + except ValueError: return None return cls(record=record, value=value) def assemble(self, insn): - insn.prefix.rm.subvl = self.value + insn.prefix.rm.subvl = int(self.value.value) @_dataclasses.dataclass(eq=True, frozen=True) -- 2.30.2