power_insn: support empty arguments
authorDmitry Selyutin <ghostmansd@gmail.com>
Fri, 11 Nov 2022 17:05:08 +0000 (20:05 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 15 Jan 2023 19:47:22 +0000 (22:47 +0300)
src/openpower/decoder/power_insn.py

index 20bdbe72dfc8718100144da3f4474aecf5b96727..1ec8f991c945add246e6bc1d7b3fffc0932f46b5 100644 (file)
@@ -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)