mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:47:45 +00:00
Userland+Tests: Add initial riscv64 support
This commit is contained in:
parent
c6b2a07326
commit
6824d2a788
23 changed files with 262 additions and 34 deletions
|
@ -416,8 +416,8 @@ public:
|
|||
// For 32-bit system the pointer fully fits so we can just return it directly.
|
||||
static_assert(sizeof(void*) == sizeof(u32));
|
||||
return static_cast<FlatPtr>(encoded & 0xffff'ffff);
|
||||
#elif ARCH(X86_64)
|
||||
// For x86_64 the top 16 bits should be sign extending the "real" top bit (47th).
|
||||
#elif ARCH(X86_64) || ARCH(RISCV64)
|
||||
// For x86_64 and riscv64 the top 16 bits should be sign extending the "real" top bit (47th).
|
||||
// So first shift the top 16 bits away then using the right shift it sign extends the top 16 bits.
|
||||
return static_cast<FlatPtr>((static_cast<i64>(encoded << 16)) >> 16);
|
||||
#elif ARCH(AARCH64)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue