xoris
XOR Immediate Shifted
Performs a bitwise XOR with a 16-bit immediate shifted left by 16 bits.
Details
XOR Immediate Shifted performs a bitwise XOR between the contents of GPR RS and a 16-bit unsigned immediate shifted left by 16 bits, storing the result in GPR RA. This is a Base category instruction that does not affect condition registers or status fields.
Pseudocode Operation
RA ← RS XOR (UI || 0x0000)
Programming Note
The xoris instruction is useful for performing bitwise operations with a large immediate value. Be cautious of overflow if the immediate value exceeds 16 bits, as only the lower 16 bits are considered. This instruction operates at user privilege level and does not generate exceptions under normal circumstances.
Example
// Toggle upper 16 bits.
Encoding
Operands
-
RA
Target Register -
RS
Source Register -
UI
Unsigned 16-bit Immediate