simplify ISACaller execute_one
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 1 Oct 2022 13:43:24 +0000 (14:43 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 1 Oct 2022 13:43:24 +0000 (14:43 +0100)
src/openpower/decoder/isa/caller.py

index 2f9d8aa059aeb15bf7a3b29a91a1c635dc434f46..a17365a1fe5f4287e230d61d006c02d77fcf6c17 100644 (file)
@@ -1432,18 +1432,14 @@ class ISACaller(ISACallerHelper, ISAFPHelpers, StepLoop):
         """execute one instruction
         """
         # get the disassembly code for this instruction
-        if self.is_svp64_mode:
-            if not self.disassembly:
-                code = yield from self.get_assembly_name()
-            else:
-                code = self.disassembly[self._pc+4]
-            log("    svp64 sim-execute", hex(self._pc), code)
+        if not self.disassembly:
+            code = yield from self.get_assembly_name()
         else:
-            if not self.disassembly:
-                code = yield from self.get_assembly_name()
-            else:
-                code = self.disassembly[self._pc]
-            log("sim-execute", hex(self._pc), code)
+            offs, dbg = 0, ""
+            if self.is_svp64_mode:
+               offs, dbg = 4, "svp64 "
+            code = self.disassembly[self._pc+offs]
+            log("    %s sim-execute" % dbg, hex(self._pc), code)
         opname = code.split(' ')[0]
         try:
             yield from self.call(opname)         # execute the instruction