summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/emumem.cpp
diff options
context:
space:
mode:
author ajrhacker <ajrhacker@users.noreply.github.com>2021-07-08 21:40:35 -0400
committer GitHub <noreply@github.com>2021-07-09 11:40:35 +1000
commitee61e4074b41dec22bdb2225efcfcfbb9c1ea410 (patch)
tree0df1076b61aa64b823fddbf3d4dd1adb7d7672cf /src/emu/emumem.cpp
parenta9fefd83636dfdc104a83f7f0cfaec08f87a35e0 (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.cpp')
-rw-r--r--src/emu/emumem.cpp128
1 files changed, 51 insertions, 77 deletions
diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp
index 556972a342f..ea46dc6062a 100644
--- a/src/emu/emumem.cpp
+++ b/src/emu/emumem.cpp
@@ -97,182 +97,156 @@ void handler_entry::enumerate_references(handler_entry::reflist &refs) const
{
}
-template<int Width, int AddrShift, endianness_t Endian> const handler_entry_read<Width, AddrShift, Endian> *const *handler_entry_read<Width, AddrShift, Endian>::get_dispatch() const
+template<int Width, int AddrShift> const handler_entry_read<Width, AddrShift> *const *handler_entry_read<Width, AddrShift>::get_dispatch() const
{
fatalerror("get_dispatch called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_read<Width, AddrShift, Endian>::populate_nomirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, handler_entry_read<Width, AddrShift, Endian> *handler)
+template<int Width, int AddrShift> void handler_entry_read<Width, AddrShift>::populate_nomirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, handler_entry_read<Width, AddrShift> *handler)
{
fatalerror("populate called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_read<Width, AddrShift, Endian>::populate_mirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, offs_t mirror, handler_entry_read<Width, AddrShift, Endian> *handler)
+template<int Width, int AddrShift> void handler_entry_read<Width, AddrShift>::populate_mirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, offs_t mirror, handler_entry_read<Width, AddrShift> *handler)
{
fatalerror("populate called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_read<Width, AddrShift, Endian>::populate_mismatched_nomirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, const memory_units_descriptor<Width, AddrShift, Endian> &descriptor, u8 rkey, std::vector<mapping> &mappings)
+template<int Width, int AddrShift> void handler_entry_read<Width, AddrShift>::populate_mismatched_nomirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, const memory_units_descriptor<Width, AddrShift> &descriptor, u8 rkey, std::vector<mapping> &mappings)
{
fatalerror("populate_mismatched called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_read<Width, AddrShift, Endian>::populate_mismatched_mirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, offs_t mirror, const memory_units_descriptor<Width, AddrShift, Endian> &descriptor, std::vector<mapping> &mappings)
+template<int Width, int AddrShift> void handler_entry_read<Width, AddrShift>::populate_mismatched_mirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, offs_t mirror, const memory_units_descriptor<Width, AddrShift> &descriptor, std::vector<mapping> &mappings)
{
fatalerror("populate_mismatched called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_read<Width, AddrShift, Endian>::populate_passthrough_nomirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, handler_entry_read_passthrough<Width, AddrShift, Endian> *handler, std::vector<mapping> &mappings)
+template<int Width, int AddrShift> void handler_entry_read<Width, AddrShift>::populate_passthrough_nomirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, handler_entry_read_passthrough<Width, AddrShift> *handler, std::vector<mapping> &mappings)
{
fatalerror("populate_passthrough called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_read<Width, AddrShift, Endian>::populate_passthrough_mirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, offs_t mirror, handler_entry_read_passthrough<Width, AddrShift, Endian> *handler, std::vector<mapping> &mappings)
+template<int Width, int AddrShift> void handler_entry_read<Width, AddrShift>::populate_passthrough_mirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, offs_t mirror, handler_entry_read_passthrough<Width, AddrShift> *handler, std::vector<mapping> &mappings)
{
fatalerror("populate_passthrough called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_read<Width, AddrShift, Endian>::lookup(offs_t address, offs_t &start, offs_t &end, handler_entry_read<Width, AddrShift, Endian> *&handler) const
+template<int Width, int AddrShift> void handler_entry_read<Width, AddrShift>::lookup(offs_t address, offs_t &start, offs_t &end, handler_entry_read<Width, AddrShift> *&handler) const
{
fatalerror("lookup called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void *handler_entry_read<Width, AddrShift, Endian>::get_ptr(offs_t offset) const
+template<int Width, int AddrShift> void *handler_entry_read<Width, AddrShift>::get_ptr(offs_t offset) const
{
return nullptr;
}
-template<int Width, int AddrShift, endianness_t Endian> handler_entry_read<Width, AddrShift, Endian> *handler_entry_read<Width, AddrShift, Endian>::dup()
+template<int Width, int AddrShift> handler_entry_read<Width, AddrShift> *handler_entry_read<Width, AddrShift>::dup()
{
ref();
return this;
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_read<Width, AddrShift, Endian>::detach(const std::unordered_set<handler_entry *> &handlers)
+template<int Width, int AddrShift> void handler_entry_read<Width, AddrShift>::detach(const std::unordered_set<handler_entry *> &handlers)
{
fatalerror("detach called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_read<Width, AddrShift, Endian>::init_handlers(offs_t start_entry, offs_t end_entry, u32 lowbits, handler_entry_read<Width, AddrShift, Endian> **dispatch, handler_entry::range *ranges)
+template<int Width, int AddrShift> void handler_entry_read<Width, AddrShift>::init_handlers(offs_t start_entry, offs_t end_entry, u32 lowbits, handler_entry_read<Width, AddrShift> **dispatch, handler_entry::range *ranges)
{
fatalerror("init_handlers called on non-view class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> const handler_entry_write<Width, AddrShift, Endian> *const *handler_entry_write<Width, AddrShift, Endian>::get_dispatch() const
+template<int Width, int AddrShift> const handler_entry_write<Width, AddrShift> *const *handler_entry_write<Width, AddrShift>::get_dispatch() const
{
fatalerror("get_dispatch called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_write<Width, AddrShift, Endian>::populate_nomirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, handler_entry_write<Width, AddrShift, Endian> *handler)
+template<int Width, int AddrShift> void handler_entry_write<Width, AddrShift>::populate_nomirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, handler_entry_write<Width, AddrShift> *handler)
{
fatalerror("populate called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_write<Width, AddrShift, Endian>::populate_mirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, offs_t mirror, handler_entry_write<Width, AddrShift, Endian> *handler)
+template<int Width, int AddrShift> void handler_entry_write<Width, AddrShift>::populate_mirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, offs_t mirror, handler_entry_write<Width, AddrShift> *handler)
{
fatalerror("populate called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_write<Width, AddrShift, Endian>::populate_mismatched_nomirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, const memory_units_descriptor<Width, AddrShift, Endian> &descriptor, u8 rkey, std::vector<mapping> &mappings)
+template<int Width, int AddrShift> void handler_entry_write<Width, AddrShift>::populate_mismatched_nomirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, const memory_units_descriptor<Width, AddrShift> &descriptor, u8 rkey, std::vector<mapping> &mappings)
{
fatalerror("populate_mismatched called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_write<Width, AddrShift, Endian>::populate_mismatched_mirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, offs_t mirror, const memory_units_descriptor<Width, AddrShift, Endian> &descriptor, std::vector<mapping> &mappings)
+template<int Width, int AddrShift> void handler_entry_write<Width, AddrShift>::populate_mismatched_mirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, offs_t mirror, const memory_units_descriptor<Width, AddrShift> &descriptor, std::vector<mapping> &mappings)
{
fatalerror("populate_mismatched called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_write<Width, AddrShift, Endian>::populate_passthrough_nomirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, handler_entry_write_passthrough<Width, AddrShift, Endian> *handler, std::vector<mapping> &mappings)
+template<int Width, int AddrShift> void handler_entry_write<Width, AddrShift>::populate_passthrough_nomirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, handler_entry_write_passthrough<Width, AddrShift> *handler, std::vector<mapping> &mappings)
{
fatalerror("populate_passthrough called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_write<Width, AddrShift, Endian>::populate_passthrough_mirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, offs_t mirror, handler_entry_write_passthrough<Width, AddrShift, Endian> *handler, std::vector<mapping> &mappings)
+template<int Width, int AddrShift> void handler_entry_write<Width, AddrShift>::populate_passthrough_mirror(offs_t start, offs_t end, offs_t ostart, offs_t oend, offs_t mirror, handler_entry_write_passthrough<Width, AddrShift> *handler, std::vector<mapping> &mappings)
{
fatalerror("populate_passthrough called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_write<Width, AddrShift, Endian>::lookup(offs_t address, offs_t &start, offs_t &end, handler_entry_write<Width, AddrShift, Endian> *&handler) const
+template<int Width, int AddrShift> void handler_entry_write<Width, AddrShift>::lookup(offs_t address, offs_t &start, offs_t &end, handler_entry_write<Width, AddrShift> *&handler) const
{
fatalerror("lookup called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void *handler_entry_write<Width, AddrShift, Endian>::get_ptr(offs_t offset) const
+template<int Width, int AddrShift> void *handler_entry_write<Width, AddrShift>::get_ptr(offs_t offset) const
{
return nullptr;
}
-template<int Width, int AddrShift, endianness_t Endian> handler_entry_write<Width, AddrShift, Endian> *handler_entry_write<Width, AddrShift, Endian>::dup()
+template<int Width, int AddrShift> handler_entry_write<Width, AddrShift> *handler_entry_write<Width, AddrShift>::dup()
{
ref();
return this;
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_write<Width, AddrShift, Endian>::detach(const std::unordered_set<handler_entry *> &handlers)
+template<int Width, int AddrShift> void handler_entry_write<Width, AddrShift>::detach(const std::unordered_set<handler_entry *> &handlers)
{
fatalerror("detach called on non-dispatching class\n");
}
-template<int Width, int AddrShift, endianness_t Endian> void handler_entry_write<Width, AddrShift, Endian>::init_handlers(offs_t start_entry, offs_t end_entry, u32 lowbits, handler_entry_write<Width, AddrShift, Endian> **dispatch, handler_entry::range *ranges)
+template<int Width, int AddrShift> void handler_entry_write<Width, AddrShift>::init_handlers(offs_t start_entry, offs_t end_entry, u32 lowbits, handler_entry_write<Width, AddrShift> **dispatch, handler_entry::range *ranges)
{
fatalerror("init_handlers called on non-view class\n");
}
-template class handler_entry_read<0, 1, ENDIANNESS_LITTLE>;
-template class handler_entry_read<0, 1, ENDIANNESS_BIG>;
-template class handler_entry_read<0, 0, ENDIANNESS_LITTLE>;
-template class handler_entry_read<0, 0, ENDIANNESS_BIG>;
-template class handler_entry_read<1, 3, ENDIANNESS_LITTLE>;
-template class handler_entry_read<1, 3, ENDIANNESS_BIG>;
-template class handler_entry_read<1, 0, ENDIANNESS_LITTLE>;
-template class handler_entry_read<1, 0, ENDIANNESS_BIG>;
-template class handler_entry_read<1, -1, ENDIANNESS_LITTLE>;
-template class handler_entry_read<1, -1, ENDIANNESS_BIG>;
-template class handler_entry_read<2, 3, ENDIANNESS_LITTLE>;
-template class handler_entry_read<2, 3, ENDIANNESS_BIG>;
-template class handler_entry_read<2, 0, ENDIANNESS_LITTLE>;
-template class handler_entry_read<2, 0, ENDIANNESS_BIG>;
-template class handler_entry_read<2, -1, ENDIANNESS_LITTLE>;
-template class handler_entry_read<2, -1, ENDIANNESS_BIG>;
-template class handler_entry_read<2, -2, ENDIANNESS_LITTLE>;
-template class handler_entry_read<2, -2, ENDIANNESS_BIG>;
-template class handler_entry_read<3, 0, ENDIANNESS_LITTLE>;
-template class handler_entry_read<3, 0, ENDIANNESS_BIG>;
-template class handler_entry_read<3, -1, ENDIANNESS_LITTLE>;
-template class handler_entry_read<3, -1, ENDIANNESS_BIG>;
-template class handler_entry_read<3, -2, ENDIANNESS_LITTLE>;
-template class handler_entry_read<3, -2, ENDIANNESS_BIG>;
-template class handler_entry_read<3, -3, ENDIANNESS_LITTLE>;
-template class handler_entry_read<3, -3, ENDIANNESS_BIG>;
-
-template class handler_entry_write<0, 1, ENDIANNESS_LITTLE>;
-template class handler_entry_write<0, 1, ENDIANNESS_BIG>;
-template class handler_entry_write<0, 0, ENDIANNESS_LITTLE>;
-template class handler_entry_write<0, 0, ENDIANNESS_BIG>;
-template class handler_entry_write<1, 3, ENDIANNESS_LITTLE>;
-template class handler_entry_write<1, 3, ENDIANNESS_BIG>;
-template class handler_entry_write<1, 0, ENDIANNESS_LITTLE>;
-template class handler_entry_write<1, 0, ENDIANNESS_BIG>;
-template class handler_entry_write<1, -1, ENDIANNESS_LITTLE>;
-template class handler_entry_write<1, -1, ENDIANNESS_BIG>;
-template class handler_entry_write<2, 3, ENDIANNESS_LITTLE>;
-template class handler_entry_write<2, 3, ENDIANNESS_BIG>;
-template class handler_entry_write<2, 0, ENDIANNESS_LITTLE>;
-template class handler_entry_write<2, 0, ENDIANNESS_BIG>;
-template class handler_entry_write<2, -1, ENDIANNESS_LITTLE>;
-template class handler_entry_write<2, -1, ENDIANNESS_BIG>;
-template class handler_entry_write<2, -2, ENDIANNESS_LITTLE>;
-template class handler_entry_write<2, -2, ENDIANNESS_BIG>;
-template class handler_entry_write<3, 0, ENDIANNESS_LITTLE>;
-template class handler_entry_write<3, 0, ENDIANNESS_BIG>;
-template class handler_entry_write<3, -1, ENDIANNESS_LITTLE>;
-template class handler_entry_write<3, -1, ENDIANNESS_BIG>;
-template class handler_entry_write<3, -2, ENDIANNESS_LITTLE>;
-template class handler_entry_write<3, -2, ENDIANNESS_BIG>;
-template class handler_entry_write<3, -3, ENDIANNESS_LITTLE>;
-template class handler_entry_write<3, -3, ENDIANNESS_BIG>;
+template class handler_entry_read<0, 1>;
+template class handler_entry_read<0, 0>;
+template class handler_entry_read<1, 3>;
+template class handler_entry_read<1, 0>;
+template class handler_entry_read<1, -1>;
+template class handler_entry_read<2, 3>;
+template class handler_entry_read<2, 0>;
+template class handler_entry_read<2, -1>;
+template class handler_entry_read<2, -2>;
+template class handler_entry_read<3, 0>;
+template class handler_entry_read<3, -1>;
+template class handler_entry_read<3, -2>;
+template class handler_entry_read<3, -3>;
+
+template class handler_entry_write<0, 1>;
+template class handler_entry_write<0, 0>;
+template class handler_entry_write<1, 3>;
+template class handler_entry_write<1, 0>;
+template class handler_entry_write<1, -1>;
+template class handler_entry_write<2, 3>;
+template class handler_entry_write<2, 0>;
+template class handler_entry_write<2, -1>;
+template class handler_entry_write<2, -2>;
+template class handler_entry_write<3, 0>;
+template class handler_entry_write<3, -1>;
+template class handler_entry_write<3, -2>;
+template class handler_entry_write<3, -3>;
//**************************************************************************
// MEMORY MANAGER