power_insn: support sw specifier
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 18 Sep 2022 08:29:36 +0000 (11:29 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 18 Sep 2022 08:29:36 +0000 (11:29 +0300)
src/openpower/decoder/power_insn.py

index 9f80d3a33d2754c83119726e77fffef63fd7a3b2..a0fcf49c811b19fc384a7b405258635a34ad70e2 100644 (file)
@@ -1303,14 +1303,18 @@ class BaseRM(_Mapping):
 class NormalLDSTBaseRM(BaseRM):
     @property
     def specifiers(self):
+        width = {
+            0b11: "8",
+            0b10: "16",
+            0b01: "32",
+        }
+
         ew = int(self.elwidth)
         if ew != 0b00:
-            ew = {
-                0b11: "8",
-                0b10: "16",
-                0b01: "32",
-            }[ew]
-            yield f"ew={ew}"
+            yield f"ew={width[ew]}"
+        sw = int(self.ewsrc)
+        if sw != 0b00:
+            yield f"sw={width[sw]}"
 
         yield from super().specifiers