power_insn: support empty arguments
authorDmitry Selyutin <ghostmansd@gmail.com>
Fri, 11 Nov 2022 17:05:08 +0000 (20:05 +0300)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 2 Jun 2023 18:51:16 +0000 (19:51 +0100)
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)