From: Dmitry Selyutin Date: Mon, 21 Nov 2022 17:33:22 +0000 (+0300) Subject: power_insn: support all specifier X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a102042fa701f0bd6be41773d5692443e34abbce;p=openpower-isa.git power_insn: support all specifier --- diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index a6e69dfa..84cd5e1c 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -2915,6 +2915,31 @@ class SpecifierCRM(Specifier): rm.crm = 1 +@_dataclasses.dataclass(eq=True, frozen=True) +class SpecifierBranch(Specifier): + @classmethod + def match(cls, desc, record, etalon): + if desc != etalon: + return None + + return cls(record=record) + + def validate(self, others): + if self.record.svp64.mode != _SVMode.BRANCH: + raise ValueError("only branch modes supported") + + +@_dataclasses.dataclass(eq=True, frozen=True) +class SpecifierAll(SpecifierBranch): + @classmethod + def match(cls, desc, record): + return super().match(desc=desc, record=record, etalon="all") + + def assemble(self, insn): + rm = insn.prefix.rm.select(record=self.record) + rm.ALL = 1 + + class Specifiers(tuple): SPECS = ( SpecifierW, @@ -2935,6 +2960,7 @@ class Specifiers(tuple): SpecifierMR, SpecifierMRR, SpecifierCRM, + SpecifierAll, ) def __new__(cls, items, record):