amocas.d.rl

Atomic compare-and-swap doubleword (release)

Atomically with release ordering:

  • Load the doubleword at address xs1

  • Write the loaded value into xd

  • Compare the loaded value with the value of register xs2

  • If equal, write the value of register xs2+1 to the address in xs1

Assembly format

amocas.d.rl xd, xs2, (xs1)

Decode Variables

Bits<5> xs2 = $encoding[24:20];
Bits<5> xs1 = $encoding[19:15];
Bits<5> xd = $encoding[11:7];

Execution

if (!implemented?(ExtensionName::Zacas)) {
  raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
}
XReg virtual_address = X[xs1];
memory_model_release();

Exceptions

This instruction may result in the following synchronous exceptions:

  • IllegalInstruction

Encoding

svg

Defining extension

Access

M

Always

Containing profiles

  • Mandatory: None

  • Optional: RVA23U64, RVB23U64