power_insn: support sl specifier
authorDmitry Selyutin <ghostmansd@gmail.com>
Mon, 21 Nov 2022 17:35:24 +0000 (20:35 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 15 Jan 2023 19:47:22 +0000 (22:47 +0300)
src/openpower/decoder/power_insn.py

index c5c3b51dbdf4fc1bb545f3c3a7b40f2cf405ec80..2fd14eeb6e0fceb0452f6967265b20504a0f92ba 100644 (file)
@@ -2952,6 +2952,17 @@ class SpecifierSNZ(SpecifierBranch):
         rm.SNZ = 1
 
 
+@_dataclasses.dataclass(eq=True, frozen=True)
+class SpecifierSL(SpecifierBranch):
+    @classmethod
+    def match(cls, desc, record):
+        return super().match(desc=desc, record=record, etalon="sl")
+
+    def assemble(self, insn):
+        rm = insn.prefix.rm.select(record=self.record)
+        rm.SL = 1
+
+
 class Specifiers(tuple):
     SPECS = (
         SpecifierW,
@@ -2974,6 +2985,7 @@ class Specifiers(tuple):
         SpecifierCRM,
         SpecifierAll,
         SpecifierSNZ,
+        SpecifierSL,
     )
 
     def __new__(cls, items, record):