ori

OR Immediate

ori RT,RS,SImm
ori R31,R31,0

Performs a bitwise OR operation between the contents of a register and an immediate value, placing the result in another register.

Details

The ori instruction performs a bitwise OR operation between the contents of source register RS and the sign-extended 16-bit immediate value SImm, placing the result in target register RT. The instruction is also used as an execution serializing no-op when R31 is used for both RS and RT.

Pseudocode Operation

if 'ori' then
    RT <- (RS) OR SImm

Programming Note

Warning: Other forms of ori Rx,Rx,0 that are not described in this section may also have micro-architectural effects on program execution. Use of these forms should be avoided except when software needs the associated micro-architectural effects. Programming Note: This no-op is intended to be used by software for providing protection against the Spectre class of transient execution attacks by restricting eventually discarded out-of-order execution effects with transient register values, which may compromise confidential data via other covert channels.

Extended Mnemonics

Extended Mnemonic Equivalent Instruction
nop

Example

ori r3, r4, 0x1

Encoding

Binary Layout
24
0
RS
6
RA
11
UI
16
 
Format D-form
Opcode 0x60000000
Extension Base

Operands

  • RA
    Target Register
  • RS
    Source Register
  • UI
    Unsigned 16-bit Immediate
  • RT
    Target General Purpose Register
  • SImm
    Sign-Extended 16-bit Immediate Value