oris
OR Immediate Shifted
oris RA, RS, UI
Performs a bitwise OR with a 16-bit immediate shifted left by 16 bits.
Encoding
Binary Layout
25
0:5
RS
6:10
RA
11:15
UI
16:31
Operands
-
RA
Target Register -
RS
Source Register -
UI
Unsigned 16-bit Immediate
Example
oris r3, r4, 0xFFFF
// Set upper 16 bits.
Related
More in Base
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
Performs a bitwise OR between a general-purpose register and a 16-bit unsigned immediate value shifted left by 16 bits, storing the result in another register. This is a base category instruction used to set high-order bits with no condition register updates.
Operation
RA ← RS | (UI || 0x0000)
Programming Note
The oris instruction is commonly used to set specific bits in a register by ORing it with an immediate value. Be cautious of overflow if UI exceeds the upper limit, as it will be truncated. This instruction operates at user privilege level and does not generate exceptions under normal circumstances.