Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
do release only if cas succeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
ved-rivos committed Jul 26, 2023
1 parent aa06d79 commit 27bd1a5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion zacas.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,18 @@ aligned for _quadwords_, eight-byte aligned for _doublewords_, and four-byte
aligned for _words_). And the same exception options apply if the address
is not naturally aligned.

An `AMOCAS.W/D/Q` generates a memory read access and, if successful, generates
a memory write access to store the _swap_ value. An unsuccessful `AMOCAS.W/D/Q`
may either not perform a memory write or may write back the old value loaded
from memory. An `AMOCAS.W/D/Q` instruction always requires write permissions.

Just as for AMOs in the A extension, the `AMOCAS.W/D/Q` optionally provide
release consistency semantics, using the `aq` and `rl` bits, to help implement
multiprocessor synchronization.
multiprocessor synchronization. The memory operation performed by an
`AMOCAS.W/D/Q`, when successful, has acquire semantics if `aq` bit is 1 and has
release semantics if `rl` bit is 1. The memory operation performed by an
`AMOCAS.W/D/Q`, when not successful, has acquire semantics if `aq` bit is 1 but
does not have release semantics, regardless of `rl`.

<<<

Expand Down

0 comments on commit 27bd1a5

Please sign in to comment.