power_insn: support lru specifier
authorDmitry Selyutin <ghostmansd@gmail.com>
Mon, 21 Nov 2022 17:36:57 +0000 (20:36 +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 ea8dc5c4ca1aab020878b35d9922800db759d824..5fec824f508ee5c333c84d6feb6414da3cf6315a 100644 (file)
@@ -2974,6 +2974,17 @@ class SpecifierSLu(SpecifierBranch):
         rm.SLu = 1
 
 
+@_dataclasses.dataclass(eq=True, frozen=True)
+class SpecifierLRu(SpecifierBranch):
+    @classmethod
+    def match(cls, desc, record):
+        return super().match(desc=desc, record=record, etalon="lru")
+
+    def assemble(self, insn):
+        rm = insn.prefix.rm.select(record=self.record)
+        rm.LRu = 1
+
+
 class Specifiers(tuple):
     SPECS = (
         SpecifierW,
@@ -2998,6 +3009,7 @@ class Specifiers(tuple):
         SpecifierSNZ,
         SpecifierSL,
         SpecifierSLu,
+        SpecifierLRu,
     )
 
     def __new__(cls, items, record):