power_insn: postpone updating per-instruction operands
authorDmitry Selyutin <ghostmansd@gmail.com>
Fri, 16 Sep 2022 14:39:51 +0000 (17:39 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Fri, 16 Sep 2022 14:39:51 +0000 (17:39 +0300)
src/openpower/decoder/power_insn.py

index 2d36a17f3681a4b2696b6fb993c274e9cc61f7fb..c3a72a2c8db45e07c89531a1c0ca21b4cd8a265c 100644 (file)
@@ -776,7 +776,7 @@ class TargetAddrOperandBD(TargetAddrOperand):
             verbosity=verbosity, indent=indent)
 
 
-class DOperandDX(DynamicOperand):
+class DOperandDX(SignedOperand):
     def span(self, record):
         operands = map(DynamicOperand, ("d0", "d1", "d2"))
         spans = map(lambda operand: operand.span(record=record), operands)
@@ -862,10 +862,10 @@ class Operands(tuple):
                 if immediate is not None:
                     operands.append(ImmediateOperand(name=immediate))
 
-                if insn in custom_insns and operand in custom_insns[insn]:
-                    dynamic_cls = custom_insns[insn][operand]
                 if operand in custom_fields:
                     dynamic_cls = custom_fields[operand]
+                if insn in custom_insns and operand in custom_insns[insn]:
+                    dynamic_cls = custom_insns[insn][operand]
 
                 if operand in _RegType.__members__:
                     regtype = _RegType[operand]