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/unsp/unspdrc.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/devices/cpu/unsp/unspdrc.cpp') diff --git a/src/devices/cpu/unsp/unspdrc.cpp b/src/devices/cpu/unsp/unspdrc.cpp index 32011522c2e..8db11bc19e1 100644 --- a/src/devices/cpu/unsp/unspdrc.cpp +++ b/src/devices/cpu/unsp/unspdrc.cpp @@ -204,7 +204,7 @@ void unsp_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 */ @@ -526,7 +526,7 @@ void unsp_device::generate_checksum_block(drcuml_block &block, compiler_state &c } /* full verification; sum up everything */ - void *memptr = m_program->get_write_ptr(seqhead->physpc); + void *memptr = m_program.space().get_write_ptr(seqhead->physpc); UML_LOAD(block, I0, memptr, 0, SIZE_WORD, SCALE_x2); uint32_t sum = seqhead->opptr.w[0]; for (int i = 1; i < seqhead->length; i++) @@ -539,7 +539,7 @@ void unsp_device::generate_checksum_block(drcuml_block &block, compiler_state &c { if (!(curdesc->flags & OPFLAG_VIRTUAL_NOOP)) { - memptr = m_program->get_write_ptr(curdesc->physpc); + memptr = m_program.space().get_write_ptr(curdesc->physpc); UML_LOAD(block, I1, memptr, 0, SIZE_WORD, SCALE_x2); UML_ADD(block, I0, I0, I1); sum += curdesc->opptr.w[0]; @@ -1158,7 +1158,7 @@ bool unsp_device::generate_opcode(drcuml_block &block, compiler_state &compiler, case 0x01: // imm16 { UML_MOV(block, I2, mem(&m_core->m_r[opb])); - const uint16_t r1 = m_pr16(desc->pc + 1); + const uint16_t r1 = m_cache.read_word(desc->pc + 1); generate_add_lpc(block, 1); UML_MOV(block, I1, r1); break; @@ -1167,7 +1167,7 @@ bool unsp_device::generate_opcode(drcuml_block &block, compiler_state &compiler, case 0x02: // [imm16] { UML_MOV(block, I2, mem(&m_core->m_r[opb])); - const uint16_t r1 = m_pr16(desc->pc + 1); + const uint16_t r1 = m_cache.read_word(desc->pc + 1); generate_add_lpc(block, 1); UML_MOV(block, I0, r1); if (op0 != 0x0d) @@ -1179,7 +1179,7 @@ bool unsp_device::generate_opcode(drcuml_block &block, compiler_state &compiler, { UML_MOV(block, I1, I2); UML_MOV(block, I2, mem(&m_core->m_r[opb])); - const uint16_t r2 = m_pr16(desc->pc + 1); + const uint16_t r2 = m_cache.read_word(desc->pc + 1); generate_add_lpc(block, 1); UML_MOV(block, I0, r2); break; -- cgit v1.2.3-70-g09d2