class Operand:
name: str
+ def span(self, record):
+ return record.fields[self.name]
+
def disassemble(self, insn, record,
verbosity=Verbosity.NORMAL, indent=""):
raise NotImplementedError
class DynamicOperand(Operand):
def disassemble(self, insn, record,
verbosity=Verbosity.NORMAL, indent=""):
- span = record.fields[self.name]
+ span = self.span(record=record)
if isinstance(insn, SVP64Instruction):
span = tuple(map(lambda bit: (bit + 32), span))
value = insn[span]
def disassemble(self, insn, record,
verbosity=Verbosity.NORMAL, indent=""):
- span = record.fields[self.name]
+ span = self.span(record=record)
if isinstance(insn, SVP64Instruction):
span = tuple(map(lambda bit: (bit + 32), span))
value = insn[span]
class DynamicOperandReg(DynamicOperand):
def spec(self, insn, record, merge):
vector = False
- span = record.fields[self.name]
+ span = self.span(record=record)
if isinstance(insn, SVP64Instruction):
span = tuple(map(lambda bit: (bit + 32), span))
value = insn[span]
class DynamicOperandTargetAddr(DynamicOperandReg):
def disassemble(self, insn, record, field,
verbosity=Verbosity.NORMAL, indent=""):
- span = record.fields[field]
+ span = self.span(record=record)
if isinstance(insn, SVP64Instruction):
span = tuple(map(lambda bit: (bit + 32), span))
value = insn[span]
@_dataclasses.dataclass(eq=True, frozen=True)
class DynamicOperandTargetAddrLI(DynamicOperandTargetAddr):
+ def span(self, record):
+ return record.fields["LI"]
+
def disassemble(self, insn, record,
verbosity=Verbosity.NORMAL, indent=""):
return super().disassemble(field="LI",
class DynamicOperandTargetAddrBD(DynamicOperandTargetAddr):
+ def span(self, record):
+ return record.fields["BD"]
+
def disassemble(self, insn, record,
verbosity=Verbosity.NORMAL, indent=""):
return super().disassemble(field="BD",