Instruction
FDIV
Divides ST(0) by a float from memory, or ST(0) by ST(i) or ST(i) by ST(0), into the dividend's register.
- Extensions
- Forms
- 4 (4 Legacy)
- Data
- Intel XED v2026.08.23
FDIV divides, and the dividend’s register receives the quotient:
fdiv st, st(i) computes ST(0) / ST(i) into ST(0), fdiv st(i), st
computes ST(i) / ST(0) into ST(i), and the memory forms divide ST(0) by
a single or double. Since division does not commute, each form has a
reversed twin: FDIVR divides the other way round into
the same register, and FDIVP and FDIVRP
do so into ST(i) and pop. For a / b on two long doubles, GCC 14 at
-O2 loads a, then b, and emits fdivp st(1), st; Clang 23 loads them
the other way and emits fdivrp st(1), st.
The AT&T names
In AT&T syntax, which GCC emits by default, the register forms with
ST(i) as the destination swap the R: GCC’s own AT&T output for that
a / b reads fdivrp %st, %st(1), and GNU as 2.44 encodes it as DE F9,
which Intel’s manual and objdump -M intel call fdivp st(1), st;
likewise fdiv %st, %st(1) is Intel’s fdivr st(1), st.
FSUB and FSUBR share the trait. GCC and GNU as agree with
each other, so compiled code is right; hand-written AT&T assembly, and
listings read across the two syntaxes, are where it bites.
Edge cases
- A nonzero finite dividend over zero sets ZE and, with it masked, gives an infinity of the quotient’s sign.
- Zero over zero and infinity over infinity are invalid operations: IE, and with it masked the QNaN indefinite.
- The quotient is rounded once, to PC’s precision, as RC says; C1 is 1 if it was rounded up.
Speed
Intel’s optimization manual notes that a smaller PC lets the divider finish sooner, at 24 bits fastest, and asks for as few precision changes as possible (Section 3.9.3.2). AMD’s Zen 5 guide lists one FDIV started every five cycles at most, against one FADD or FMUL each cycle.
Forms
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
if empty(dest) or empty(src):
underflow() # IE, SF, C1 = 0
dest.write(INDEFINITE) # the QNaN indefinite
else:
dest.write(div(dest, src)) # by zero: ZE and an infinity
c0 = c2 = c3 = UNDEFINEDRun on AMD Zen 5 (EPYC 9645): 46 cases.
if empty(st0):
underflow() # IE, SF, C1 = 0
st0 = INDEFINITE
else:
st0 = div(st0, src) # a single or double: exact in the
# 80-bit format
c0 = c2 = c3 = UNDEFINEDRun on AMD Zen 5 (EPYC 9645): 23 cases.
Operands
| Operand | Kind | Action |
|---|---|---|
FDIV m32fp FDIV m64fp | ||
m32/64fp | explicit | read |
x87 status word | implicit | write |
FDIV ST(0), st(i) | ||
ST(0) | explicit | read, write |
st(i) | explicit | read |
x87 status word | implicit | write |
FDIV st(i), ST(0) | ||
st(i) | explicit | read, write |
ST(0) | explicit | read |
x87 status word | implicit | write |
Flags
| C0 | C1 | C2 | C3 |
|---|---|---|---|
| All forms | |||
| U | M | U | U |
Attributes
What else XED records about the forms. How to read.
- All forms
- may abort a TSX transaction
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 |
|---|---|---|
X87 | FPU | Every x86-64 processor in XED’s model and Zen 3 to Zen 6 |
More x87 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. - Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2A, page 3-333 (FDIV/
FDIVP/ FIDIV) - Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 2026)
- AMD64 Architecture Programmer's Manual, Volume 5: 64-Bit Media and x87 Floating-Point Instructions (26569, rev. 3.16, November 2021), Wayback Machine copy of AMD's PDF
- 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 text is our own.