Instruction
FST
Copies ST(0) to a 32- or 64-bit float in memory, rounding it, or to ST(i).
- Extensions
- Forms
- 3 (3 Legacy)
- Data
- Intel XED v2026.08.23
FST copies ST(0) to a single or a double in memory, or to another x87
register, and leaves the stack as it was. FSTP is the
same store followed by a pop, and only FSTP can write the 80-bit format:
FST has no m80fp form. Compilers use FST where the value is still needed
after the store: GCC 14 and Clang 23 at -O2 compile *p = x; return x;,
with x a long double and p a double *, to an FLD and
fst QWORD PTR [rdi], which leaves x in ST(0) as the result. Without
the return x, both use fstp instead.
A store that rounds
A store to m32fp or m64fp rounds the 80-bit value to the destination’s format, as RC says; PC plays no part. So the store can raise the exceptions of any rounding: PE when bits are lost, OE when the value is too large for the format (with OE masked, an infinity or the largest finite number, as RC directs), UE when it is too small. A signaling NaN is stored quiet, with IE. An unmasked overflow or underflow into memory writes nothing.
This rounding is how x87 code gets single or double results at all.
Where C asks for a double, the registers hold more: GCC 14 compiles
32-bit code with __FLT_EVAL_METHOD__ 2, evaluating in the 80-bit
format, and a value only becomes a double when it is stored. Intel’s
optimization manual notes that compilers therefore store and reload
values to reduce their precision (Section 3.9.4.1); SSE2’s scalar
instructions avoid that.
The register form
FST ST(i) copies ST(0) into ST(i) exactly, whatever it holds, and an empty ST(i) is no fault: it simply becomes full. An empty ST(0) is a stack underflow, which with IE masked stores the QNaN indefinite.
AMD’s Zen 5 guide lists FST to memory as two macro-ops and FST ST(i) as one.
Forms
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
if empty(st0):
underflow()
v = INDEFINITE
else:
v = st0
if dest.bits == 32:
dest.write(to_f32(v)) # rounded by RC, not PC; an SNaN
else: # stored quiet, with IE
dest.write(to_f64(v))
c0 = c2 = c3 = UNDEFINEDRun on AMD Zen 5 (EPYC 9645): 86 cases.
if empty(st0):
underflow()
dest.write(INDEFINITE)
else:
dest.write(st0) # as it is; an empty ST(i) is no
c1 = 0 # fault
c0 = c2 = c3 = UNDEFINEDRun on AMD Zen 5 (EPYC 9645): 8 cases.
Operands
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-386 (FST/
FSTP) - 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.