power_insn: support crm specifier
authorDmitry Selyutin <ghostmansd@gmail.com>
Mon, 21 Nov 2022 17:32:54 +0000 (20:32 +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 ab200663c4c634b965ef684fd232861fb390f674..a6e69dfa4dc6248d640e6333b5b17f643cc44bb6 100644 (file)
@@ -2900,6 +2900,21 @@ class SpecifierMRR(Specifier):
         rm.RG = 1
 
 
+@_dataclasses.dataclass(eq=True, frozen=True)
+class SpecifierCRM(Specifier):
+    @classmethod
+    def match(cls, desc, record):
+        if desc != "crm":
+            return None
+
+        return cls(record=record)
+
+    def assemble(self, insn):
+        rm = insn.prefix.rm.select(record=self.record)
+        rm.mode.sel = 0
+        rm.crm = 1
+
+
 class Specifiers(tuple):
     SPECS = (
         SpecifierW,
@@ -2919,6 +2934,7 @@ class Specifiers(tuple):
         SpecifierSatU,
         SpecifierMR,
         SpecifierMRR,
+        SpecifierCRM,
     )
 
     def __new__(cls, items, record):