Webcentive RISC-V Reference

amoand.d

Atomic fetch-and-and doubleword

Extension
A
XLEN
RV64 only
Assembly (riscv-unified-db)
amoand.d xd, xs2, (xs1)
Length
32-bit

Encoding

3129282726252420191514121176210
01100aqrlrs2rs1011rd0101111

Match 0x6000302f, mask 0xf800707f. Source: amoand.d rd rs1 rs2 aq rl 31..29=3 28..27=0 14..12=3 6..2=0x0B 1..0=3 in riscv-opcodes/extensions/rv64_a.

FieldBitsriscv-opcodes name
aq26aq
rl25rl
rs224:20rs2
rs119:15rs1
rd11:7rd

Description

Atomically:

  • Load the doubleword at address xs1
  • Write the loaded value into xd
  • AND the value of register xs2 to the loaded value
  • Write the result to the address in xs1

Description from riscv-unified-db, reformatted.

Operation

XReg virtual_address = X[xs1];
X[xd] = amo(64, virtual_address, X[xs2], AmoOperation::And, 1'b0, 1'b0, $encoding);

Pseudocode in riscv-unified-db’s IDL, quoted unchanged.

Specification and related pages