xoris
XOR Immediate Shifted
xoris RA, RS, UI
Performs a bitwise XOR with a 16-bit immediate shifted left by 16 bits.
Encoding
Binary Layout
27
0:5
RS
6:10
RA
11:15
UI
16:31
Operands
-
RA
Target Register -
RS
Source Register -
UI
Unsigned 16-bit Immediate
Example
xoris r3, r4, 0xFFFF
// Toggle upper 16 bits.
Related
More in Base
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
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.
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.