SB.RL

RISC-V SB.RL Instruction Details

Instruction ManualS-type

Zalasr atomic store of 1 byte with release-RCsc ordering.

Instruction Syntax

sb.rl rs2, (rs1)
Operand Breakdown
Source rs2: register holding data to write to memory.
Base rs1: register holding the base address.
Immediate offset: 12-bit signed value added to rs1 for the final address.
ZalasrCache & Synchronization

Instruction Behavior

SB.RL is a standalone Zalasr atomic store-release instruction. It atomically stores the low 8 bits of x[rs2] to the address in x[rs1]. The address must be naturally aligned to the operand width unless relaxed by the misaligned atomicity granule PMA;

Quick Understanding & Search Notes

SB.RL is a standalone ordered atomic Zalasr store; rs1 is the only address source and there is no ordinary load/store offset field.

Stores take low bits from rs2; SD.RL/SD.AQRL are RV64-only.
Natural alignment is the default requirement, optionally relaxed by PMA.

Common Usage Scenarios

Atomic & Sync

Understand this scenario with real code like «sb.rl x5, (x6)».

Concurrency & Multi-core

Understand this scenario with real code like «sb.rl x5, (x6)».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is S-type.
  • Confirm the operand order matches the example.
Semantic Check
  • Ensure the destination register usage is compatible with the calling convention.
  • Confirm this is not the lower-level form of a pseudo-instruction expansion.

Pitfalls / Common Confusions

The syntax has no offset immediate; the address comes directly from rs1.
The store uses only the low bits of rs2; upper bits are ignored.
Store encodings without rl set are RESERVED.
Zalasr provides ordered atomic load/store operations, not an LR/SC pair protocol.

FAQ

Can SB.RL use offset(rs1)?

No. The official syntax is rd,(rs1) or rs2,(rs1), with no offset field.

Is SB.RL just a normal load/store plus fence?

No. It is a single atomic ordered load/store instruction defined by Zalasr.