sb.rl
Store Byte Release
- Extension
- Zalasr
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
sb.rl xs2, (xs1)- Length
- 32-bit
Encoding
| 3127 | 26 | 25 | 2420 | 1915 | 1412 | 117 | 62 | 10 | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 00111 | aq | 1 | rs2 | rs1 | 000 | 00000 | 01011 | 11 | |||||||||||||||||||||||
Match 0x3a00002f, mask 0xfa007fff. Source: sb.rl rs1 rs2 aq 25=1 31..27=7 14..12=0 11..7=0 6..2=0x0B 1..0=3 in riscv-opcodes/extensions/rv_zalasr.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| aq | 26 | aq |
| rs2 | 24:20 | rs2 |
| rs1 | 19:15 | rs1 |
Description
Store the lowest 8 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; 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(8, virtual_address)) {
raise(ExceptionCode::StoreAmoAddressMisaligned, mode(), virtual_address);
}
write_memory_aligned(8, virtual_address, X[xs2][7:0], $encoding, 1'b0, 1'b1);Pseudocode in riscv-unified-db’s IDL, quoted unchanged.