Instruction
CVTTPS2PI
Converts the two low singles to signed doublewords in an MMX register, truncating toward zero.
- Extensions
- Forms
- 2 (2 Legacy)
- Data
- Intel XED v2026.08.23
CVTTPS2PI converts the two low singles of an XMM register, or of eight
bytes of memory, to two signed doublewords in an MMX register,
truncating toward zero whatever MXCSR.RC says. It is the truncating form
of CVTPS2PI, whose page covers what the MMX
destination brings: the x87 TOP set to 0, every tag valid, bits 79:64 of
the register set to all ones, and a pending x87 exception taken first.
CVTTPS2DQ is the SSE2 form that writes four
doublewords to an XMM register, and C’s conversion of a float to int
is the truncation this instruction does.
Two cases on Zen 5
- Out of range in both directions. From XMM8 holding -2^63 (DF000000h) and 2^32 (4F800000h), both elements became 80000000h, the integer indefinite, and IE was set. Intel’s entry mentions only results above the largest doubleword; the value below the smallest gave the indefinite value as well.
- NaN and a denormal, with DAZ. From memory, a signaling NaN gave 80000000h with IE, and the denormal 00000001h gave 0. With DAZ set the denormal counted as zero, so the conversion was exact and PE stayed clear.
In both, the result went into the low 64 bits of the x87 register under MM1, with bits 79:64 all ones.
In our builds
At -O2 in 64-bit code, GCC 14 and Clang 23 compile _mm_cvttps_pi32 to
MOVQ and CVTTPS2DQ in XMM registers, never touching the MMX unit. In
32-bit builds GCC keeps CVTTPS2PI, while Clang still uses CVTTPS2DQ and
returns the pair in EDX:EAX. AMD’s Zen 5 latency spreadsheet lists
CVTTPS2PI as one macro-op on pipe FP2 or FP3, two per cycle.
Forms
Latency and throughput
| Model | mm, m64 | mm, xmm |
|---|---|---|
| Sandy Bridge | 9 / 1p1 | 3 / 1p1 |
| Haswell | 9 / 1p1 | 4 / 1p15 |
| Broadwell | 8 / 1p1 | 4 / 1p15 |
| Skylake | 9 / 1p0 | 5 / 1p05 |
| Skylake-SP, Ice Lake | 9 / 0.5p01 | 5 / 1p015 |
| Alder Lake, Sapphire Rapids | 13 / 1p0 | 9 / 1p015 |
| Lunar Lake | 13 / 2.67V0 V1 | 5 / 2V0 V1 V2 V3 |
| Bonnell | 5 / 5p1 | 5 / 5p1 |
| Silvermont | 8 / 2FPC0 | 5 / 2FPC0 |
| Piledriver | 9 / 1.5FPCVT FPU0 | 4 / 1FPCVT FPSTO FPU0 |
| Zen, Zen 2 | 12 / 1FPU3 | 4 / 1FPU3 |
| Zen 3, Zen 4 | 10 / 0.5FP2 FP3 | 3 / 0.5FP2 FP3 |
| Jaguar | 8 / 1FPU1 | 3 / 1FPU1 STC |
Data flow
Where the elements of the sources go, element 0 on the right; results that depend on a control value are drawn for an example. How to read.
Result element i comes from single i of xmm2, for the low two only. Result elements 1 to 0: r1, r0.
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
for i in range(2):
mm1.d[i] = cvtt_int(src2.f32[i], 32)
# x87: TOP = 0, all tags valid, bits 79:64 of mm1's register all onesRun on AMD Zen 5 (EPYC 9645): 3 cases.
Operands
| Operand | Kind | Action |
|---|---|---|
CVTTPS2PI mm, xmm/m64 | ||
mm | explicit | write |
xmm/m64 | explicit | read |
Flags
None: XED records no flag that the forms test or change.
Exceptions
The exception class is XED's name for the set of exception conditions that a form follows. How to read.
- All forms
mmx-fp
Attributes
What else XED records about the forms. How to read.
- All forms
- follows MXCSR; 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 |
|---|---|---|
SSE | SSE | Every x86-64 processor in XED’s model and Zen 3 to Zen 6 |
More SSE 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-252 (CVTTPS2PI)
- Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 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.