skip reading ewsrc when SVMode is CROP
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 15 May 2023 22:36:45 +0000 (23:36 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 2 Jun 2023 18:51:18 +0000 (19:51 +0100)
src/openpower/decoder/power_insn.py

index 1e909669207f0617f40fd850c81e7950b932a8c2..a1f37a060bbafb63abac88b5c156bcdf710a2815 100644 (file)
@@ -2068,6 +2068,11 @@ class WidthBaseRM(BaseRM):
         FP = False
         dw = WidthBaseRM.width(FP, int(self.elwidth))
         sw = WidthBaseRM.width(FP, int(self.ewsrc))
+        if self.record.svp64.mode is _SVMode.CROP:
+            if dw:
+                yield ("dw=" + dw)
+        else:
+            sw = WidthBaseRM.width(FP, int(self.ewsrc))
         if dw == sw and dw:
             yield ("w=" + dw)
         else:
@@ -2503,7 +2508,8 @@ class SpecifierW(SpecifierWidth):
 
     def assemble(self, insn):
         selector = insn.select(record=self.record)
-        selector.ewsrc = self.width.value
+        if self.record.svp64.mode is not _SVMode.CROP:
+            selector.ewsrc = self.width.value
         selector.elwidth = self.width.value
 
 
@@ -2511,6 +2517,8 @@ class SpecifierW(SpecifierWidth):
 class SpecifierSW(SpecifierWidth):
     @classmethod
     def match(cls, desc, record):
+        if record.svp64.mode is _SVMode.CROP:
+            return None
         return super().match(desc=desc, record=record, etalon="sw")
 
     def assemble(self, insn):