ATOMS

Constant buffer, local, shared and global memory instructions

fixed bit field field the encoding fixes should be

ATOMS

6362616059585756555453525150494847464544434241403938373635343332
11101100[55:52]
313029282726252423222120191817161514131211109876543210
pred.notpredRd

bits 63:48: 1110 1100 ---- ----

Runs execute_ATOMS with Form() 0.

Fields

FieldBitsFrom
[55:52]55:52execute_ATOMS
pred.not19the decoder
pred18:16the decoder
Rd7:0Dst()

Operation Sail

ATOMS: an atomic of shared memory, the operation SharedAtomicOpcode's: EXCH of a pair (two words exchanged, not one atomic), SPIR-V's own, or the wrap step's CAS loop (52-55: 3 INC, else DEC)

let index = SharedAtomicIndex();
let pointer = SharedPointer(index);
let operation = SharedAtomicOpcode();
if operation == 4294967294 then {
    let next_index = SharedIndex(index + 0x00000001, SharedWords());
    let high = SharedPointer(next_index);
    let old_low = Load(pointer);
    let old_high = Load(high);
    Store(pointer, R_read(RegB()));
    Store(high, R_read(RegB() + 1));
    R_write(Dst(), old_low);
    R_write(Dst() + 1, old_high)
} else if operation != 4294967295 then R_write(Dst(), AtomicOpShared(operation, pointer, R_read(RegB())))
else R_write(Dst(), AtomicLoopShared(pointer, RegB(), if Field(52, 4) != 0x3 then 1 else 0))

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).