Extensions
Forms
4 (4 Legacy)
Data
Intel XED v2026.08.23

CVTSI2SD converts a signed integer of 32 or 64 bits, from a general-purpose register or memory, to a double in the low element of an XMM register. Every 32-bit integer has an exact double; a 64-bit one may need more than the 53 bits of a double’s significand, and is then rounded as MXCSR.RC says and sets the precision flag. GCC 14 and Clang 23 at -O2 compile C’s conversions from int and long to double to it.

The false dependency

The legacy form writes bits 63:0 and keeps bits 127:64 of the destination, so the old value of that register is an input: the conversion waits for the instruction that last wrote it, although the program wants only the integer converted. AMD’s optimization guide for Zen 5 lists CVTSI2SD among the instructions whose result is merged into the upper part of the destination, and says that the processor skips that wait when it knows those bits to be zero, as after a zeroing idiom such as XORPS of a register with itself (Sections 2.11.5 and 2.11.2). Intel’s guide likewise recommends a dependency-breaking zero idiom where reusing a register creates such a chain (Section 3.5.1.7). The compilers differ in where they put one:

  • GCC 14 zeroes the destination before every conversion: pxor xmm0, xmm0, then cvtsi2sd xmm0, edi.
  • Clang 23 adds an XORPS before conversions inside loops, but not in a function that converts its argument once.

The VEX form, VCVTSI2SD, takes bits 127:64 from a separate source register and clears the bits above 127. In a loop, GCC zeroes one register before it and names that register as the source in every iteration; Clang names XMM15, which its code never writes.

Unsigned integers

No form converts an unsigned integer before AVX-512. For a 32-bit unsigned value both compilers zero-extend it to 64 bits and use the 64-bit form, which is exact. For a 64-bit one, GCC converts half the value, keeping its lowest bit so that the rounding comes out right, and doubles the result; Clang avoids CVTSI2SD with a sequence of packed operations. With AVX-512 both use VCVTUSI2SD. CVTSI2SS converts to a single, where 32-bit integers above 2^24 may be rounded too, and CVTDQ2PD converts two packed 32-bit integers, the form vectorized loops use.

In the optimization guide

What the optimization guide says about CVTSI2SD, a line per claim. Each links to the claim in the guide, with its sources and where they differ.

Out of order

  • Partial register and flag writes: Zen 3 to Zen 5 let sqrtss, cvtsi2sd and other scalar instructions skip the wait for an XMM register whose upper part is known to be zero, so AMD advises zeroing a vector register when done with it.
  • Partial register and flag writes: LLVM breaks the false dependency itself, with an xorps before cvtsi2sd, sqrtss and the other partial writers whose register was written within the last 64 instructions.

Bulldozer to Excavator

  • Vectors and floating point: Scalar instructions such as SQRTSS and CVTSI2SD keep the rest of their destination and wait for its last write, unless the core knows that part to be zero, which it tracks from the instructions that cleared it.

Jaguar and Puma

  • Vectors and floating point: Scalar instructions such as SQRTSS and CVTSI2SD keep the rest of their destination and so wait for its last write, unless the core knows that part to be zero: it follows registers whose upper bits an instruction cleared until something nonzero lands there.

Zen and Zen+

  • Vectors and floating point: Scalar instructions such as SQRTSS or cvtsi2sd keep the upper part of their destination, and so wait for its last write, unless the core knows that part to be zero.

Zen 2

  • Vectors and floating point: Scalar instructions such as SQRTSS or cvtsi2sd keep the upper part of their destination and so wait for its last write, except when the core knows that part is zero.

Zen 3

  • Vectors and floating point: Scalar instructions such as SQRTSS or cvtsi2sd keep the upper part of their destination and so wait for its last write, except when the core knows that part is zero.

Zen 4

  • Vectors and floating point: Scalar instructions such as SQRTSS or cvtsi2sd keep the upper part of their destination and so wait for its last write, except when the core knows that part is zero.

Forms

Every encoding of CVTSI2SD that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
CVTSI2SD xmm, m32 CVTSI2SD_XMMsd_MEMdF2 0F 2A /rSSE2
CVTSI2SD xmm, r32 CVTSI2SD_XMMsd_GPR32dF2 0F 2A /rSSE2
CVTSI2SD xmm, m64 CVTSI2SD_XMMsd_MEMqF2 REX.W 0F 2A /rSSE2
CVTSI2SD xmm, r64 CVTSI2SD_XMMsd_GPR64qF2 REX.W 0F 2A /rSSE2

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.

Scalar: only the low double is computed; the other double comes from xmm1.
CVTSI2SD: the low elementResult double 0 is computed from r32; double 1 is that of xmm1. Result doubles 1 to 0: a1, r0.01xmm1ar0a1xmm10r32or r64, m32, m64b

Result double 0 is computed from r32; double 1 is that of xmm1. Result doubles 1 to 0: a1, r0.

Operation

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

xmm1.f64[0] = to_f64(signed(src2))
# xmm1.q[1] keeps its value
# bits 128 and up of the register are unchanged

Run on AMD Zen 5 (EPYC 9645): 4 cases.

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
CVTSI2SD xmm, r/m32 CVTSI2SD xmm, r/m64
xmmexplicitread, write
r/m32/64explicitread

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
SSE_TYPE_3

Attributes

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

All forms
follows MXCSR

Intrinsics

The C intrinsics of Clang 23.1.2 that compile to CVTSI2SD, each with the form it compiles to and the Clang options it needs. The forms come from compiling every intrinsic and decoding the result with Intel XED; all intrinsics A–Z explains the method.

IntrinsicCompiles to
_mm_cvtsi32_sd __m128d _mm_cvtsi32_sd(__m128d __a, int __b)

CVTSI2SD xmm, r32 Legacy -msse2

_mm_cvtsi64_sd __m128d _mm_cvtsi64_sd(__m128d __a, long long __b)

CVTSI2SD xmm, r64 Legacy -msse2

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
SSE2

SSE2
CPUID.01H:EDX[26] SSE2

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

More SSE2 instructions

All 124 SSE2 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. Clang's x86 intrinsic headers, LLVM 23.1.2 (commit 85ac56026243): the intrinsics, their signatures and doc comments, and the Clang of that release, which compiled each of them.
  4. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2A, page 3-236 (CVTSI2SD)
  5. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 2026)
  6. Intel 64 and IA-32 Architectures Optimization Reference Manual, Volume 1 (248966-051, October 2026)
  7. 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 intrinsics and their signatures come from Clang, part of the LLVM Project, licensed under the Apache License 2.0 with LLVM Exceptions. The text is our own.