XORI
Logical XOR Immediate
XORI rd, rs1, imm
Performs a bitwise logical Exclusive-OR with a sign-extended immediate.
Details
XORI performs a bitwise XOR of register rs1 with the sign-extended 12-bit immediate, writing the result to rd. XORI rd, rs1, -1 performs a bitwise logical inversion of rs1 (assembler pseudoinstruction NOT rd, rs).
Pseudocode Operation
R[rd] = R[rs1] ^ sext(imm);
Example
XORI x10, x11, -1
Encoding
Binary Layout
imm[11:0]
31:20
rs1
19:15
100
14:12
rd
11:7
0010011
6:0
Operands
-
rd
Destination register (integer) -
rs1
Source -
imm
Signed immediate value