power_insn: support pi/lf specifiers
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 11 Dec 2022 16:53:25 +0000 (19:53 +0300)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 2 Jun 2023 18:51:16 +0000 (19:51 +0100)
src/openpower/decoder/power_insn.py

index d0799952fdf2f37999c25eb05dde01be41406282..b8cbcf986b3c94257a71df0cf2313c81ff56230c 100644 (file)
@@ -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):