Skip to content

Commit

Permalink
Merge pull request #6 from riscv/5-scaled-offsets-for-compressed-enco…
Browse files Browse the repository at this point in the history
…dings

Making the address computation for C.SD and C.LD explicit
  • Loading branch information
christian-herber-nxp authored Mar 11, 2024
2 parents 959f017 + 6e584e7 commit b951276
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions zilsd.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ If the C extension is present and F is not present, Zilsd adds the following RV3

- C.LDSP loads stack-pointer relative 64-bit value into registers `rd'` and `rd'+1`. It computes its effective address by adding the zero-extended offset, scaled by 8, to the stack pointer, `x2`. It expands to `ld rd, offset(x2)`. C.LDSP is only valid when _rd_≠x0; the code points with _rd_=x0 are reserved.
- C.SDSP stores a stack-pointer relative 64-bit value from registers `rs2'` and `rs2'+1`. It computes an effective address by adding the _zero_-extended offset, scaled by 8, to the stack pointer, `x2`. It expands to `sd rs2, offset(x2)`.
- C.LD loads a 64-bit value into registers `rd'` and `rd'+1`. It expands to
`ld rd', offset(rs1')`.
- C.SD stores a 64-bit value from registers `rs2'` and `rs2'+1`. It expands to
`sd rs2', offset(rs1')`.
- C.LD loads a 64-bit value into registers `rd'` and `rd'+1`.
It computes an effective address by adding the zero-extended offset, scaled by 8, to the base address in register rs1'.
It expands to `ld rd', offset(rs1')`.
- C.SD stores a 64-bit value from registers `rs2'` and `rs2'+1`.
It computes an effective address by adding the zero-extended offset, scaled by 8, to the base address in register rs1'.
It expands to `sd rs2', offset(rs1')`.

These instructions are mutually exclusive with Zcf.

Expand Down

0 comments on commit b951276

Please sign in to comment.