power_insn: support snz specifier
authorDmitry Selyutin <ghostmansd@gmail.com>
Mon, 21 Nov 2022 17:34:11 +0000 (20:34 +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 84cd5e1cf49dfd4574c9365d91c3366c914d2a1d..c5c3b51dbdf4fc1bb545f3c3a7b40f2cf405ec80 100644 (file)
@@ -2940,6 +2940,18 @@ class SpecifierAll(SpecifierBranch):
         rm.ALL = 1
 
 
+@_dataclasses.dataclass(eq=True, frozen=True)
+class SpecifierSNZ(SpecifierBranch):
+    @classmethod
+    def match(cls, desc, record):
+        return super().match(desc=desc, record=record, etalon="snz")
+
+    def assemble(self, insn):
+        rm = insn.prefix.rm.select(record=self.record)
+        rm.sz = 1
+        rm.SNZ = 1
+
+
 class Specifiers(tuple):
     SPECS = (
         SpecifierW,
@@ -2961,6 +2973,7 @@ class Specifiers(tuple):
         SpecifierMRR,
         SpecifierCRM,
         SpecifierAll,
+        SpecifierSNZ,
     )
 
     def __new__(cls, items, record):