From fbc898252d31c65379801e233b3a693824f1fe9d Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Mon, 21 Nov 2022 19:48:26 +0300 Subject: [PATCH] power_insn: support mr/mrr specifiers --- src/openpower/decoder/power_insn.py | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) 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): -- 2.30.2