@@ -745,8 +745,26 @@ Jump if signed lesser or equal.
745745
746746@subsection Atomic instructions
747747
748- Atomic exchange-and-add instructions are provided in two flavors: one
749- for swapping 64-bit quantities and another for 32-bit quantities.
748+ Atomic exchange instructions are provided in two flavors: one for
749+ compare-and-swap, one for unconditional exchange.
750+
751+ @table @code
752+ @item acmp [rd + offset16], rs
753+ @itemx r0 = cmpxchg_64 (rd + offset16, r0, rs)
754+ Atomic compare-and-swap. Compares value in @code {r0 } to value
755+ addressed by @code {rd + offset16 }. On match, the value addressed by
756+ @code {rd + offset16 } is replaced with the value in @code {rs }.
757+ Regardless, the value that was at @code {rd + offset16 } is
758+ zero-extended and loaded into @code {r0 }.
759+
760+ @item axchg [rd + offset16], rs
761+ @itemx rs = xchg_64 (rd + offset16, rs)
762+ Atomic exchange. Atomically exchanges the value in @code {rs } with
763+ the value addressed by @code {rd + offset16 }.
764+ @end table
765+
766+ @noindent
767+ The following instructions provide atomic arithmetic operations.
750768
751769@table @code
752770@item aadd [rd + offset16], rs
@@ -798,8 +816,26 @@ Alias to @code{aadd}.
798816
799817@subsection 32-bit atomic instructions
800818
801- Atomic exchange-and-add instructions are provided in two flavors: one
802- for swapping 32-bit quantities and another for 32-bit quantities.
819+ 32-bit atomic exchange instructions are provided in two flavors: one
820+ for compare-and-swap, one for unconditional exchange.
821+
822+ @table @code
823+ @item acmp32 [rd + offset16], rs
824+ @itemx w0 = cmpxchg32_32 (rd + offset16, w0, ws)
825+ Atomic compare-and-swap. Compares value in @code {w0 } to value
826+ addressed by @code {rd + offset16 }. On match, the value addressed by
827+ @code {rd + offset16 } is replaced with the value in @code {ws }.
828+ Regardless, the value that was at @code {rd + offset16 } is
829+ zero-extended and loaded into @code {w0 }.
830+
831+ @item axchg [rd + offset16], rs
832+ @itemx ws = xchg32_32 (rd + offset16, ws)
833+ Atomic exchange. Atomically exchanges the value in @code {ws } with
834+ the value addressed by @code {rd + offset16 }.
835+ @end table
836+
837+ @noindent
838+ The following instructions provide 32-bit atomic arithmetic operations.
803839
804840@table @code
805841@item aadd32 [rd + offset16], rs
0 commit comments