Is the immediate zero-extended?
XORI immediate forms use a 12-bit signed immediate that is sign-extended to XLEN.
Bitwise XOR of rs1 with sign-extended 12-bit immediate, result in rd
XORI uses opcode 0010011 (0x13), funct3 100. The rs1 field selects the source register, the 12-bit immediate provides the second operand, and rd selects the destination.
XORI performs bitwise XOR of rs1 with the sign-extended 12-bit immediate, writing to rd. XORI rd,rs1,-1 inverts all bits of rs1 (pseudo NOT). Common for bit flipping, data encryption/checksum, register clearing, and complement generation.
XORI is a base integer bitwise logical instruction. It operates across XLEN bits; immediate forms use a sign-extended 12-bit immediate.
Understand this scenario with real code like «xori x5, x6, -1 # x5 = ~x6 (bitwise NOT)».
Understand this scenario with real code like «xori x5, x6, -1 # x5 = ~x6 (bitwise NOT)».
Understand this scenario with real code like «xori x5, x6, -1 # x5 = ~x6 (bitwise NOT)».
XORI immediate forms use a 12-bit signed immediate that is sign-extended to XLEN.
The base integer ISA has no condition-code flags; only rd is written.