From 9fd097d4b13d6cdeddbd5442d14323be5dd48aaf Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Mon, 21 Nov 2022 20:54:52 +0300 Subject: [PATCH] power_insn: support vs/vsi/vsb/vsbi specifiers --- src/openpower/decoder/power_insn.py | 56 +++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) 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): -- 2.30.2