From 04e2c150ec5d00e486a41722da16a4f1649c9ca3 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sun, 11 Dec 2022 19:53:25 +0300 Subject: [PATCH] power_insn: support pi/lf specifiers --- src/openpower/decoder/power_insn.py | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index d0799952..b8cbcf98 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -3066,6 +3066,34 @@ class SpecifierCTi(SpecifierVS): rm.CTi = 1 +@_dataclasses.dataclass(eq=True, frozen=True) +class SpecifierPI(Specifier): + @classmethod + def match(cls, desc, record): + if desc != "pi": + return None + + return cls(record=record) + + def assemble(self, insn): + rm = insn.prefix.rm.select(record=self.record) + rm.pi = 1 + + +@_dataclasses.dataclass(eq=True, frozen=True) +class SpecifierLF(Specifier): + @classmethod + def match(cls, desc, record): + if desc != "lf": + return None + + return cls(record=record) + + def assemble(self, insn): + rm = insn.prefix.rm.select(record=self.record) + rm.lf = 1 + + class Specifiers(tuple): SPECS = ( SpecifierW, @@ -3097,6 +3125,8 @@ class Specifiers(tuple): SpecifierVSbi, SpecifierCTR, SpecifierCTi, + SpecifierPI, + SpecifierLF, ) def __new__(cls, items, record): -- 2.30.2