From: Dmitry Selyutin Date: Mon, 21 Nov 2022 16:48:26 +0000 (+0300) Subject: power_insn: support mr/mrr specifiers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=21e097fd1588c68c4ff33d531739e57d2bf1e36d;p=openpower-isa.git power_insn: support mr/mrr specifiers --- diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 21347503..ab200663 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -2868,6 +2868,38 @@ class SpecifierSatU(Specifier): etalon="satu", sign=False) +@_dataclasses.dataclass(eq=True, frozen=True) +class SpecifierMR(Specifier): + @classmethod + def match(cls, desc, record): + if desc != "mr": + return None + + return cls(record=record) + + def assemble(self, insn): + rm = insn.prefix.rm.select(record=self.record) + rm.mode.sel = 0 + rm.mr = 1 + rm.RG = 0 + + +@_dataclasses.dataclass(eq=True, frozen=True) +class SpecifierMRR(Specifier): + @classmethod + def match(cls, desc, record): + if desc != "mr": + return None + + return cls(record=record) + + def assemble(self, insn): + rm = insn.prefix.rm.select(record=self.record) + rm.mode.sel = 0 + rm.mr = 1 + rm.RG = 1 + + class Specifiers(tuple): SPECS = ( SpecifierW, @@ -2885,6 +2917,8 @@ class Specifiers(tuple): SpecifierEls, SpecifierSatS, SpecifierSatU, + SpecifierMR, + SpecifierMRR, ) def __new__(cls, items, record):