m6502: remove expensive and unused attotime precalculation at start of each timeslice [Alex Jackson]

(nw)
This precalculation seems to be part of OG's "CPU core template", as all CPU
cores written by him do it. It's used to optimize things like onboard serial
ports and high-frequency timers; however, the m6502 and its derivatives have
neither onboard serial ports nor high-frequency timers, and the precalculation
is simply a boat anchor on drivers with 6502-family CPUs and tight interleaving.

mess c64 benchmarks (3.4 GHz Sandy Bridge i5; 64-bit Linux GCC 4.8 build)

before:
[awj@localhost trunk]$ ./mess64 -window -bench 60 c64
Average speed: 238.17% (59 seconds)
[awj@localhost trunk]$ ./mess64 -window -bench 60 c64
Average speed: 236.36% (59 seconds)

after:
[awj@localhost trunk]$ ./mess64 -window -bench 60 c64
Average speed: 279.93% (59 seconds)
[awj@localhost trunk]$ ./mess64 -window -bench 60 c64
Average speed: 279.30% (59 seconds)
This commit is contained in:
Alex W. Jackson 2014-07-01 19:30:52 +00:00
parent 020a35290e
commit 3968a42ccb
3 changed files with 0 additions and 12 deletions

View File

@ -129,7 +129,6 @@ void m6502_device::init()
inst_substate = 0;
inst_state_base = 0;
sync = false;
end_cycles = 0;
inhibit_interrupts = false;
}
@ -143,7 +142,6 @@ void m6502_device::device_reset()
apu_irq_state = false;
irq_taken = false;
v_state = false;
end_cycles = 0;
sync = false;
sync_w(CLEAR_LINE);
inhibit_interrupts = false;
@ -400,14 +398,8 @@ UINT8 m6502_device::do_asr(UINT8 v)
return v;
}
UINT64 m6502_device::get_cycle()
{
return end_cycles == 0 || icount <= 0 ? machine().time().as_ticks(clock()) : end_cycles - icount;
}
void m6502_device::execute_run()
{
end_cycles = machine().time().as_ticks(clock()) + icount;
if(inst_substate)
do_exec_partial();
@ -420,7 +412,6 @@ void m6502_device::execute_run()
}
do_exec_full();
}
end_cycles = 0;
}
void m6502_device::execute_set_input(int inputnum, int state)

View File

@ -61,7 +61,6 @@ public:
DECLARE_WRITE_LINE_MEMBER( irq_line );
DECLARE_WRITE_LINE_MEMBER( nmi_line );
UINT64 get_cycle();
bool get_sync() const { return sync; }
void disable_direct() { direct_disabled = true; }
@ -201,7 +200,6 @@ protected:
int icount;
bool nmi_state, irq_state, apu_irq_state, v_state;
bool irq_taken, sync, direct_disabled, inhibit_interrupts;
UINT64 end_cycles;
static const disasm_entry disasm_entries[0x100];

View File

@ -77,7 +77,6 @@ void m740_device::device_reset()
apu_irq_state = false;
irq_taken = false;
v_state = false;
end_cycles = 0;
sync = false;
inhibit_interrupts = false;
SP = 0x00ff;