RISC-V ISA Explorer · Atomics (Za/Zic*)

Zacas: Atomic Compare-and-Swap

Ratified 2023-11 · version 1.0.0

Compare-and-swap on words, doublewords and quadwords, the primitive that lock-free data structures need.

Typical use: Compare-and-swap concurrency primitives

Specification

Open Zacas in the explorer

Dependencies

Requires

Instructions (5)

MnemonicNameEncodingMatchMask
AMOCAS.BAtomic compare-and-swap byte00101------------000-----01011110x2800002f0xf800707f
AMOCAS.DAtomic compare-and-swap doubleword00101------------011-----01011110x2800302f0xf800707f
AMOCAS.HAtomic compare-and-swap halfword00101------------001-----01011110x2800102f0xf800707f
AMOCAS.QAtomic compare-and-swap quadword00101------------100-----01011110x2800402f0xf800707f
AMOCAS.WAtomic compare-and-swap word00101------------010-----01011110x2800202f0xf800707f