Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move non-normative parts of "A" extensions (atomics) into NOTE block #1822

Merged
merged 2 commits into from
Jan 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/a-st-ext.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ instruction unless the _rl_ bit is also set. LR._rl_ and SC._aq_
instructions are not guaranteed to provide any stronger ordering than
those with both bits clear, but may result in lower performance.

<<<

[NOTE]
====
[[cas]]
[source,asm]
.Sample code for compare-and-swap function using LR/SC.
Expand All @@ -250,6 +250,7 @@ those with both bits clear, but may result in lower performance.
LR/SC can be used to construct lock-free data structures. An example
using LR/SC to implement a compare-and-swap function is shown in
<<cas>>. If inlined, compare-and-swap functionality need only take four instructions.
====
aswaterman marked this conversation as resolved.
Show resolved Hide resolved

[[sec:lrscseq]]
=== Eventual Success of Store-Conditional Instructions
Expand Down Expand Up @@ -434,15 +435,15 @@ both imply additional unnecessary ordering as compared to AMOs with the
corresponding _aq_ or _rl_ bit set.
====

[NOTE]
====
aswaterman marked this conversation as resolved.
Show resolved Hide resolved
An example code sequence for a critical section guarded by a
test-and-test-and-set spinlock is shown in
Example <<critical>>. Note the first AMO is marked _aq_ to
order the lock acquisition before the critical section, and the second
AMO is marked _rl_ to order the critical section before the lock
relinquishment.

<<<

[[critical]]
[source,asm]
.Sample code for mutual exclusion. `a0` contains the address of the lock.
Expand All @@ -457,9 +458,7 @@ relinquishment.
# ...
amoswap.w.rl x0, x0, (a0) # Release lock by storing 0.

[NOTE]
====
We recommend the use of the AMO Swap idiom shown above for both lock
We recommend the use of the AMO Swap idiom shown in <<critical>> for both lock
acquire and release to simplify the implementation of speculative lock
elision. cite:[Rajwar:2001:SLE]
====
Expand Down
Loading