remove f"" use simpler code, easier to read
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 18 Sep 2022 17:25:21 +0000 (18:25 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 18 Sep 2022 17:25:21 +0000 (18:25 +0100)
src/openpower/decoder/power_insn.py

index 1f216388bb574a20ed5e1828ca9d1c0b61bc1b04..c54c5ca031e3726bf553483ccc2fd8582b1bc261 100644 (file)
@@ -1927,19 +1927,18 @@ class SVP64Instruction(PrefixedInstruction):
             Rc = bool(record.mdwn.operands["Rc"].value)
         rm = self.prefix.rm.select(record=record, Rc=Rc)
 
-        specifiers = tuple(rm.specifiers(record=record))
-        if specifiers:
-            specifiers = "/".join(specifiers)
-            specifiers = f"/{specifiers}"
-        else:
-            specifiers = ""
+        # convert specifiers to /x/y/z
+        specifiers = list(rm.specifiers(record=record))
+        if specifiers: # if any add one extra to get the extra "/"
+            specifiers = ['']+specifiers
+        specifiers = "/".join(specifiers)
 
+        # convert operands to " ,x,y,z"
         operands = tuple(map(_operator.itemgetter(1),
             self.dynamic_operands(db=db, verbosity=verbosity)))
-        if operands:
-            operands = f" {','.join(operands)}"
-        else:
-            operands = ""
+        operands = ','.join(operands)
+        if operands: # if any separate with a space
+            operands = " " + operands
 
         yield f"{blob_prefix}{name}{specifiers}{operands}"
         if blob_suffix: