Skip to content

Commit

Permalink
EF_RISCV_N32: Limit the address space to lower 2GiB
Browse files Browse the repository at this point in the history
Limiting the address space to lower 2GiB does not pose any issues with
sign extending addresses into the upper 32 bits of a 64-bit register.

Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
  • Loading branch information
guoren83 committed Aug 29, 2024
1 parent f1ce337 commit fe2e795
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions riscv-elf.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ address space or the lower 2 GiB and highest 2 GiB of the RV64 address space
By using the `lui` and load / store instructions, when referring to an object, or
`addi`, when calculating an address literal, for example,
a 32-bit address literal can be produced.
For the ILP32 ABI on RV64* ISA, the medlow allows the code to address lower 2GiB
of the RV64 address space (`0x0` ~ `0x000000007FFFFFFF`).

NOTE: Limiting the address space to lower 2GiB does not pose any issues with sign
extending addresses into the upper 32 bits of a 64-bit register.

The following instructions show how to load a value, store a value, or calculate
an address in the `medlow` code model.
Expand Down

0 comments on commit fe2e795

Please sign in to comment.