From: Dmitry Selyutin Date: Fri, 11 Nov 2022 17:05:08 +0000 (+0300) Subject: power_insn: support empty arguments X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e163d9ec9e112cb11122382412a01d8794daedf4;p=openpower-isa.git power_insn: support empty arguments --- diff --git a/src/openpower/decoder/power_insn.py b/src/openpower/decoder/power_insn.py index 20bdbe72..1ec8f991 100644 --- a/src/openpower/decoder/power_insn.py +++ b/src/openpower/decoder/power_insn.py @@ -1578,7 +1578,7 @@ class Instruction(_Mapping): yield (operand.name, operand.value) @classmethod - def assemble(cls, db, opcode, arguments): + def assemble(cls, db, opcode, arguments=None): raise NotImplementedError(f"{cls.__name__}.assemble") def disassemble(self, db, @@ -1604,7 +1604,10 @@ class WordInstruction(Instruction): return "".join(map(str, bits)) @classmethod - def assemble(cls, db, opcode, arguments): + def assemble(cls, db, opcode, arguments=None): + if arguments is None: + arguments = () + record = db[opcode] insn = cls.integer(value=0) for operand in record.static_operands: @@ -2461,7 +2464,10 @@ class SVP64Instruction(PrefixedInstruction): return "".join(map(str, bits)) @classmethod - def assemble(cls, db, opcode, arguments): + def assemble(cls, db, opcode, arguments=None): + if arguments is None: + arguments = () + record = db[opcode] insn = cls.integer(value=0)