Skip to content

Commit

Permalink
xtheadmempair: Clarify atomicity for load/store-pair instructions
Browse files Browse the repository at this point in the history
Load/store-pair instructions raise the question about atomicity
and exception behaviour. The current description does not define
the exact behaviour (and thus makes this an implementation detail).

This patch clarifies, that the instructions don't provide any
atomicity guarantees and that that exceptions may re-execute
the instruction causing duplicated memory transactions.

Signed-off-by: Christoph Müllner <[email protected]>
  • Loading branch information
cmuellner committed Jan 30, 2023
1 parent 3cfe346 commit 4031a22
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xtheadmempair/ldd.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ from the address _rs1_ + (zero_extend(_imm2_) << 4).

The encoding of this instruction with equal _rd1_, _rd2_ and _rs1_ is reserved.

Note, that there is no atomicity guarantee for this instruction.
I.e., an implementation can realize this instruction in form of two
memory transactions and an exception can be handled in-between, in which
case the whole instruction will be re-executed.

Operation::
[source,sail]
--
Expand Down
5 changes: 5 additions & 0 deletions xtheadmempair/lwd.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ from the address _rs1_ + (zero_extend(_imm2_) << 3).

The encoding of this instruction with equal _rd1_, _rd2_ and _rs1_ is reserved.

Note, that there is no atomicity guarantee for this instruction.
I.e., an implementation can realize this instruction in form of two
memory transactions and an exception can be handled in-between, in which
case the whole instruction will be re-executed.

Operation::
[source,sail]
--
Expand Down
5 changes: 5 additions & 0 deletions xtheadmempair/lwud.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ from the address _rs1_ + (zero_extend(_imm2_) << 3).

The encoding of this instruction with equal _rd1_, _rd2_ and _rs1_ is reserved.

Note, that there is no atomicity guarantee for this instruction.
I.e., an implementation can realize this instruction in form of two
memory transactions and an exception can be handled in-between, in which
case the whole instruction will be re-executed.

Operation::
[source,sail]
--
Expand Down
5 changes: 5 additions & 0 deletions xtheadmempair/sdd.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ Description::
This instruction stores two 64-bit values from the two GP registers _rd1_ and _rd2_
to the address _rs1_ + (zero_extend(_imm2_) << 4).

Note, that there is no atomicity guarantee for this instruction.
I.e., an implementation can realize this instruction in form of two
memory transactions and an exception can be handled in-between, in which
case the whole instruction will be re-executed.

Operation::
[source,sail]
--
Expand Down
5 changes: 5 additions & 0 deletions xtheadmempair/swd.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ Description::
This instruction loads two 32-bit values into the two GP registers _rd1_ and _rd2_
from the address _rs1_ + (zero_extend(_imm2_) << 3).

Note, that there is no atomicity guarantee for this instruction.
I.e., an implementation can realize this instruction in form of two
memory transactions and an exception can be handled in-between, in which
case the whole instruction will be re-executed.

Operation::
[source,sail]
--
Expand Down

0 comments on commit 4031a22

Please sign in to comment.