From: Dmitry Selyutin Date: Mon, 21 Nov 2022 17:54:52 +0000 (+0300) Subject: power_insn: support vs/vsi/vsb/vsbi specifiers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=60168c8ae0852ba27e197c30508b57461ef11477;p=openpower-isa.git power_insn: support vs/vsi/vsb/vsbi specifiers --- diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 5fec824f..a3d4cd47 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -2985,6 +2985,58 @@ class SpecifierLRu(SpecifierBranch): rm.LRu = 1 +@_dataclasses.dataclass(eq=True, frozen=True) +class SpecifierVS(SpecifierBranch): + @classmethod + def match(cls, desc, record): + return super().match(desc=desc, record=record, etalon="vs") + + def assemble(self, insn): + rm = insn.prefix.rm.select(record=self.record) + rm.VLS = 1 + rm.VLi = 0 + rm.VSb = 0 + + +@_dataclasses.dataclass(eq=True, frozen=True) +class SpecifierVSi(SpecifierVS): + @classmethod + def match(cls, desc, record): + return super().match(desc=desc, record=record, etalon="vsi") + + def assemble(self, insn): + rm = insn.prefix.rm.select(record=self.record) + rm.VLS = 1 + rm.VLi = 1 + rm.VSb = 0 + + +@_dataclasses.dataclass(eq=True, frozen=True) +class SpecifierVSb(SpecifierVS): + @classmethod + def match(cls, desc, record): + return super().match(desc=desc, record=record, etalon="vsb") + + def assemble(self, insn): + rm = insn.prefix.rm.select(record=self.record) + rm.VLS = 1 + rm.VLi = 0 + rm.VSb = 1 + + +@_dataclasses.dataclass(eq=True, frozen=True) +class SpecifierVSbi(SpecifierVS): + @classmethod + def match(cls, desc, record): + return super().match(desc=desc, record=record, etalon="vsbi") + + def assemble(self, insn): + rm = insn.prefix.rm.select(record=self.record) + rm.VLS = 1 + rm.VLi = 1 + rm.VSb = 1 + + class Specifiers(tuple): SPECS = ( SpecifierW, @@ -3010,6 +3062,10 @@ class Specifiers(tuple): SpecifierSL, SpecifierSLu, SpecifierLRu, + SpecifierVS, + SpecifierVSi, + SpecifierVSb, + SpecifierVSbi, ) def __new__(cls, items, record):