diff options
author | Olivier Galibert <galibert@pobox.com> | 2020-05-19 18:29:36 +0200 |
---|---|---|
committer | Olivier Galibert <galibert@pobox.com> | 2020-05-19 18:34:11 +0200 |
commit | ecef74a6103101ead7da9df827abd84afb9c2987 (patch) | |
tree | edbd6190d6b6b63d26e71c4fcea96f01da23d273 /src/emu/emumem.cpp | |
parent | beb60b87210329da52391e3275b4ecc6825a3052 (diff) |
emumem: Another slight speedup, implemented on the 680x0 for now [O. Galibert]
memory_access_specific is declared and used exactly like
memory_access_cache, but does not cache. It does, however, shortcut
the virtual call into address_space, so that's one layer of call less.
Gives another nice speedup for accesses with bad locality
(e.g. anything that's not opcodes), at the expense of having a
specifically typed object in the class. Should do well for cpus in
general, drivers can keep using the address_space access calls for
easier logistics.
Diffstat (limited to 'src/emu/emumem.cpp')
-rw-r--r-- | src/emu/emumem.cpp | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp index edf76418e5a..1881bbbc013 100644 --- a/src/emu/emumem.cpp +++ b/src/emu/emumem.cpp @@ -529,6 +529,10 @@ public: return new memory_access_cache<Width, AddrShift, Endian>(*this, m_root_read, m_root_write); } + void *create_specific() override { + return new memory_access_specific<Width, AddrShift, Endian>(*this, m_dispatch_read, m_mask_read, m_shift_read, m_dispatch_write, m_mask_write, m_shift_write); + } + void delayed_ref(handler_entry *e) { e->ref(); m_delayed_unrefs.insert(e); @@ -593,43 +597,25 @@ public: // native read NativeType read_native(offs_t offset, NativeType mask) { - g_profiler.start(PROFILER_MEMREAD); - - uX result = dispatch_read<Width, AddrShift, Endian>(m_mask_read, m_shift_read, offset, mask, m_dispatch_read);; - - g_profiler.stop(); - return result; + return dispatch_read<Width, AddrShift, Endian>(m_mask_read, m_shift_read, offset, mask, m_dispatch_read);; } // mask-less native read NativeType read_native(offs_t offset) { - g_profiler.start(PROFILER_MEMREAD); - - uX result = dispatch_read<Width, AddrShift, Endian>(m_mask_read, m_shift_read, offset, uX(0xffffffffffffffffU), m_dispatch_read);; - - g_profiler.stop(); - return result; + return dispatch_read<Width, AddrShift, Endian>(m_mask_read, m_shift_read, offset, uX(0xffffffffffffffffU), m_dispatch_read);; } // native write void write_native(offs_t offset, NativeType data, NativeType mask) { - g_profiler.start(PROFILER_MEMWRITE); - dispatch_write<Width, AddrShift, Endian>(m_mask_write, m_shift_write, offset, data, mask, m_dispatch_write);; - - g_profiler.stop(); } // mask-less native write void write_native(offs_t offset, NativeType data) { - g_profiler.start(PROFILER_MEMWRITE); - dispatch_write<Width, AddrShift, Endian>(m_mask_write, m_shift_write, offset, data, uX(0xffffffffffffffffU), m_dispatch_write);; - - g_profiler.stop(); } // virtual access to these functions |