power_insn: support w/dw/sw specifiers
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 18 Sep 2022 09:01:04 +0000 (12:01 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 18 Sep 2022 09:01:04 +0000 (12:01 +0300)
src/openpower/decoder/power_insn.py

index 4e900b15076ce55252a0b8366df5286ced2614ea..5426bfb00e673eb9106145aa76385d1d2e675ab7 100644 (file)
@@ -1309,12 +1309,15 @@ class NormalLDSTBaseRM(BaseRM):
             0b01: "32",
         }
 
-        ew = int(self.elwidth)
-        if ew != 0b00:
-            yield f"ew={width[ew]}"
+        dw = int(self.elwidth)
         sw = int(self.ewsrc)
-        if sw != 0b00:
-            yield f"sw={width[sw]}"
+        if all((dw, sw)) and dw == sw:
+            yield f"w={width[dw]}"
+        else:
+            if dw != 0b00:
+                yield f"dw={width[dw]}"
+            if sw != 0b00:
+                yield f"sw={width[sw]}"
 
         yield from super().specifiers