Skip to content

Commit a934e6d

Browse files
committed
riscv-elf.md: remove section on code models
1 parent e768dc1 commit a934e6d

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

riscv-elf.md

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
* [ILP32E Calling Convention](#ilp32e-calling-convention)
1111
* [Named ABIs](#named-abis)
1212
* [Default ABIs](#default-abis)
13-
* [Code models](#code-models)
1413
3. [C type details](#c-types)
1514
* [C type sizes and alignments](#c-type-sizes)
1615
* [C type representations](#c-type-representation)
@@ -321,41 +320,6 @@ default ABIs for specific architectures:
321320

322321
* **on RV32G**: [ILP32D](#abi-ilp32d)
323322

324-
## <a name=code-models /> Code models
325-
326-
The RISC-V architecture constrains the addressing of positions in the
327-
address space. There is no single instruction that can refer to an arbitrary
328-
memory position using a literal as its argument. Rather, instructions exist
329-
that, when combined together, can then be used to refer to a memory position
330-
via its literal. And, when not, other data structures are used to help the
331-
code to address the memory space. The coding conventions governing their use
332-
are known as code models.
333-
334-
### Medium low
335-
336-
The medium low code model, or `medlow`, allows the code to address the lower
337-
2 GiB of the address space. By using the instruction `lui` and `ld` or `addi`
338-
instructions, for example, a 32-bit address literal can be produced.
339-
This code model is not position independent.
340-
341-
### Medium any
342-
343-
The medium any code model, or `medany`, allows the code to address the range
344-
between -2 GiB and +2 GiB from its position. By using the instruction `auipc`
345-
and `st` or `addi` instructions, for example, a signed 32-bit offset, relative
346-
to the value of the `pc` register, can be produced. This code model is
347-
position independent.
348-
349-
### Compact
350-
351-
The compact code model allows the code to address the whole 64-bit address space,
352-
especially when code and data are located far apart. By using the Global
353-
Offset Table, or GOT, to hold the 64-bit address literals, any memory position
354-
can be referred. By using the instructions `lui` and `addi`, a signed 32-bit
355-
offset, relative to the value of the `gp` register, can be produced, referring
356-
to address literals in the GOT. This code model is position independent.
357-
Does not apply to the ILP32 ABIs.
358-
359323
# <a name=c-types></a> C type details
360324
## <a name=c-type-sizes></a> C type sizes and alignments
361325

0 commit comments

Comments
 (0)