diff options
author | Krste Asanovic <krste@eecs.berkeley.edu> | 2020-03-03 18:54:12 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-03 18:54:12 -0800 |
commit | 48d223e2e737c3247a7f0725815037938273873d (patch) | |
tree | 297c89e77d5720f1509b47fd298d261f282e0764 /src/rv32.tex | |
parent | 70b5dee5b4df8d230dd60f93db61638bd69d054d (diff) | |
parent | 0ac0b9a801299896f20aaa69744e246e71204150 (diff) | |
download | riscv-isa-manual-48d223e2e737c3247a7f0725815037938273873d.zip riscv-isa-manual-48d223e2e737c3247a7f0725815037938273873d.tar.gz riscv-isa-manual-48d223e2e737c3247a7f0725815037938273873d.tar.bz2 |
Merge pull request #453 from riscv/u-immediate
Consistently claim that U-immediate is 32 bits, not 20 bits
Diffstat (limited to 'src/rv32.tex')
-rw-r--r-- | src/rv32.tex | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/rv32.tex b/src/rv32.tex index 7c501f1..67b2cbc 100644 --- a/src/rv32.tex +++ b/src/rv32.tex @@ -569,16 +569,19 @@ U-immediate[31:12] & dest & AUIPC \end{center} LUI (load upper immediate) is used to build 32-bit constants and uses -the U-type format. LUI places the U-immediate value in the top 20 -bits of the destination register {\em rd}, filling in the lowest 12 +the U-type format. LUI places the 32-bit U-immediate value into +the destination register {\em rd}, filling in the lowest 12 bits with zeros. AUIPC (add upper immediate to {\tt pc}) is used to build {\tt pc}-relative addresses and uses the U-type format. AUIPC forms a 32-bit offset from the -20-bit U-immediate, filling in the lowest 12 bits with zeros, adds this offset +U-immediate, filling in the lowest 12 bits with zeros, adds this offset to the address of the AUIPC instruction, then places the result in register {\em rd}. \begin{commentary} +The assembly syntax for {\tt lui} and {\tt auipc} does not represent the lower +12 bits of the U-immediate, which are always zero. + The AUIPC instruction supports two-instruction sequences to access arbitrary offsets from the PC for both control-flow transfers and data accesses. The combination of an AUIPC and the 12-bit immediate in a |