power_insn: clean extra disassembly
authorDmitry Selyutin <ghostmansd@gmail.com>
Mon, 5 Sep 2022 19:29:09 +0000 (22:29 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Tue, 6 Sep 2022 11:44:56 +0000 (14:44 +0300)
src/openpower/decoder/power_insn.py

index e9a51625c72378cf36c123ce4873da08359b9314..568542fb9f9f4d9cf2446e099978eeb0c7198a01 100644 (file)
@@ -610,7 +610,12 @@ class DynamicOperandGPR(DynamicOperandReg):
             yield f"{int(value):0{value.bits}b}"
             yield repr(span)
             if svp64:
-                yield repr(self.extra_idx(record))
+                extra_idx = self.extra_idx(record)
+                if record.etype is _SVEtype.NONE:
+                    yield f"extra[none]"
+                else:
+                    etype = repr(record.etype).lower()
+                    yield f"{etype}{extra_idx!r}"
         else:
             yield f"r{str(int(value))}"
 
@@ -625,7 +630,12 @@ class DynamicOperandFPR(DynamicOperandReg):
             yield f"{int(value):0{value.bits}b}"
             yield repr(span)
             if svp64:
-                yield repr(self.extra_idx(record))
+                extra_idx = self.extra_idx(record)
+                if record.etype is _SVEtype.NONE:
+                    yield f"extra[none]"
+                else:
+                    etype = repr(record.etype).lower()
+                    yield f"{etype}{extra_idx!r}"
         else:
             yield f"f{str(int(value))}"