Convert Doubleword and Quadword Integers to Scalar Double-Precision Floating Point Values

Encoding

EncodingOperand 1Operand 2Operand 3
rmn/aModRM.reg[w]ModRM.r/m[r]
rvmn/aModRM.reg[w]VEX.vvvv[r]ModRM.r/m[r]
ervmtuple1-fixedModRM.reg[w]EVEX.vvvvv[r]ModRM.r/m[r]

Description

The (V)CVTSI2SD instruction converts either a doubleword or quadword integer into a double-precision floating-point value. The result is stored in the destination operand.

The VEX and EVEX forms will copy bits 64..127 from the first source operand into the destination. All forms except the legacy SSE ones will zero the upper (untouched) bits. The EVEX form of this instruction does not support memory-fault suppression. The operand size is always 32 bits if not in Long Mode. In other words, VEX.W1 and EVEX.W1 are treated as VEX.W0 and EVEX.W0 (respectively) outside Long Mode.

Operation

public void CVTSI2SD(SimdF64 dest, I32 src)
{
    dest[0] = ConvertToF64(src);
}
public void CVTSI2SD(SimdF64 dest, I64 src)
{
    dest[0] = ConvertToF64(src);
}

public void VCVTSI2SD_Vex(SimdF64 dest, SimdF64 src1, I32 src2)
{
    dest[0] = ConvertToF64(src2);
    dest[1] = src1[1];
    dest[2..] = 0;
}
public void VCVTSI2SD_Vex(SimdF64 dest, SimdF64 src1, I64 src2)
{
    dest[0] = ConvertToF64(src2);
    dest[1] = src1[1];
    dest[2..] = 0;
}

public void VCVTSI2SD_EvexMemory(SimdF64 dest, I32 src2) =>
    VCVTSI2SD_Vex(dest, src2);
public void VCVTSI2SD_EvexMemory(SimdF64 dest, I64 src2) =>
    VCVTSI2SD_Vex(dest, src2);

public void VCVTSI2SD_EvexRegister(SimdF64 dest, SimdF64 src1, I32 src2)
{
    if (EVEX.b)
        OverrideRoundingModeForThisInstruction(EVEX.rc);
    dest[0] = ConvertToF64(src2);
    dest[1] = src1[1];
    dest[2..] = 0;
}
public void VCVTSI2SD_EvexRegister(SimdF64 dest, SimdF64 src1, I64 src2)
{
    if (EVEX.b)
        OverrideRoundingModeForThisInstruction(EVEX.rc);
    dest[0] = ConvertToF64(src2);
    dest[1] = src1[1];
    dest[2..] = 0;
}

Intrinsics

Exceptions

SIMD Floating-Point

#XM
  • #P - Inexact result.

Other Exceptions

VEX Encoded Form: See Type 5 Exception Conditions.
EVEX Encoded Form: See Type E10NF Exception Conditions.

#UD
  • If VEX.vvvv is not 1111b.
  • If EVEX.vvvvv is not 11111b.
  • If (E)VEX.W is 0, and a floating-point exception is raised while CR4.OSXMMEXCPT is 0.