power_insn: support els specifier assembly
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 20 Nov 2022 14:17:32 +0000 (17:17 +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 a9ac113296ef26cb51db74c77f10638855f8214c..58190b4630509b1687ba247a73aaeb9b031e4939 100644 (file)
@@ -2817,6 +2817,22 @@ class SpecifierDZ(SpecifierXZ):
             spec.validate(others=items)
 
 
+@_dataclasses.dataclass(eq=True, frozen=True)
+class SpecifierEls(Specifier):
+    @classmethod
+    def match(cls, desc, record):
+        if desc != "els":
+            return None
+
+        return cls(record=record)
+
+    def assemble(self, insn):
+        rm = insn.prefix.rm.select(record=self.record)
+        rm.els = 1
+        if self.record.svp64.mode is _SVMode.LDST_IDX:
+            rm.mode.sel = 1
+
+
 class Specifiers(tuple):
     SPECS = (
         SpecifierW,
@@ -2831,6 +2847,7 @@ class Specifiers(tuple):
         SpecifierZZ,
         SpecifierSZ,
         SpecifierDZ,
+        SpecifierEls,
     )
 
     def __new__(cls, items, record):