BEXTI
Bit Extract Immediate
BEXTI rd, rs1, imm
Extracts the value of a single bit (0 or 1) at the index specified by an immediate.
Encoding
Binary Layout
010010
31:26
shamtd
25:20
rs1
19:15
101
14:12
rd
11:7
0010011
6:0
Operands
-
rd
Dest (0 or 1) -
rs1
Source -
imm
Index
Example
BEXTI x10, x11, 31
// Get sign bit (bit 31) of x11.
Related
More in Zbs
Reference
View in RISC-V Unprivileged ISA Specification ↗
RISC-V ISA Manual
Description
BEXTI extracts the single bit of rs1 selected by the immediate, zero-extending to XLEN and writing to rd.
Operation
R[rd] = (R[rs1] >> imm) & 1;