summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/emumem_heu.h
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_heu.h
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_heu.h')
-rw-r--r--src/emu/emumem_heu.h22
1 files changed, 10 insertions, 12 deletions
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<int Width, int AddrShift, endianness_t Endian> class handler_entry_read_units : public handler_entry_read<Width, AddrShift, Endian>
+template<int Width, int AddrShift> class handler_entry_read_units : public handler_entry_read<Width, AddrShift>
{
public:
using uX = typename emu::detail::handler_entry_size<Width>::uX;
- handler_entry_read_units(const memory_units_descriptor<Width, AddrShift, Endian> &descriptor, u8 ukey, address_space *space);
- handler_entry_read_units(const memory_units_descriptor<Width, AddrShift, Endian> &descriptor, u8 ukey, const handler_entry_read_units *src);
+ handler_entry_read_units(const memory_units_descriptor<Width, AddrShift> &descriptor, u8 ukey, address_space *space);
+ handler_entry_read_units(const memory_units_descriptor<Width, AddrShift> &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<Width, AddrShift, Endian> *dup() override;
+ handler_entry_read<Width, AddrShift> *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<Width, AddrShift, Endian> &descriptor, const std::vector<typename memory_units_descriptor<Width, AddrShift, Endian>::entry> &entries);
+ void fill(const memory_units_descriptor<Width, AddrShift> &descriptor, const std::vector<typename memory_units_descriptor<Width, AddrShift>::entry> &entries);
static std::string m2r(uX mask);
};
-template<int Width, int AddrShift, endianness_t Endian> class handler_entry_write_units : public handler_entry_write<Width, AddrShift, Endian>
+template<int Width, int AddrShift> class handler_entry_write_units : public handler_entry_write<Width, AddrShift>
{
public:
using uX = typename emu::detail::handler_entry_size<Width>::uX;
- handler_entry_write_units(const memory_units_descriptor<Width, AddrShift, Endian> &descriptor, u8 ukey, address_space *space);
- handler_entry_write_units(const memory_units_descriptor<Width, AddrShift, Endian> &descriptor, u8 ukey, const handler_entry_write_units<Width, AddrShift, Endian> *src);
+ handler_entry_write_units(const memory_units_descriptor<Width, AddrShift> &descriptor, u8 ukey, address_space *space);
+ handler_entry_write_units(const memory_units_descriptor<Width, AddrShift> &descriptor, u8 ukey, const handler_entry_write_units<Width, AddrShift> *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<Width, AddrShift, Endian> *dup() override;
+ handler_entry_write<Width, AddrShift> *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<Width, AddrShift, Endian> &descriptor, const std::vector<typename memory_units_descriptor<Width, AddrShift, Endian>::entry> &entries);
+ void fill(const memory_units_descriptor<Width, AddrShift> &descriptor, const std::vector<typename memory_units_descriptor<Width, AddrShift>::entry> &entries);
static std::string m2r(uX mask);
};