diff options
author | 2020-05-25 16:42:42 +0200 | |
---|---|---|
committer | 2020-05-25 16:42:57 +0200 | |
commit | 22513fb6fe281f5ccb75aaddb6417a12a66c313d (patch) | |
tree | 3cf84032cc6482d685a8dbb57e015bd17c7f7fdc /src/devices/cpu/adsp2100 | |
parent | e42c2d2874cf9c1092c01ab5ce9ef997d465ce25 (diff) |
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).
Diffstat (limited to 'src/devices/cpu/adsp2100')
-rw-r--r-- | src/devices/cpu/adsp2100/adsp2100.cpp | 23 | ||||
-rw-r--r-- | src/devices/cpu/adsp2100/adsp2100.h | 8 |
2 files changed, 16 insertions, 15 deletions
diff --git a/src/devices/cpu/adsp2100/adsp2100.cpp b/src/devices/cpu/adsp2100/adsp2100.cpp index 7ef7136f66d..2f0b609ad5b 100644 --- a/src/devices/cpu/adsp2100/adsp2100.cpp +++ b/src/devices/cpu/adsp2100/adsp2100.cpp @@ -417,10 +417,11 @@ void adsp21xx_device::device_start() m_dmovlay_cb.resolve(); // get our address spaces - m_program = &space(AS_PROGRAM); - m_cache = m_program->cache<2, -2, ENDIANNESS_LITTLE>(); - m_data = &space(AS_DATA); - m_io = has_space(AS_IO) ? &space(AS_IO) : nullptr; + space(AS_PROGRAM).cache(m_cache); + space(AS_PROGRAM).specific(m_program); + space(AS_DATA).specific(m_data); + if(has_space(AS_IO)) + space(AS_IO).specific(m_io); // "core" save_item(NAME(m_core.ax0.u)); @@ -776,37 +777,37 @@ std::unique_ptr<util::disasm_interface> adsp21xx_device::create_disassembler() inline uint16_t adsp21xx_device::data_read(uint32_t addr) { - return m_data->read_word(addr); + return m_data.read_word(addr); } inline void adsp21xx_device::data_write(uint32_t addr, uint16_t data) { - m_data->write_word(addr, data); + m_data.write_word(addr, data); } inline uint16_t adsp21xx_device::io_read(uint32_t addr) { - return m_io->read_word(addr); + return m_io.read_word(addr); } inline void adsp21xx_device::io_write(uint32_t addr, uint16_t data) { - m_io->write_word(addr, data); + m_io.write_word(addr, data); } inline uint32_t adsp21xx_device::program_read(uint32_t addr) { - return m_program->read_dword(addr); + return m_program.read_dword(addr); } inline void adsp21xx_device::program_write(uint32_t addr, uint32_t data) { - m_program->write_dword(addr, data & 0xffffff); + m_program.write_dword(addr, data & 0xffffff); } inline uint32_t adsp21xx_device::opcode_read() { - return m_cache->read_dword(m_pc); + return m_cache.read_dword(m_pc); } diff --git a/src/devices/cpu/adsp2100/adsp2100.h b/src/devices/cpu/adsp2100/adsp2100.h index 6f0e3b07160..9910a7ac2b3 100644 --- a/src/devices/cpu/adsp2100/adsp2100.h +++ b/src/devices/cpu/adsp2100/adsp2100.h @@ -429,10 +429,10 @@ protected: adsp_core m_alt; // address spaces - address_space * m_program; - address_space * m_data; - address_space * m_io; - memory_access_cache<2, -2, ENDIANNESS_LITTLE> *m_cache; + memory_access<14, 2, -2, ENDIANNESS_LITTLE>::cache m_cache; + memory_access<14, 2, -2, ENDIANNESS_LITTLE>::specific m_program; + memory_access<14, 1, -1, ENDIANNESS_LITTLE>::specific m_data; + memory_access<11, 1, -1, ENDIANNESS_LITTLE>::specific m_io; // tables uint8_t m_condition_table[0x1000]; |