From 22513fb6fe281f5ccb75aaddb6417a12a66c313d Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Mon, 25 May 2020 16:42:42 +0200 Subject: emumem: A little more speedup. cache and specific change syntax, and are not pointers anymore [O. Galibert] The last(?) two changes are: - Add a template parameter to everything (theoretically the address space width, in practice a level derived from it to keep as much compatibility between widths as possible) so that the shift size becomes a constant. - Change the syntax of declaring and initializing the caches and specifics so that they're embedded in the owner device. Solves lifetime issues and also removes one indirection (looking up the base dispatch pointer through the cache/specific pointer). --- src/devices/cpu/rsp/rspdrc.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/devices/cpu/rsp/rspdrc.cpp') diff --git a/src/devices/cpu/rsp/rspdrc.cpp b/src/devices/cpu/rsp/rspdrc.cpp index a91db94ceeb..c9ec2bcb4b3 100644 --- a/src/devices/cpu/rsp/rspdrc.cpp +++ b/src/devices/cpu/rsp/rspdrc.cpp @@ -405,7 +405,7 @@ void rsp_device::code_compile_block(offs_t pc) } /* validate this code block if we're not pointing into ROM */ - if (m_program->get_write_ptr(seqhead->physpc) != nullptr) + if (m_program.space().get_write_ptr(seqhead->physpc) != nullptr) generate_checksum_block(block, compiler, seqhead, seqlast); /* label this instruction, if it may be jumped to locally */ @@ -654,12 +654,12 @@ void rsp_device::generate_checksum_block(drcuml_block &block, compiler_state &co if (!(seqhead->flags & OPFLAG_VIRTUAL_NOOP)) { uint32_t sum = seqhead->opptr.l[0]; - void *base = m_pcache->read_ptr(seqhead->physpc | 0x1000); + void *base = m_pcache.read_ptr(seqhead->physpc | 0x1000); UML_LOAD(block, I0, base, 0, SIZE_DWORD, SCALE_x4); // load i0,base,0,dword if (seqhead->delay.first() != nullptr && seqhead->physpc != seqhead->delay.first()->physpc) { - base = m_pcache->read_ptr((seqhead->delay.first()->physpc & 0x00000fff) | 0x1000); + base = m_pcache.read_ptr((seqhead->delay.first()->physpc & 0x00000fff) | 0x1000); assert(base != nullptr); UML_LOAD(block, I1, base, 0, SIZE_DWORD, SCALE_x4); // load i1,base,dword UML_ADD(block, I0, I0, I1); // add i0,i0,i1 @@ -676,13 +676,13 @@ void rsp_device::generate_checksum_block(drcuml_block &block, compiler_state &co else { uint32_t sum = 0; - void *base = m_pcache->read_ptr(seqhead->physpc | 0x1000); + void *base = m_pcache.read_ptr(seqhead->physpc | 0x1000); UML_LOAD(block, I0, base, 0, SIZE_DWORD, SCALE_x4); // load i0,base,0,dword sum += seqhead->opptr.l[0]; for (curdesc = seqhead->next(); curdesc != seqlast->next(); curdesc = curdesc->next()) if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) { - base = m_pcache->read_ptr(curdesc->physpc | 0x1000); + base = m_pcache.read_ptr(curdesc->physpc | 0x1000); assert(base != nullptr); UML_LOAD(block, I1, base, 0, SIZE_DWORD, SCALE_x4); // load i1,base,dword UML_ADD(block, I0, I0, I1); // add i0,i0,i1 @@ -690,7 +690,7 @@ void rsp_device::generate_checksum_block(drcuml_block &block, compiler_state &co if (curdesc->delay.first() != nullptr && (curdesc == seqlast || (curdesc->next() != nullptr && curdesc->next()->physpc != curdesc->delay.first()->physpc))) { - base = m_pcache->read_ptr((curdesc->delay.first()->physpc & 0x00000fff) | 0x1000); + base = m_pcache.read_ptr((curdesc->delay.first()->physpc & 0x00000fff) | 0x1000); assert(base != nullptr); UML_LOAD(block, I1, base, 0, SIZE_DWORD, SCALE_x4); // load i1,base,dword UML_ADD(block, I0, I0, I1); // add i0,i0,i1 -- cgit v1.2.3-70-g09d2