Webcentive RISC-V Reference

sd.rl

Store Doubleword Release

Extension
Zalasr
XLEN
RV64 only
Assembly (riscv-unified-db)
sd.rl xs2, (xs1)
Length
32-bit

Encoding

312726252420191514121176210
00111aq1rs2rs1011000000101111

Match 0x3a00302f, mask 0xfa007fff. Source: sd.rl rs1 rs2 aq 25=1 31..27=7 14..12=3 11..7=0 6..2=0x0B 1..0=3 in riscv-opcodes/extensions/rv64_zalasr.

FieldBitsriscv-opcodes name
aq26aq
rs224:20rs2
rs119:15rs1

Description

Store the lowest 64 bits of register xs2 to the address in xs1.

This instruction has release semantics, which means that no previous memory operations (in program order) from this hart can be observed to occur after this store completes. Release semantics provide ordering guarantees useful for synchronization, such as writing a lock variable to release it.

The address must be naturally aligned (8-byte aligned); if not, an address-misaligned or access-fault exception will be raised.

Description from riscv-unified-db, reformatted.

Operation

XReg virtual_address = X[xs1];

if (!is_naturally_aligned(64, virtual_address)) {
  raise(ExceptionCode::StoreAmoAddressMisaligned, mode(), virtual_address);
}

write_memory_aligned(64, virtual_address, X[xs2], $encoding, 1'b0, 1'b1);

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

Specification and related pages