Home/Instructions/Bit Clear Immediate
BCLRI

RISC-V BCLRI Instruction Details

Instruction ManualI-type

Clear single bit by immediate index

Instruction Syntax

bclri rd, rs1, uimm
Operand Breakdown
Destination rd: general-purpose register receiving the result.
Source rs1: register holding the first operand.
Immediate imm: 12-bit signed value, sign-extended before operation with rs1.
BZbsBit ManipulationSingle-Bit Operation

Instruction Encoding

31..20
imm[11:0]
19..15
rs1
14..12
funct3
11..7
rd
6..0
opcode

BCLRI uses opcode 0010011 (0x13), funct3 001, funct7 0100100. The rs1 field selects the source register, the 12-bit immediate provides the second operand, and rd selects the destination.

Format: I-type
opcode: 0010011 (0x13)
funct3: 001 (0x1)
funct7: 0100100 (0x24)

Instruction Behavior

bclri is a Zbs single-bit clear instruction. The bit index comes from the immediate field.

Quick Understanding & Search Notes

bclri is a Zbs single-bit clear instruction. The bit index comes from the immediate field.

These instructions are part of a B-extension subset and operate on XLEN-wide integer register values.
The immediate field width depends on XLEN; RV32 encodes 0..31 and RV64 encodes 0..63.
bclri changes one selected bit and leaves the other bits from rs1 unchanged.

Common Usage Scenarios

Bit Operations & Masks

Understand this scenario with real code like «bclri x10, x11, 3 ; x10 = x11 & ~(1 << 3)».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is I-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 immediate field width depends on XLEN; RV32 encodes 0..31 and RV64 encodes 0..63.
bclri changes one selected bit and leaves the other bits from rs1 unchanged.

FAQ

Does bclri access memory?

No. It reads integer register operands and writes rd only.

How is the bit index selected for bclri?

The immediate encodes the bit position directly, with the legal range determined by XLEN.