Mercurial > repos > blastem
comparison m68k_core_x86.c @ 1375:b68732dcbf00
Avoid splitting m68k_check_cycles_int_latch code across memory chunks since it expects a byte-sized jump offset. Avoid an unnecessary m68k_check_cycles_int_latch for register to register moves
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 26 May 2017 19:18:19 -0700 |
parents | eaca4443e831 |
children | 747c779fc137 |
comparison
equal
deleted
inserted
replaced
1374:8f404b1fa572 | 1375:b68732dcbf00 |
---|---|
351 } | 351 } |
352 | 352 |
353 void m68k_check_cycles_int_latch(m68k_options *opts) | 353 void m68k_check_cycles_int_latch(m68k_options *opts) |
354 { | 354 { |
355 code_info *code = &opts->gen.code; | 355 code_info *code = &opts->gen.code; |
356 check_alloc_code(code, 3*MAX_INST_LEN); | |
356 uint8_t cc; | 357 uint8_t cc; |
357 if (opts->gen.limit < 0) { | 358 if (opts->gen.limit < 0) { |
358 cmp_ir(code, 1, opts->gen.cycles, SZ_D); | 359 cmp_ir(code, 1, opts->gen.cycles, SZ_D); |
359 cc = CC_NS; | 360 cc = CC_NS; |
360 } else { | 361 } else { |
726 m68k_write_size(opts, inst->extra.size, inst->dst.addr_mode == MODE_AREG_PREDEC); | 727 m68k_write_size(opts, inst->extra.size, inst->dst.addr_mode == MODE_AREG_PREDEC); |
727 if (inst->dst.addr_mode == MODE_AREG_POSTINC) { | 728 if (inst->dst.addr_mode == MODE_AREG_POSTINC) { |
728 inc_amount = inst->extra.size == OPSIZE_WORD ? 2 : (inst->extra.size == OPSIZE_LONG ? 4 : (inst->dst.params.regs.pri == 7 ? 2 : 1)); | 729 inc_amount = inst->extra.size == OPSIZE_WORD ? 2 : (inst->extra.size == OPSIZE_LONG ? 4 : (inst->dst.params.regs.pri == 7 ? 2 : 1)); |
729 addi_areg(opts, inc_amount, inst->dst.params.regs.pri); | 730 addi_areg(opts, inc_amount, inst->dst.params.regs.pri); |
730 } | 731 } |
731 } else { | 732 } else if (needs_int_latch) { |
732 m68k_check_cycles_int_latch(opts); | 733 m68k_check_cycles_int_latch(opts); |
733 } | 734 } |
734 | 735 |
735 //add cycles for prefetch | 736 //add cycles for prefetch |
736 cycles(&opts->gen, BUS); | 737 cycles(&opts->gen, BUS); |