ATOM.CAS

Constant buffer, local, shared and global memory instructions

fixed bit field field the encoding fixes should be

ATOM.CAS

6362616059585756555453525150494847464544434241403938373635343332
111011101111
313029282726252423222120191817161514131211109876543210
pred.notpredRd

bits 63:48: 1110 1110 1111 ----

Runs execute_ATOM_CAS with Form() 0.

Fields

FieldBitsFrom
pred.not19the decoder
pred18:16the decoder
Rd7:0Dst()

Operation Sail

ATOM.CAS: compare (the register at 20) and swap in the next register's value, of a global slot's word

let slot = GbAt() - 1;
let pointer = GlobalAtomicPointer(slot);
LogWritten(slot, AtomicOffset(), 4);
let next = R_read(RegB() + 1);
R_write(Dst(), AtomicCas(pointer, next, R_read(RegB())))

Made from ScarletNX's Sail at 166ad3910f80. The Sail and the encodings' file are ScarletNX's (GPL-3.0-or-later); its encodings are from Eden's maxwell.inc (GPL-2.0-or-later).