From ee61e4074b41dec22bdb2225efcfcfbb9c1ea410 Mon Sep 17 00:00:00 2001 From: ajrhacker Date: Thu, 8 Jul 2021 21:40:35 -0400 Subject: 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::read and handler_entry_write_units::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. --- src/emu/emumem_heu.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src/emu/emumem_heu.h') diff --git a/src/emu/emumem_heu.h b/src/emu/emumem_heu.h index 8814f4119a1..541f96bc556 100644 --- a/src/emu/emumem_heu.h +++ b/src/emu/emumem_heu.h @@ -9,13 +9,13 @@ // merges/splits an access among multiple handlers (unitmask support) -template class handler_entry_read_units : public handler_entry_read +template class handler_entry_read_units : public handler_entry_read { public: using uX = typename emu::detail::handler_entry_size::uX; - handler_entry_read_units(const memory_units_descriptor &descriptor, u8 ukey, address_space *space); - handler_entry_read_units(const memory_units_descriptor &descriptor, u8 ukey, const handler_entry_read_units *src); + handler_entry_read_units(const memory_units_descriptor &descriptor, u8 ukey, address_space *space); + handler_entry_read_units(const memory_units_descriptor &descriptor, u8 ukey, const handler_entry_read_units *src); handler_entry_read_units(const handler_entry_read_units *src); ~handler_entry_read_units(); @@ -24,7 +24,7 @@ public: std::string name() const override; void enumerate_references(handler_entry::reflist &refs) const override; - handler_entry_read *dup() override; + handler_entry_read *dup() override; private: static constexpr u32 SUBUNIT_COUNT = 1 << Width; @@ -40,24 +40,23 @@ private: u8 m_dshift; // data shift of the subunit u8 m_width; // access width (0..3) - u8 m_endian; // endianness }; subunit_info m_subunit_infos[SUBUNIT_COUNT]; // subunit information uX m_unmap; // "unmapped" value to add to reads u8 m_subunits; // number of subunits - void fill(const memory_units_descriptor &descriptor, const std::vector::entry> &entries); + void fill(const memory_units_descriptor &descriptor, const std::vector::entry> &entries); static std::string m2r(uX mask); }; -template class handler_entry_write_units : public handler_entry_write +template class handler_entry_write_units : public handler_entry_write { public: using uX = typename emu::detail::handler_entry_size::uX; - handler_entry_write_units(const memory_units_descriptor &descriptor, u8 ukey, address_space *space); - handler_entry_write_units(const memory_units_descriptor &descriptor, u8 ukey, const handler_entry_write_units *src); + handler_entry_write_units(const memory_units_descriptor &descriptor, u8 ukey, address_space *space); + handler_entry_write_units(const memory_units_descriptor &descriptor, u8 ukey, const handler_entry_write_units *src); handler_entry_write_units(const handler_entry_write_units *src); ~handler_entry_write_units(); @@ -66,7 +65,7 @@ public: std::string name() const override; void enumerate_references(handler_entry::reflist &refs) const override; - handler_entry_write *dup() override; + handler_entry_write *dup() override; private: static constexpr u32 SUBUNIT_COUNT = 1 << Width; @@ -82,13 +81,12 @@ private: u8 m_dshift; // data shift of the subunit u8 m_width; // access width (0..3) - u8 m_endian; // endianness }; subunit_info m_subunit_infos[SUBUNIT_COUNT]; // subunit information u8 m_subunits; // number of subunits - void fill(const memory_units_descriptor &descriptor, const std::vector::entry> &entries); + void fill(const memory_units_descriptor &descriptor, const std::vector::entry> &entries); static std::string m2r(uX mask); }; -- cgit v1.2.3-70-g09d2