1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:58:11 +00:00

UserspaceEmulator+LibX86: Add support for 64-bit memory reads and writes (#3584)

This is useful for reading and writing doubles for #3329.
It is also useful for emulating 64-bit binaries.

MemoryOrRegisterReference assumes that 64-bit values are always
memory references since that's enough for fpu support. If we
ever want to emulate 64-bit binaries, that part will need minor
updating.
This commit is contained in:
Nico Weber 2020-09-23 14:45:43 -04:00 committed by GitHub
parent 1fa5a526e8
commit f1c0f661f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 156 additions and 0 deletions

View file

@ -111,6 +111,8 @@ private:
template<typename T>
ALWAYS_INLINE ValueWithShadow<T> shadow_wrap_as_initialized(T value)
{
if constexpr (sizeof(T) == 8)
return { value, 0x01010101'01010101LLU };
if constexpr (sizeof(T) == 4)
return { value, 0x01010101 };
if constexpr (sizeof(T) == 2)