C.ANDI
Compressed AND Immediate
C.ANDI rd', imm
Computes bitwise AND with a signed immediate.
Encoding
Binary Layout
?
31:16
100
15:13
c_imm6hi
12
10
11:10
rd_rs1_p
9:7
c_imm6lo
6:2
01
1:0
Operands
-
rd'
Dest/Source -
imm
Signed Imm
Example
C.ANDI x8, 15
// Keep lowest 4 bits.
Related
More in C
Reference
View in RISC-V Unprivileged ISA Specification ↗
RISC-V ISA Manual
Description
Computes the bitwise AND of rd′ and a 6-bit sign-extended immediate.
Operation
R[rd'] = R[rd'] & sext(imm);