amomin.d

Atomic MIN doubleword

This instruction is defined by:

Encoding

svg

Synopsis

Atomically:

  • Load the doubleword at address rs1

  • Write the loaded value into rd

  • Signed compare the value of register rs2 to the loaded value, and select the mimimum value

  • Write the minimum to the address in rs1

Access

M

HS

U

VS

VU

Always

Always

Always

Always

Always

Decode Variables

Bits<1> aq = $encoding[26];
Bits<1> rl = $encoding[25];
Bits<5> rs2 = $encoding[24:20];
Bits<5> rs1 = $encoding[19:15];
Bits<5> rd = $encoding[11:7];

Execution

  • Pruned, XLEN == 64

  • Original

XReg virtual_address = X[rs1];
X[rd] = amo<64>(virtual_address, X[rs2], AmoOperation::Min, aq, rl, $encoding);
if (implemented?(ExtensionName::A) && (CSR[misa].A == 1'b0)) {
  raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
}
XReg virtual_address = X[rs1];
X[rd] = amo<64>(virtual_address, X[rs2], AmoOperation::Min, aq, rl, $encoding);

Exceptions

This instruction may result in the following synchronous exceptions:

  • LoadAccessFault

  • StoreAmoAccessFault

  • StoreAmoAddressMisaligned

  • StoreAmoPageFault