Extensions
Forms
60 (24 Legacy, 36 EVEX)
Data
Intel XED v2026.08.23

OR sets the bits of its destination that are set in the source and keeps the others.

Setting bits

A constant mask is an immediate of at most 32 bits, sign-extended: GCC 14 and Clang 23 at -O2 compile x | 8 to or rax, 8. For a bit whose number is in a register, both use BTS instead, so x | (1ul << n) becomes bts rax, rsi.

Where the bits of the two operands cannot overlap, OR and ADD give the same result, and a compiler may pick either. Joining two bytes, (uint64_t)a << 8 | b, comes out of GCC as a shift and an OR, and out of Clang as shl edi, 8 and lea eax, [rdi + rsi], an addition.

Two values at once

OR sets ZF only when both operands are 0, which tests two values with one instruction: both compilers compile a == 0 && b == 0 to or rdi, rsi and sete al, without a branch between the two tests.

All ones

or rax, -1 sets all 64 bits in 4 bytes, where mov rax, -1 takes 7. But OR reads its destination and writes the flags, and neither vendor’s optimization manual lists it among the idioms whose result does not wait for the register’s old value (Intel’s Section 3.5.1.7, AMD’s Section 2.9.2 for Zen 5); at -O2 both compilers load -1 with the MOV. For XOR of a register with itself both manuals say the opposite.

Atomic OR

With LOCK and a memory destination, OR sets bits atomically: atomic_fetch_or compiles to lock or when its result is unused and to a CMPXCHG loop when the old value is used. When only one bit of the old value matters, as in atomic_fetch_or(p, 8) & 8, both emit lock bts qword ptr [rdi], 3 (BTS) followed by setc al, which Clang prints as setb al. AOR, from RAO-INT, sets bits atomically but is only weakly ordered with other memory accesses.

Forms

Every encoding of OR that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
OR m8, imm8 OR_MEMb_IMMb_80r180 /1 ibBase instruction set
OR r8, imm8 OR_GPR8_IMMb_80r180 /1 ibBase instruction set
OR m16/32/64, imm16/32 OR_MEMv_IMMz81 /1 iw/idBase instruction set
OR r16/32/64, imm16/32 OR_GPRv_IMMz81 /1 iw/idBase instruction set
OR m8, imm8 not in 64-bit mode OR_MEMb_IMMb_82r182 /1 ibBase instruction set
OR r8, imm8 not in 64-bit mode OR_GPR8_IMMb_82r182 /1 ibBase instruction set
OR m16/32/64, imm8 OR_MEMv_IMMb83 /1 ibBase instruction set
OR r16/32/64, imm8 OR_GPRv_IMMb83 /1 ibBase instruction set
OR m8, r8 OR_MEMb_GPR808 /rBase instruction set
OR r8, r8 OR_GPR8_GPR8_0808 /rBase instruction set
OR m16/32/64, r16/32/64 OR_MEMv_GPRv09 /rBase instruction set
OR r16/32/64, r16/32/64 OR_GPRv_GPRv_0909 /rBase instruction set
OR r8, m8 OR_GPR8_MEMb0A /rBase instruction set
OR r8, r8 OR_GPR8_GPR8_0A0A /rBase instruction set
OR r16/32/64, m16/32/64 OR_GPRv_MEMv0B /rBase instruction set
OR r16/32/64, r16/32/64 OR_GPRv_GPRv_0B0B /rBase instruction set
OR AL, imm8 OR_AL_IMMb0C ibBase instruction set
OR rAX, imm16/32 OR_OrAX_IMMz0D iw/idBase instruction set
LOCK OR m8, imm8 OR_LOCK_MEMb_IMMb_80r180 /1 ibBase instruction set
LOCK OR m16/32/64, imm16/32 OR_LOCK_MEMv_IMMz81 /1 iw/idBase instruction set
LOCK OR m8, imm8 not in 64-bit mode OR_LOCK_MEMb_IMMb_82r182 /1 ibBase instruction set
LOCK OR m16/32/64, imm8 OR_LOCK_MEMv_IMMb83 /1 ibBase instruction set
LOCK OR m8, r8 OR_LOCK_MEMb_GPR808 /rBase instruction set
LOCK OR m16/32/64, r16/32/64 OR_LOCK_MEMv_GPRv09 /rBase instruction set
OR r8, r8 OR_GPR8i8_GPR8i8_APXEVEX.LLZ.NP.MAP4.WIG 08 /r
EVEX.LLZ.NP.MAP4.WIG 0A /r
APX_F
OR m8, r8 OR_MEMi8_GPR8i8_APXEVEX.LLZ.NP.MAP4.WIG 08 /rAPX_F
OR r8, r8 NF OR_GPR8i8_GPR8i8_APX_N3EVEX.LLZ.NP.MAP4.WIG 08 /r NF=1
EVEX.LLZ.NP.MAP4.WIG 0A /r NF=1
APX_F + APX_NCI_NDD_NF
OR m8, r8 NF OR_MEMi8_GPR8i8_APX_N3EVEX.LLZ.NP.MAP4.WIG 08 /r NF=1APX_F + APX_NCI_NDD_NF
OR r16/32/64, r16/32/64, imm8 NDD NF optional OR_GPRv_GPRv_IMM8_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 83 /1 ib ND=1 NF=0/1APX_F + APX_NCI_NDD_NF
OR r16/32/64, m16/32/64, imm8 NDD NF optional OR_GPRv_MEMv_IMM8_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 83 /1 ib ND=1 NF=0/1APX_F + APX_NCI_NDD_NF
OR r8, r8, r8 NDD NF optional OR_GPR8i8_GPR8i8_GPR8i8_APX_N3EVEX.LLZ.NP.MAP4.WIG 08 /r ND=1 NF=0/1
EVEX.LLZ.NP.MAP4.WIG 0A /r ND=1 NF=0/1
APX_F + APX_NCI_NDD_NF
OR r8, m8, r8 NDD NF optional OR_GPR8i8_MEMi8_GPR8i8_APX_N3EVEX.LLZ.NP.MAP4.WIG 08 /r ND=1 NF=0/1APX_F + APX_NCI_NDD_NF
OR r16/32/64, r16/32/64 OR_GPRv_GPRv_APXEVEX.LLZ.NP.MAP4.SCALABLE 09 /r
EVEX.LLZ.NP.MAP4.SCALABLE 0B /r
APX_F
OR m16/32/64, r16/32/64 OR_MEMv_GPRv_APXEVEX.LLZ.NP.MAP4.SCALABLE 09 /rAPX_F
OR r16/32/64, r16/32/64 NF OR_GPRv_GPRv_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 09 /r NF=1
EVEX.LLZ.NP.MAP4.SCALABLE 0B /r NF=1
APX_F + APX_NCI_NDD_NF
OR m16/32/64, r16/32/64 NF OR_MEMv_GPRv_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 09 /r NF=1APX_F + APX_NCI_NDD_NF
OR r16/32/64, r16/32/64, r16/32/64 NDD NF optional OR_GPRv_GPRv_GPRv_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 09 /r ND=1 NF=0/1
EVEX.LLZ.NP.MAP4.SCALABLE 0B /r ND=1 NF=0/1
APX_F + APX_NCI_NDD_NF
OR r16/32/64, m16/32/64, r16/32/64 NDD NF optional OR_GPRv_MEMv_GPRv_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 09 /r ND=1 NF=0/1APX_F + APX_NCI_NDD_NF
OR r8, m8 OR_GPR8i8_MEMi8_APXEVEX.LLZ.NP.MAP4.WIG 0A /rAPX_F
OR r8, m8 NF OR_GPR8i8_MEMi8_APX_N3EVEX.LLZ.NP.MAP4.WIG 0A /r NF=1APX_F + APX_NCI_NDD_NF
OR r8, r8, m8 NDD NF optional OR_GPR8i8_GPR8i8_MEMi8_APX_N3EVEX.LLZ.NP.MAP4.WIG 0A /r ND=1 NF=0/1APX_F + APX_NCI_NDD_NF
OR r16/32/64, m16/32/64 OR_GPRv_MEMv_APXEVEX.LLZ.NP.MAP4.SCALABLE 0B /rAPX_F
OR r16/32/64, m16/32/64 NF OR_GPRv_MEMv_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 0B /r NF=1APX_F + APX_NCI_NDD_NF
OR r8, r8, imm8 NDD NF optional OR_GPR8i8_GPR8i8_IMM8_APX_N3EVEX.LLZ.NP.MAP4.WIG 80 /1 ib ND=1 NF=0/1APX_F + APX_NCI_NDD_NF
OR r8, m8, imm8 NDD NF optional OR_GPR8i8_MEMi8_IMM8_APX_N3EVEX.LLZ.NP.MAP4.WIG 80 /1 ib ND=1 NF=0/1APX_F + APX_NCI_NDD_NF
OR r16/32/64, r16/32/64, m16/32/64 NDD NF optional OR_GPRv_GPRv_MEMv_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 0B /r ND=1 NF=0/1APX_F + APX_NCI_NDD_NF
OR r8, imm8 OR_GPR8i8_IMM8_APXEVEX.LLZ.NP.MAP4.WIG 80 /1 ibAPX_F
OR m8, imm8 OR_MEMi8_IMM8_APXEVEX.LLZ.NP.MAP4.WIG 80 /1 ibAPX_F
OR r8, imm8 NF OR_GPR8i8_IMM8_APX_N3EVEX.LLZ.NP.MAP4.WIG 80 /1 ib NF=1APX_F + APX_NCI_NDD_NF
OR m8, imm8 NF OR_MEMi8_IMM8_APX_N3EVEX.LLZ.NP.MAP4.WIG 80 /1 ib NF=1APX_F + APX_NCI_NDD_NF
OR r16/32/64, imm16/32 OR_GPRv_IMMz_APXEVEX.LLZ.NP.MAP4.SCALABLE 81 /1 iw/idAPX_F
OR m16/32/64, imm16/32 OR_MEMv_IMMz_APXEVEX.LLZ.NP.MAP4.SCALABLE 81 /1 iw/idAPX_F
OR r16/32/64, imm16/32 NF OR_GPRv_IMMz_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 81 /1 iw/id NF=1APX_F + APX_NCI_NDD_NF
OR m16/32/64, imm16/32 NF OR_MEMv_IMMz_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 81 /1 iw/id NF=1APX_F + APX_NCI_NDD_NF
OR r16/32/64, r16/32/64, imm16/32 NDD NF optional OR_GPRv_GPRv_IMMz_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 81 /1 iw/id ND=1 NF=0/1APX_F + APX_NCI_NDD_NF
OR r16/32/64, m16/32/64, imm16/32 NDD NF optional OR_GPRv_MEMv_IMMz_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 81 /1 iw/id ND=1 NF=0/1APX_F + APX_NCI_NDD_NF
OR r16/32/64, imm8 OR_GPRv_IMM8_APXEVEX.LLZ.NP.MAP4.SCALABLE 83 /1 ibAPX_F
OR m16/32/64, imm8 OR_MEMv_IMM8_APXEVEX.LLZ.NP.MAP4.SCALABLE 83 /1 ibAPX_F
OR r16/32/64, imm8 NF OR_GPRv_IMM8_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 83 /1 ib NF=1APX_F + APX_NCI_NDD_NF
OR m16/32/64, imm8 NF OR_MEMv_IMM8_APX_N3EVEX.LLZ.NP.MAP4.SCALABLE 83 /1 ib NF=1APX_F + APX_NCI_NDD_NF

Latency and throughput

What the scheduling models of LLVM 23.1.2 give for each form, not measurements: latency / reciprocal throughput in cycles, the ports under them. A row is a model, or models that agree; a dash, a form that its processors lack. Memory forms: latency from the address, ports without the load and store units. Which processors each model covers.
Modelm8, imm8
m8, r8
OR m8, imm8
OR m8, r8
r8, imm8
r32, imm32
r64, imm32
r16, imm8
r32, imm8
r64, imm8
r8, r8
r16, r16
r32, r32
r64, r64
m16, imm16
m32, imm32
m64, imm32
m16, imm8
m32, imm8
m64, imm8
m16, r16
m32, r32
m64, r64
OR m16, imm16
OR m32, imm32
OR m64, imm32
OR m16, imm8
OR m32, imm8
OR m64, imm8
OR m16, r16
OR m32, r32
OR m64, r64
r16, imm16r8, m8
r16, m16
r32, m32
r64, m64AL, imm8
rAX, imm32
rAX, imm16
Sandy Bridge7 / 1p0151 / 0.33p0157 / 1p0151 / 0.33p0156 / 0.5p0156 / 0.5p0151 / 0.33p0151 / 0.33p015
Haswell, Broadwell, Skylake, Skylake-SP7 / 1p01561 / 0.25p01567 / 1p01561 / 0.25p01566 / 0.5p01566 / 0.5p01561 / 0.25p01561 / 0.25p0156
Ice Lake7 / 0.5p01561 / 0.25p01567 / 0.5p01561 / 0.25p01566 / 0.5p01566 / 0.5p01561 / 0.25p01561 / 0.25p0156
Alder Lake, Sapphire Rapids13 / 0.5p0 p1 p5 p6 p112 / 0.2p0 p1 p5 p6 p1112 / 0.5p0 p1 p5 p6 p111 / 0.2p0 p1 p5 p6 p116 / 0.33p0 p1 p5 p6 p117 / 0.33p0 p1 p5 p6 p112 / 0.2p0 p1 p5 p6 p111 / 0.2p0 p1 p5 p6 p11
Lunar Lake13 / 0.5p0123452 / 0.17p01234512 / 0.67p1351 / 0.33p1356 / 0.33p0123457 / 0.33p0123452 / 0.17p0123451 / 0.33p135
Bonnell1 / 1p01 / 0.5p011 / 1p01 / 0.5p011 / 1p01 / 1p01 / 0.5p011 / 0.5p01
Silvermont5 / 2IEC0 IEC1 MEC1 / 0.5IEC0 IEC15 / 2IEC0 IEC1 MEC1 / 0.5IEC0 IEC14 / 1IEC0 IEC1 MEC4 / 1IEC0 IEC1 MEC1 / 0.5IEC0 IEC11 / 0.5IEC0 IEC1
Piledriver6 / 2EX0 EX11 / 1EX0 EX16 / 2EX0 EX11 / 1EX0 EX15 / 1.5EX0 EX15 / 1.5EX0 EX11 / 1EX0 EX11 / 1EX0 EX1
Zen5 / 0.5ALU0 ALU1 ALU2 ALU31 / 0.25ALU0 ALU1 ALU2 ALU35 / 0.5ALU0 ALU1 ALU2 ALU31 / 0.25ALU0 ALU1 ALU2 ALU35 / 0.5ALU0 ALU1 ALU2 ALU35 / 0.5ALU0 ALU1 ALU2 ALU31 / 0.25ALU0 ALU1 ALU2 ALU31 / 0.25ALU0 ALU1 ALU2 ALU3
Zen 25 / 0.33ALU0 ALU1 ALU2 ALU31 / 0.25ALU0 ALU1 ALU2 ALU35 / 0.33ALU0 ALU1 ALU2 ALU31 / 0.25ALU0 ALU1 ALU2 ALU35 / 0.33ALU0 ALU1 ALU2 ALU35 / 0.33ALU0 ALU1 ALU2 ALU31 / 0.25ALU0 ALU1 ALU2 ALU31 / 0.25ALU0 ALU1 ALU2 ALU3
Zen 3, Zen 46 / 0.67ALU0 ALU1 ALU2 ALU31 / 0.25ALU0 ALU1 ALU2 ALU36 / 0.67ALU0 ALU1 ALU2 ALU31 / 0.25ALU0 ALU1 ALU2 ALU35 / 0.33ALU0 ALU1 ALU2 ALU35 / 0.33ALU0 ALU1 ALU2 ALU31 / 1ALU0 ALU1 ALU2 ALU31 / 1ALU0 ALU1 ALU2 ALU3
Jaguar6 / 1ALU0 ALU11 / 0.5ALU0 ALU16 / 1ALU0 ALU11 / 0.5ALU0 ALU14 / 1ALU0 ALU14 / 1ALU0 ALU11 / 0.5ALU0 ALU11 / 0.5ALU0 ALU1

Operation

What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.

All forms but the NDD forms
r = dest | sext(src)             # with LOCK: one atomic read-modify-write;
                                 # an immediate is sign-extended to OSIZE
if not nf:                       # NF=1 (APX) leaves the flags as they were
    of = cf = 0
    sf = msb(r)
    zf = r == 0
    pf = parity(r)
    af = UNDEFINED
dest.write(r)                    # a 32-bit register: bits 63:32 cleared

Run on AMD Zen 5 (EPYC 9645): 302 cases. The APX forms were not run: none of these processors has APX. The forms that 64-bit mode lacks were not run: the probe runs in 64-bit mode.

NDD forms
r = src1 | sext(src2)            # an immediate is sign-extended to OSIZE
if not nf:                       # NF=1 leaves the flags as they were
    of = cf = 0
    sf = msb(r)
    zf = r == 0
    pf = parity(r)
    af = UNDEFINED
dest.write(r)                    # the new destination: bits 63:OSIZE
                                 # cleared, even for 8 and 16 bits

Not run on a processor: none of these processors has APX.

Operands

What each form reads and writes, as Intel XED records it: the operands of its syntax, in order, and the implicit ones that the syntax does not name. How to read.
OperandKindAction
OR r/m8, imm8 OR r/m16/32/64, imm16/32 OR r/m16/32/64, imm8 LOCK OR m8, imm8 LOCK OR m16/32/64, imm16/32 LOCK OR m16/32/64, imm8
r/m8/16/32/64explicitread, write
imm8/16/32explicitread
RFLAGSimplicitwrite
OR r/m8, r8 OR r/m16/32/64, r16/32/64 LOCK OR m8, r8 LOCK OR m16/32/64, r16/32/64
r/m8/16/32/64explicitread, write
r8/16/32/64explicitread
RFLAGSimplicitwrite
OR r8, r/m8 OR r16/32/64, r/m16/32/64
r8/16/32/64explicitread, write
r/m8/16/32/64explicitread
RFLAGSimplicitwrite
OR AL, imm8 OR rAX, imm16/32
AL, rAXexplicitread, write
imm8/16/32explicitread
RFLAGSimplicitwrite
OR r/m8, r8 NF OR r/m16/32/64, r16/32/64 NF
r/m8/16/32/64explicitread, write
r8/16/32/64explicitread
OR r8, r/m8, imm8 NDD NF optional OR r16/32/64, r/m16/32/64, imm8 NDD NF optional OR r16/32/64, r/m16/32/64, imm16/32 NDD NF optional
r8/16/32/64explicitwrite
r/m8/16/32/64explicitread
imm8/16/32explicitread
RFLAGSimplicitwrite (NF=0)
OR r8, r/m8, r8 NDD NF optional OR r16/32/64, r/m16/32/64, r16/32/64 NDD NF optional
r8/16/32/64explicitwrite
r/m8/16/32/64explicitread
r8/16/32/64explicitread
RFLAGSimplicitwrite (NF=0)
OR r8, m8 NF OR r16/32/64, m16/32/64 NF
r8/16/32/64explicitread, write
m8/16/32/64explicitread
OR r8, r8, m8 NDD NF optional OR r16/32/64, r16/32/64, m16/32/64 NDD NF optional
r8/16/32/64explicitwrite
r8/16/32/64explicitread
m8/16/32/64explicitread
RFLAGSimplicitwrite (NF=0)
OR r/m8, imm8 NF OR r/m16/32/64, imm16/32 NF OR r/m16/32/64, imm8 NF
r/m8/16/32/64explicitread, write
imm8/16/32explicitread

Flags

M modified, 0 cleared, U undefined; blank: not affected. With NF=1, the forms with optional NF leave the flags unchanged. How to read.
WhenOFSFZFAFPFCF
NF forms
Not affected
NDD forms
NF=00MMUM0
Other forms
0MMUM0

Exceptions

The exception class is XED's name for the set of exception conditions that a form follows. How to read.

Legacy forms
none in XED
EVEX forms
APX-EVEX-INT

Attributes

What else XED records about the forms. How to read.

OR m8, imm8 OR m8, r8 OR m16/32/64, imm16/32 OR m16/32/64, imm8 OR m16/32/64, r16/32/64
accepts a LOCK prefix
LOCK forms
locked: atomic read-modify-write; accepts XACQUIRE; accepts XRELEASE

CPUID and processors

Each form belongs to an XED ISA set. A form can be used when the processor reports every CPUID bit of one of its ISA set's alternatives.

CPUID requirements and processors of the XED ISA sets above. Alternatives are separated by “or”; processors follow XED’s chip model, whose AMD processors end with Zen 2, and the CPU data of this site for Zen 3 to Zen 6.
ISA setCPUIDProcessors
I86

No CPUID bit: part of the base instruction set.

Every x86-64 processor in XED’s model and Zen 3 to Zen 6
APX_F

APX_F
CPUID.(EAX=07H,ECX=1):EDX[21] APX_F

Nova Lake, Diamond Rapids
APX_F_N3

APX_F + APX_NCI_NDD_NF
CPUID.(EAX=07H,ECX=1):EDX[21] APX_F
CPUID.(EAX=29H,ECX=0):EBX[0] APX_NCI_NDD_NF

Same as APX_F

More General-purpose instructions

All 109 General-purpose instructions

More APX instructions

All 88 APX instructions

Sources

  1. Intel XED v2026.08.23 (commit 0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model.
  2. The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s -march feature sets and AMD’s Processor Programming References, which the page of each processor cites.
  3. LLVM 23.1.2's x86 scheduling models (commit 85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them.
  4. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2B, page 4-163 (OR)
  5. Intel Advanced Performance Extensions (Intel APX) Architecture Specification, revision 9.0 (355828-009, August 2026)
  6. AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (24594, rev. 3.39, October 2026)
  7. Intel Architecture Instruction Set Extensions and Future Features Programming Reference (319433-062, June 2026)
  8. Intel 64 and IA-32 Architectures Optimization Reference Manual, Volume 1 (248966-051, October 2026)
  9. Software Optimization Guide for the AMD Zen5 Microarchitecture (58455, rev. 1.00, August 2024), Wayback Machine copy of AMD's ZIP

The tables are derived from Intel XED, Copyright Intel Corporation, licensed under the Apache License 2.0; x86-64.net converted and reformatted them. The timings come from LLVM's scheduling models, part of the LLVM Project, licensed under the Apache License 2.0 with LLVM Exceptions. The text is our own.