Skip to content

Commit

Permalink
amo: amoswap: offset must be 0 (#499)
Browse files Browse the repository at this point in the history
The amo<op>.[w|d] and amoswap.c instructions need the exact address and
do not support an offset. Their encodings have no offset field.

Set the offset to 0 in the Mnemonics. This is what we already do for lr
and sc instructions.

Signed-off-by: Martin Kaiser <[email protected]>
  • Loading branch information
martin-kaiser authored Jan 2, 2025
1 parent 557678b commit 65010ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/insns/amo_32bit.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ Synopsis::
Atomic Operations (AMO<OP>.W, AMO<OP>.D), 32-bit encodings

{cheri_cap_mode_name} Mnemonics (RV64)::
`amo<op>.[w|d] rd, rs2, offset(cs1)`
`amo<op>.[w|d] rd, rs2, 0(cs1)`

{cheri_cap_mode_name} Mnemonics (RV32)::
`amo<op>.w rd, rs2, offset(cs1)`
`amo<op>.w rd, rs2, 0(cs1)`

{cheri_int_mode_name} Mnemonics (RV64)::
`amo<op>.[w|d] rd, rs2, offset(rs1)`
`amo<op>.[w|d] rd, rs2, 0(rs1)`

{cheri_int_mode_name} Mnemonics (RV32)::
`amo<op>.w rd, rs2, offset(rs1)`
`amo<op>.w rd, rs2, 0(rs1)`

Encoding::
include::wavedrom/amo.adoc[]
Expand Down
4 changes: 2 additions & 2 deletions src/insns/amoswap_32bit_cap.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Synopsis::
Atomic Operation (AMOSWAP.C), 32-bit encoding

{cheri_cap_mode_name} Mnemonic::
`amoswap.c cd, cs2, offset(cs1)`
`amoswap.c cd, cs2, 0(cs1)`

{cheri_int_mode_name} Mnemonic::
`amoswap.c cd, cs2, offset(rs1)`
`amoswap.c cd, cs2, 0(rs1)`

Encoding::
include::wavedrom/amoswap_cap.adoc[]
Expand Down

0 comments on commit 65010ec

Please sign in to comment.