yield from generic_handler(span, "SVP64_OPERAND_CR5")
handlers = {
- insndb.SignedOperand: signed_handler,
- insndb.GPROperand: gpr_handler,
- insndb.FPROperand: fpr_handler,
insndb.GPRPairOperand: lambda span: gpr_handler(span, True),
insndb.FPRPairOperand: lambda span: fpr_handler(span, True),
+ insndb.GPROperand: gpr_handler,
+ insndb.FPROperand: fpr_handler,
insndb.CR3Operand: cr3_handler,
insndb.CR5Operand: cr5_handler,
+ insndb.SignedOperand: signed_handler,
+ insndb.DynamicOperand: generic_handler,
+ object: None,
}
self.emit(f"case 0x{(path + 1):02x}: /* {', '.join(node.names)} */")
with self:
- handler = handlers.get(node.cls, generic_handler)
+ for (cls, handler) in handlers.items():
+ if issubclass(node.cls, cls):
+ break
+ if handler is None:
+ raise ValueError("unknown handler")
for line in handler(span=node.span):
self.emit(line)
self.emit("")