RISC-V BCLRI Instruction Details
Instruction ManualOP-IMM (I-type)Clear single bit by immediate index
Instruction Syntax
rd and rs1 select x0–x31; sources are read before writeback, and x0 writes are discarded.
shamt is a bit index: 0–31 on RV32 or 0–63 on RV64; RV32 encodings with shamt[5]=1 are reserved.
Requires Zbs on RV32/RV64; clear the selected bit and preserve the other rs1 bits.
Instruction Behavior
Zbs bclri clears one bit indexed by shamt: 0–31 on RV32 or 0–63 on RV64. RV32 encodings with shamt[5]=1 are reserved.
BCLRI Decode And Execute Animation
Starts with machine-code field decoding, then shows operand reads, instruction-specific execution, and ISA-visible state update.
This example uses fixed initial register values and PC=0x2000; instruction fetch succeeds, with no asynchronous interrupt or extra extension checks. Exception branches stop ordinary commit; post-trap PC and handler state are EEI-dependent.
Concept Step: receive the 32-bit instruction encoding
The machine code is split by the current instruction format; the animation starts from encoding/decode.
This animation shows ISA-visible decode and state changes, not any specific CPU pipeline, cache, prediction, or timing implementation.
Quick Understanding & Search Notes
bclri uses shamt to select and clear one bit; RV32 encodings with shamt[5]=1 are reserved.
Common Usage Scenarios
RV32/RV64 Zbs, x11=0xff and shamt=3: clear bit 3, giving x10=0xf7; other bits are unchanged.
Pre-Use Checklist
- rd and rs1 select x0–x31; sources are read before writeback, and x0 writes are discarded.
- shamt is a bit index: 0–31 on RV32 or 0–63 on RV64; RV32 encodings with shamt[5]=1 are reserved.
- Requires Zbs on RV32/RV64; clear the selected bit and preserve the other rs1 bits.