From e163d9ec9e112cb11122382412a01d8794daedf4 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Fri, 11 Nov 2022 20:05:08 +0300 Subject: [PATCH] power_insn: support empty arguments --- src/openpower/decoder/power_insn.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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) -- 2.30.2