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>
Signed-off-by: Liao Shihua <shihua@iscas.ac.cn>
  • Loading branch information
guoren83 authored and Liaoshihua committed Nov 6, 2024
1 parent 6a9cb9c commit 4edf2f5
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 4edf2f5

Please sign in to comment.