or

OR Logical Operation

or RT,RA,RB
miso

Performs a bitwise OR operation on the contents of two registers and places the result in a third register.

Details

Performs a bitwise OR operation on two general-purpose registers and stores the result in a third register. This is a base category instruction that operates on the full 64-bit register width. If Rc=1, the instruction updates CR0 based on the result.

Pseudocode Operation

RA ← RS | RB
if Rc = 1 then CR0 ← (RA = 0, RA < 0, RA > 0, SO)

Programming Note

Warning: Other forms of or Rx,Rx,Rx that are not described in this section and in Section 4.3.3 may also cause program priority to change. Use of these forms should be avoided except when software explicitly intends to alter program priority. If a no-op is needed, the preferred no-op (ori 0,0,0) should be used.

Extended Mnemonics

Extended Mnemonic Equivalent Instruction

Example

or r3, r4, r5

// r3 = r4 | r5

Encoding

Binary Layout
31
0
RS
6
RA
30
RB
31
444
Rc
 
Format X-form
Opcode 0x7C000378
Extension Base
Registers Altered CR0, XER

Operands

  • RA
    Target Register
  • RS
    Source Register 1
  • RB
    Source Register 2
  • RT
    Target General Purpose Register