aboutsummaryrefslogtreecommitdiff
path: root/src/core/tools
diff options
context:
space:
mode:
authorlizzie <lizzie@eden-emu.dev>2026-09-19 01:39:46 +0200
committercrueter <crueter@eden-emu.dev>2026-09-19 01:39:46 +0200
commit9a30172e45fcb7833cc49ba4d6450211449b14df (patch)
tree4ab0ffbb276464086615fa247d69a9cdf9d5ac55 /src/core/tools
parent07f40d5cac635ff102aa6ce9c32572cc20d69959 (diff)
[dynarmic] Coalesce non-exclusive Write/Read fallback functions (#4158)
the general idea is to have a common procedure form whom to call this way theres less "jumping around" for values of different sizes additionally this **should** allow for better codegen since most of the u8,u16,u32,u64 can be held within a u64 theoretically this means that you could deifne callbacks in suck a way that it's essentially as costly as a `mov r64, m64` but that's not doable due to the fact we have to do translations... Is this a good change? Primarily aimed for x86 and ARM to benefit, but I suppose LooooooongArch64 can benefit too. Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4158 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Diffstat (limited to 'src/core/tools')
-rw-r--r--src/core/tools/freezer.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/core/tools/freezer.cpp b/src/core/tools/freezer.cpp
index 73a86b3c8c..606ac2da42 100644
--- a/src/core/tools/freezer.cpp
+++ b/src/core/tools/freezer.cpp
@@ -33,18 +33,10 @@ u64 MemoryReadWidth(Core::Memory::Memory& memory, u32 width, VAddr addr) {
void MemoryWriteWidth(Core::Memory::Memory& memory, u32 width, VAddr addr, u64 value) {
switch (width) {
- case 1:
- memory.Write8(addr, static_cast<u8>(value));
- break;
- case 2:
- memory.Write16(addr, static_cast<u16>(value));
- break;
- case 4:
- memory.Write32(addr, static_cast<u32>(value));
- break;
- case 8:
- memory.Write64(addr, value);
- break;
+ case sizeof(u64): return memory.Write64(addr, value);
+ case sizeof(u32): return memory.Write32(addr, u32(value));
+ case sizeof(u16): return memory.Write16(addr, u16(value));
+ case sizeof(u8): return memory.Write8(addr, u8(value));
default:
UNREACHABLE();
}