diff options
author | 2021-07-08 21:40:35 -0400 | |
---|---|---|
committer | 2021-07-09 11:40:35 +1000 | |
commit | ee61e4074b41dec22bdb2225efcfcfbb9c1ea410 (patch) | |
tree | 0df1076b61aa64b823fddbf3d4dd1adb7d7672cf /src/emu/emumem_hep.cpp | |
parent | a9fefd83636dfdc104a83f7f0cfaec08f87a35e0 (diff) |
emu/emumem*: Removed endianness template parameter from handler_entry_read, handler_entry_write and closely related classes. (#8255)
This appears to substantially reduce compilation time and binary size without too much impact on critical paths. The only critical-path parts really touched by this are probably handler_entry_read_units<Width, AddrShift, Endian>::read and handler_entry_write_units<Width, AddrShift, Endian>::write, which no longer need a branch on descriptor endianness for the downcast. The other instances of where the endianness now needs to be fetched from the address space are practically all in constructors, which probably don't get called too often except in drivers where the memory map is regularly rewritten (e.g. segas16b.cpp); even then the performance impact probably isn't huge.
Diffstat (limited to 'src/emu/emumem_hep.cpp')
-rw-r--r-- | src/emu/emumem_hep.cpp | 90 |
1 files changed, 32 insertions, 58 deletions
diff --git a/src/emu/emumem_hep.cpp b/src/emu/emumem_hep.cpp index 38cf89b4ec3..203ff5d5c9e 100644 --- a/src/emu/emumem_hep.cpp +++ b/src/emu/emumem_hep.cpp @@ -4,7 +4,7 @@ #include "emu.h" #include "emumem_hep.h" -template<int Width, int AddrShift, endianness_t Endian> handler_entry_read_passthrough<Width, AddrShift, Endian>::~handler_entry_read_passthrough() +template<int Width, int AddrShift> handler_entry_read_passthrough<Width, AddrShift>::~handler_entry_read_passthrough() { if(m_next) { m_mph.remove_handler(this); @@ -12,11 +12,11 @@ template<int Width, int AddrShift, endianness_t Endian> handler_entry_read_passt } } -template<int Width, int AddrShift, endianness_t Endian> void handler_entry_read_passthrough<Width, AddrShift, Endian>::detach(const std::unordered_set<handler_entry *> &handlers) +template<int Width, int AddrShift> void handler_entry_read_passthrough<Width, AddrShift>::detach(const std::unordered_set<handler_entry *> &handlers) { if(!m_next->is_passthrough()) return; - auto np = static_cast<handler_entry_read_passthrough<Width, AddrShift, Endian> *>(m_next); + auto np = static_cast<handler_entry_read_passthrough<Width, AddrShift> *>(m_next); if(handlers.find(np) != handlers.end()) { m_next = np->get_subhandler(); @@ -27,7 +27,7 @@ template<int Width, int AddrShift, endianness_t Endian> void handler_entry_read_ np->detach(handlers); } -template<int Width, int AddrShift, endianness_t Endian> handler_entry_write_passthrough<Width, AddrShift, Endian>::~handler_entry_write_passthrough() +template<int Width, int AddrShift> handler_entry_write_passthrough<Width, AddrShift>::~handler_entry_write_passthrough() { if(m_next) { m_mph.remove_handler(this); @@ -35,11 +35,11 @@ template<int Width, int AddrShift, endianness_t Endian> handler_entry_write_pass } } -template<int Width, int AddrShift, endianness_t Endian> void handler_entry_write_passthrough<Width, AddrShift, Endian>::detach(const std::unordered_set<handler_entry *> &handlers) +template<int Width, int AddrShift> void handler_entry_write_passthrough<Width, AddrShift>::detach(const std::unordered_set<handler_entry *> &handlers) { if(!m_next->is_passthrough()) return; - auto np = static_cast<handler_entry_write_passthrough<Width, AddrShift, Endian> *>(m_next); + auto np = static_cast<handler_entry_write_passthrough<Width, AddrShift> *>(m_next); if(handlers.find(np) != handlers.end()) { m_next = np->get_subhandler(); @@ -50,56 +50,30 @@ template<int Width, int AddrShift, endianness_t Endian> void handler_entry_write np->detach(handlers); } -template class handler_entry_read_passthrough<0, 1, ENDIANNESS_LITTLE>; -template class handler_entry_read_passthrough<0, 1, ENDIANNESS_BIG>; -template class handler_entry_read_passthrough<0, 0, ENDIANNESS_LITTLE>; -template class handler_entry_read_passthrough<0, 0, ENDIANNESS_BIG>; -template class handler_entry_read_passthrough<1, 3, ENDIANNESS_LITTLE>; -template class handler_entry_read_passthrough<1, 3, ENDIANNESS_BIG>; -template class handler_entry_read_passthrough<1, 0, ENDIANNESS_LITTLE>; -template class handler_entry_read_passthrough<1, 0, ENDIANNESS_BIG>; -template class handler_entry_read_passthrough<1, -1, ENDIANNESS_LITTLE>; -template class handler_entry_read_passthrough<1, -1, ENDIANNESS_BIG>; -template class handler_entry_read_passthrough<2, 3, ENDIANNESS_LITTLE>; -template class handler_entry_read_passthrough<2, 3, ENDIANNESS_BIG>; -template class handler_entry_read_passthrough<2, 0, ENDIANNESS_LITTLE>; -template class handler_entry_read_passthrough<2, 0, ENDIANNESS_BIG>; -template class handler_entry_read_passthrough<2, -1, ENDIANNESS_LITTLE>; -template class handler_entry_read_passthrough<2, -1, ENDIANNESS_BIG>; -template class handler_entry_read_passthrough<2, -2, ENDIANNESS_LITTLE>; -template class handler_entry_read_passthrough<2, -2, ENDIANNESS_BIG>; -template class handler_entry_read_passthrough<3, 0, ENDIANNESS_LITTLE>; -template class handler_entry_read_passthrough<3, 0, ENDIANNESS_BIG>; -template class handler_entry_read_passthrough<3, -1, ENDIANNESS_LITTLE>; -template class handler_entry_read_passthrough<3, -1, ENDIANNESS_BIG>; -template class handler_entry_read_passthrough<3, -2, ENDIANNESS_LITTLE>; -template class handler_entry_read_passthrough<3, -2, ENDIANNESS_BIG>; -template class handler_entry_read_passthrough<3, -3, ENDIANNESS_LITTLE>; -template class handler_entry_read_passthrough<3, -3, ENDIANNESS_BIG>; +template class handler_entry_read_passthrough<0, 1>; +template class handler_entry_read_passthrough<0, 0>; +template class handler_entry_read_passthrough<1, 3>; +template class handler_entry_read_passthrough<1, 0>; +template class handler_entry_read_passthrough<1, -1>; +template class handler_entry_read_passthrough<2, 3>; +template class handler_entry_read_passthrough<2, 0>; +template class handler_entry_read_passthrough<2, -1>; +template class handler_entry_read_passthrough<2, -2>; +template class handler_entry_read_passthrough<3, 0>; +template class handler_entry_read_passthrough<3, -1>; +template class handler_entry_read_passthrough<3, -2>; +template class handler_entry_read_passthrough<3, -3>; -template class handler_entry_write_passthrough<0, 1, ENDIANNESS_LITTLE>; -template class handler_entry_write_passthrough<0, 1, ENDIANNESS_BIG>; -template class handler_entry_write_passthrough<0, 0, ENDIANNESS_LITTLE>; -template class handler_entry_write_passthrough<0, 0, ENDIANNESS_BIG>; -template class handler_entry_write_passthrough<1, 3, ENDIANNESS_LITTLE>; -template class handler_entry_write_passthrough<1, 3, ENDIANNESS_BIG>; -template class handler_entry_write_passthrough<1, 0, ENDIANNESS_LITTLE>; -template class handler_entry_write_passthrough<1, 0, ENDIANNESS_BIG>; -template class handler_entry_write_passthrough<1, -1, ENDIANNESS_LITTLE>; -template class handler_entry_write_passthrough<1, -1, ENDIANNESS_BIG>; -template class handler_entry_write_passthrough<2, 3, ENDIANNESS_LITTLE>; -template class handler_entry_write_passthrough<2, 3, ENDIANNESS_BIG>; -template class handler_entry_write_passthrough<2, 0, ENDIANNESS_LITTLE>; -template class handler_entry_write_passthrough<2, 0, ENDIANNESS_BIG>; -template class handler_entry_write_passthrough<2, -1, ENDIANNESS_LITTLE>; -template class handler_entry_write_passthrough<2, -1, ENDIANNESS_BIG>; -template class handler_entry_write_passthrough<2, -2, ENDIANNESS_LITTLE>; -template class handler_entry_write_passthrough<2, -2, ENDIANNESS_BIG>; -template class handler_entry_write_passthrough<3, 0, ENDIANNESS_LITTLE>; -template class handler_entry_write_passthrough<3, 0, ENDIANNESS_BIG>; -template class handler_entry_write_passthrough<3, -1, ENDIANNESS_LITTLE>; -template class handler_entry_write_passthrough<3, -1, ENDIANNESS_BIG>; -template class handler_entry_write_passthrough<3, -2, ENDIANNESS_LITTLE>; -template class handler_entry_write_passthrough<3, -2, ENDIANNESS_BIG>; -template class handler_entry_write_passthrough<3, -3, ENDIANNESS_LITTLE>; -template class handler_entry_write_passthrough<3, -3, ENDIANNESS_BIG>; +template class handler_entry_write_passthrough<0, 1>; +template class handler_entry_write_passthrough<0, 0>; +template class handler_entry_write_passthrough<1, 3>; +template class handler_entry_write_passthrough<1, 0>; +template class handler_entry_write_passthrough<1, -1>; +template class handler_entry_write_passthrough<2, 3>; +template class handler_entry_write_passthrough<2, 0>; +template class handler_entry_write_passthrough<2, -1>; +template class handler_entry_write_passthrough<2, -2>; +template class handler_entry_write_passthrough<3, 0>; +template class handler_entry_write_passthrough<3, -1>; +template class handler_entry_write_passthrough<3, -2>; +template class handler_entry_write_passthrough<3, -3>; |