power_insn: simplify code
authorDmitry Selyutin <ghostmansd@gmail.com>
Fri, 9 Sep 2022 12:16:45 +0000 (15:16 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sat, 10 Sep 2022 04:31:35 +0000 (07:31 +0300)
src/openpower/decoder/power_insn.py

index 907e3acd10ba646789b565285b34e1d08a495985..1175fc11d75cb9e024ace1f06e56c33a39c76844 100644 (file)
@@ -573,9 +573,12 @@ class DynamicOperandReg(DynamicOperand):
         if isinstance(insn, SVP64Instruction):
             span = tuple(map(lambda bit: (bit + 32), span))
         value = insn[span]
+        span = tuple(map(str, span))
 
         if isinstance(insn, SVP64Instruction):
             extra_idx = self.extra_idx(record=record)
+            if extra_idx is _SVExtra.NONE:
+                return (vector, value, span)
 
             if record.etype is _SVEtype.EXTRA3:
                 spec = insn.prefix.rm.extra3[extra_idx]
@@ -586,7 +589,6 @@ class DynamicOperandReg(DynamicOperand):
 
             if spec != 0:
                 vector = bool(spec[0])
-                span = tuple(map(str, span))
                 spec_span = spec.__class__
                 if record.etype is _SVEtype.EXTRA3:
                     spec_span = tuple(map(str, spec_span[1, 2]))
@@ -604,8 +606,6 @@ class DynamicOperandReg(DynamicOperand):
 
                 (value, span) = merge(vector, value, span, spec, spec_span)
 
-        span = tuple(map(str, span))
-
         return (vector, value, span)
 
     @property