From: Dmitry Selyutin Date: Mon, 21 Nov 2022 17:58:15 +0000 (+0300) Subject: power_insn: support ctr/cti specifiers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=915797c8b044055d9b8be972cf7bfb5f118149f2;p=openpower-isa.git power_insn: support ctr/cti specifiers --- diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index a3d4cd47..d0799952 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -3037,6 +3037,35 @@ class SpecifierVSbi(SpecifierVS): rm.VSb = 1 +@_dataclasses.dataclass(eq=True, frozen=True) +class SpecifierCTR(SpecifierVS): + @classmethod + def match(cls, desc, record): + if desc != "ctr": + return None + + return cls(record=record) + + def assemble(self, insn): + rm = insn.prefix.rm.select(record=self.record) + rm.CTR = 1 + + +@_dataclasses.dataclass(eq=True, frozen=True) +class SpecifierCTi(SpecifierVS): + @classmethod + def match(cls, desc, record): + if desc != "cti": + return None + + return cls(record=record) + + def assemble(self, insn): + rm = insn.prefix.rm.select(record=self.record) + rm.CTR = 1 + rm.CTi = 1 + + class Specifiers(tuple): SPECS = ( SpecifierW, @@ -3066,6 +3095,8 @@ class Specifiers(tuple): SpecifierVSi, SpecifierVSb, SpecifierVSbi, + SpecifierCTR, + SpecifierCTi, ) def __new__(cls, items, record):