Revert "remove fuck-up by programmerjake not reading the specification for svstep"
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 30 Aug 2022 13:20:08 +0000 (14:20 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 30 Aug 2022 13:20:08 +0000 (14:20 +0100)
This reverts commit 1a06aea1fe266a75af713ac9815306696a1ffa4e.

src/openpower/sv/trans/svp64.py

index b55e065474a5ed1f824cf9f7217bd13ad4d81c20..0c3e3f876420a5c05d214b15c97ff68730c47048 100644 (file)
@@ -1295,6 +1295,12 @@ class SVP64Asm:
         if not v30b_op.endswith('.'):
             v30b_op_rc += rc
 
+        # svstep is weird
+        # FIXME(lkcl): should sv.svstep be like svstep?
+        if v30b_op_rc in ("svstep", "svstep."):
+            # compensate for `SVi -= 1` in svstep()
+            v30b_newfields[1] = str(int(v30b_newfields[1]) + 1)
+
         custom_insn_hook = CUSTOM_INSNS.get(v30b_op_rc)
         if custom_insn_hook is not None:
             fields = tuple(map(to_number, v30b_newfields))