# HG changeset patch # User Mike Pavone # Date 1355900164 28800 # Node ID 32650c77008a0aa36e68cf9cf90128980e2d26a5 # Parent a6a19c45d358b911692232f8ab54b67415a7e5e9 ecx was getting clobbered before the relevant temp value was used in some cases during memory reads diff -r a6a19c45d358 -r 32650c77008a m68k_to_x86.c --- a/m68k_to_x86.c Tue Dec 18 22:20:25 2012 -0800 +++ b/m68k_to_x86.c Tue Dec 18 22:56:04 2012 -0800 @@ -159,7 +159,6 @@ out = cycles(out, BUS); } out = mov_ir(out, inst->src.params.immed, SCRATCH1, SZ_D); - out = check_cycles(out); switch (inst->extra.size) { case OPSIZE_BYTE: @@ -461,7 +460,6 @@ dst = cmp_ir(dst, 0, flags_reg, inst->extra.size); dst = setcc_r(dst, CC_Z, FLAG_Z); dst = setcc_r(dst, CC_S, FLAG_N); - dst = check_cycles(dst); switch (inst->extra.size) { case OPSIZE_BYTE: diff -r a6a19c45d358 -r 32650c77008a runtime.S --- a/runtime.S Tue Dec 18 22:20:25 2012 -0800 +++ b/runtime.S Tue Dec 18 22:56:04 2012 -0800 @@ -153,7 +153,12 @@ inccycles: add $4, %rax cmp %rbp, %rax - jge handle_cycle_limit + jge do_limit + ret +do_limit: + push %rcx + call handle_cycle_limit + pop %rcx ret .global m68k_read_long_scratch1