Skip to content

Commit

Permalink
Update layout and fix broken citations (#1365)
Browse files Browse the repository at this point in the history
  • Loading branch information
ved-rivos committed Apr 25, 2024
1 parent d306899 commit a9faf57
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/zacas.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
== "Zacas" Extension for Atomic Compare-and-Swap (CAS) Instructions, Version 1.0.0

=== Introduction

Compare-and-Swap (CAS) provides an easy and typically faster way to perform
thread synchronization operations when supported as a hardware instruction. CAS
is typically used by lock-free and wait-free algorithms. This extension proposes
Expand All @@ -20,12 +18,11 @@ quadword compare and swap (of both the pointer and the counter). The double and
quadword CAS instructions support implementation of algorithms for ABA problem
avoidance.

The Zacas extension depends upon the Zaamo extension cite:[unpriv].
The Zacas extension depends upon the Zaamo extension.

[[chapter2]]
=== Word/Doubleword/Quadword CAS (AMOCAS.W/D/Q)
=== Word/Doubleword/Quadword CAS (AMOCAS.W/D/Q) Instructions

[wavedrom, , ]
[wavedrom, , svg]
....
{reg: [
{bits: 7, name: 'opcode', attr:'AMO'},
Expand Down Expand Up @@ -67,6 +64,9 @@ pair is `x0`, then both halves of the pair read as zero. When the first
register of a destination register pair is `x0`, then the entire register
result is discarded and neither destination register is written.
The operation performed by `AMOCAS.D` for RV32 is as follows:

<<<

[listing]
temp0 = mem[X(rs1)+0]
temp1 = mem[X(rs1)+4]
Expand Down Expand Up @@ -119,6 +119,9 @@ is `x0`, then both halves of the pair read as zero. When the first register of a
destination register pair is `x0`, then the entire register result is discarded
and neither destination register is written. The operation performed by
`AMOCAS.Q` is as follows:

<<<

[listing]
temp0 = mem[X(rs1)+0]
temp1 = mem[X(rs1)+8]
Expand Down Expand Up @@ -196,8 +199,6 @@ not have release semantics, regardless of `rl`.

An `AMOCAS.W/D/Q` instruction always requires write permissions.

<<<

[NOTE]
====
The following example code sequence illustrates the use of `AMOCAS.Q` to
Expand Down Expand Up @@ -241,6 +242,8 @@ move_tail: # Tail was not pointing to the last node
====

<<<

=== Additional AMO PMAs

There are four levels of PMA support defined for AMOs in the A extension. Zacas
Expand Down

0 comments on commit a9faf57

Please sign in to comment.