Instruction
ADCX
Adds two unsigned integers and the carry flag and changes only CF, so a carry chain can run next to an ADOX chain; APX adds a three-operand form.
ADCX adds its source and CF to its destination and puts the carry out in CF, as ADC does, but it changes no other flag. Its twin ADOX does the same with OF as the carry, so two carry chains can run through the same stretch of code without disturbing each other.
Two chains in one row
In a multiplication of numbers of several words, each 128-bit product of two words has a low half for one column and a high half for the next. MULX writes no flags, so one row of the multiplication can add the low halves in a CF chain and the high halves in an OF chain, interleaved. With the multiplier in RDX, the other factor at RSI and the row’s sums in R10 upward:
xor eax, eaxclears CF and OF at once and leaves a zero in RAX.mulx r9, r8, [rsi]puts the first product’s high half in R9 and its low half in R8.adcx r10, r8adds the low half to word 0, carrying in CF;adox r11, r9adds the high half to word 1, carrying in OF.mulx r9, r8, [rsi+8],adcx r11, r8andadox r12, r9do the next word, each chain taking the carry it left, and so on.- An ADCX and an ADOX of RAX into the words above the row absorb the last two carries, as there is no immediate form.
Intel’s optimization manual presents ADCX and ADOX, with MULX, as a way to speed up arithmetic on large integers (Section 2.8.5.10).
Not from C
The intrinsic _addcarryx_u64(c, a, b, &sum) (-madx) has the signature
of _addcarry_u64, and GCC 14 and Clang 23 at -O2 compile both to ADC,
even with -march=znver5: ADCX appears only in hand-written assembly.
Forms and speed
A 32-bit destination takes the carry out of bit 31 and has bits 63:32 cleared, as Zen 5’s cases show. APX adds EVEX forms reaching its new registers and an NDD form with a separate destination.
AMD’s Zen 5 instruction table lists ADCX like ADC: one macro-op, a latency of one cycle, one per cycle. Intel’s manual places it with ADC on the shift units of Golden Cove (Table 2-4). ADX is in no x86-64 level.
In the optimization guide
What the optimization guide says about ADCX, a line per claim. Each links to the claim in the guide, with its sources and where they differ.
Crestmont and Gracemont
- Integer execution: The E-cores keep the arithmetic flags as one register, so ADCX and ADOX depend on each other unless an instruction that writes all flags comes between them.
Haswell and Broadwell
- What Broadwell changed: Broadwell adds ADCX and ADOX, RDSEED and PREFETCHW, which
-march=broadwellenables in LLVM; code built that way can fault on Haswell, which has none of them.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
ADCX r32, r32
ADCX_GPR32d_GPR32d | 66 0F 38 F6 /r | ADX |
ADCX r32, m32
ADCX_GPR32d_MEMd | 66 0F 38 F6 /r | ADX |
ADCX r64, r64 64-bit mode only
ADCX_GPR64q_GPR64q | 66 REX.W 0F 38 F6 /r | ADX |
ADCX r64, m64 64-bit mode only
ADCX_GPR64q_MEMq | 66 REX.W 0F 38 F6 /r | ADX |
ADCX r32, r32
ADCX_GPR32i32_GPR32i32_APX | EVEX.LLZ.66.MAP4.W0 66 /r | APX_F + ADX |
ADCX r32, m32
ADCX_GPR32i32_MEMi32_APX | EVEX.LLZ.66.MAP4.W0 66 /r | APX_F + ADX |
ADCX r64, r64
ADCX_GPR64i64_GPR64i64_APX | EVEX.LLZ.66.MAP4.W1 66 /r | APX_F + ADX |
ADCX r64, m64
ADCX_GPR64i64_MEMi64_APX | EVEX.LLZ.66.MAP4.W1 66 /r | APX_F + ADX |
ADCX r32, r32, r32 NDD
ADCX_GPR32i32_GPR32i32_GPR32i32_APX_N3 | EVEX.LLZ.66.MAP4.W0 66 /r ND=1 | APX_F + APX_NCI_NDD_NF + ADX |
ADCX r32, r32, m32 NDD
ADCX_GPR32i32_GPR32i32_MEMi32_APX_N3 | EVEX.LLZ.66.MAP4.W0 66 /r ND=1 | APX_F + APX_NCI_NDD_NF + ADX |
ADCX r64, r64, r64 NDD
ADCX_GPR64i64_GPR64i64_GPR64i64_APX_N3 | EVEX.LLZ.66.MAP4.W1 66 /r ND=1 | APX_F + APX_NCI_NDD_NF + ADX |
ADCX r64, r64, m64 NDD
ADCX_GPR64i64_GPR64i64_MEMi64_APX_N3 | EVEX.LLZ.66.MAP4.W1 66 /r ND=1 | APX_F + APX_NCI_NDD_NF + ADX |
Latency and throughput
| Model | r32, r32r64, r64 | r32, m32r64, m64 |
|---|---|---|
| Broadwell, Skylake, Skylake-SP, Ice Lake, Alder Lake, Sapphire Rapids | 1 / 0.5p06 | 6 / 0.5p06 |
| Lunar Lake | 1 / 0.33p024 | 6 / 0.33p024 |
| Zen | 1 / 0.25ALU0 ALU1 ALU2 ALU3 | 5 / 0.5ALU0 ALU1 ALU2 ALU3 |
| Zen 2 | 1 / 0.25ALU0 ALU1 ALU2 ALU3 | 5 / 0.33ALU0 ALU1 ALU2 ALU3 |
| Zen 3, Zen 4 | 1 / 1ALU0 ALU1 ALU2 ALU3 | 5 / 1ALU0 ALU1 ALU2 ALU3 |
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
a = dest.read()
b = src.read()
c = cf # the carry in
r = a + b + c
cf = r >> OSIZE & 1 # the carry out; OF, SF, ZF, AF and PF
# keep their values
dest.write(r) # a 32-bit register: bits 63:32 cleared
Run on AMD Zen 5 (EPYC 9645): 96 cases. The APX forms were not run: none of these processors has APX.
a = src1.read()
b = src2.read()
c = cf # the carry in
r = a + b + c
cf = r >> OSIZE & 1 # the carry out; no other flag changes
dest.write(r) # the new destination: bits 63:32 cleared
Not run on a processor: none of these processors has APX.
Operands
| Operand | Kind | Action |
|---|---|---|
ADCX r32, r/m32 ADCX r64, r/m64 64-bit mode only | ||
r32/64 | explicit | read, write |
r/m32/64 | explicit | read |
RFLAGS | implicit | read, write |
ADCX r32, r32, r/m32 NDD ADCX r64, r64, r/m64 NDD | ||
r32/64 | explicit | write |
r32/64 | explicit | read |
r/m32/64 | explicit | read |
RFLAGS | implicit | read, write |
Flags
| CF |
|---|
| All forms |
| TM |
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
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.
| ISA set | CPUID | Processors |
|---|---|---|
ADOX_ADCX | ADX | Broadwell, Skylake, Comet Lake, Cannon Lake, Ice Lake (client), Tiger Lake, Alder Lake, Arrow Lake, Panther Lake, Nova Lake, Skylake-SP, Cascade Lake, Cooper Lake, Ice Lake (server), Sapphire Rapids, Emerald Rapids, Granite Rapids, Diamond Rapids, Sierra Forest, Clearwater Forest, Knights Landing, Knights Mill, Zen, Zen+, Zen 2, Zen 3, Zen 4, Zen 5, Zen 6 |
APX_F_ADX | APX_F + ADX | Nova Lake, Diamond Rapids |
APX_F_ADX_N3 | APX_F + APX_NCI_NDD_NF + ADX | Same as APX_F_ADX |
More ADX instructions
More APX instructions
Sources
- Intel XED v2026.08.23 (commit
0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model. - The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s
-marchfeature sets and AMD’s Processor Programming References, which the page of each processor cites. - LLVM 23.1.2's x86 scheduling models (commit
85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them. - Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2A, page 3-12 (ADCX)
- Intel Advanced Performance Extensions (Intel APX) Architecture Specification, revision 9.0 (355828-009, August 2026)
- AMD64 Architecture Programmer's Manual, Volume 3: General-Purpose and System Instructions (24594, rev. 3.39, October 2026)
- Intel 64 and IA-32 Architectures Optimization Reference Manual, Volume 1 (248966-051, October 2026)
- 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.