power_insn: support sl specifier
authorDmitry Selyutin <ghostmansd@gmail.com>
Mon, 21 Nov 2022 17:35:24 +0000 (20:35 +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 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):