Convert Packed Doubleword Integers to Packed Double-Precision Floating-Point Values

Encoding

EncodingOperand 1Operand 2Operand 3
rmn/aModRM.reg[w]ModRM.r/m[r]
ermhalfModRM.reg[w]ModRM.r/m[r]

Description

The (V)CVTDQ2PD instruction converts two, four, or eight doubleword integers from the source operand into double-precision floating-point values. The result is stored in the destination operand.

All forms except the legacy SSE one will zero the upper (untouched) bits.

Operation

public void CVTDQ2PD(SimdF64 dest, SimdI32 src)
{
    dest[0] = ConvertToF64(src[0]);
    dest[1] = ConvertToF64(src[1]);
    // dest[2..] is unmodified
}

void VCVTDQ2PD_Vex(SimdF64 dest, SimdI32 src, int kl)
{
    for (int n = 0; n < kl; n++)
        dest[n] = ConvertToF64(src[n]);
    dest[kl..] = 0;
}
public void VCVTDQ2PD_Vex128(SimdF64 dest, SimdI32 src) =>
    VCVTDQ2PD_Vex(dest, src, 2);
public void VCVTDQ2PD_Vex128(SimdF64 dest, SimdI32 src) =>
    VCVTDQ2PD_Vex(dest, src, 4);

void VCVTDQ2PD_EvexMemory(SimdF64 dest, SimdI32 src, KMask k, int kl)
{
    for (int n = 0; n < kl; n++)
    {
        if (k[n])
            dest[n] = ConvertToF64(EVEX.b ? src[0] : src[n]);
        else if (EVEX.z)
            dest[n] = 0;
        // otherwise unchanged
    }
    dest[kl..] = 0;
}
public void VCVTDQ2PD_Evex128Memory(SimdF64 dest, SimdI32 src, KMask k) =>
    VCVTDQ2PD_EvexMemory(dest, src, k, 2);
public void VCVTDQ2PD_Evex256Memory(SimdF64 dest, SimdI32 src, KMask k) =>
    VCVTDQ2PD_EvexMemory(dest, src, k, 4);
public void VCVTDQ2PD_Evex512Memory(SimdF64 dest, SimdI32 src, KMask k) =>
    VCVTDQ2PD_EvexMemory(dest, src, k, 8);

void VCVTDQ2PD_EvexRegister(SimdF64 dest, SimdI32 src, KMask k, int kl)
{
    if (kl == 8 && EVEX.b)
        OverrideRoundingModeForThisInstruction(EVEX.rc);

    for (int n = 0; n < kl; n++)
    {
        if (k[n])
            dest[n] = ConvertToF64(src[n]);
        else if (EVEX.z)
            dest[n] = 0;
        // otherwise unchanged
    }
    dest[kl..] = 0;
}
public void VCVTDQ2PD_Evex128Register(SimdF64 dest, SimdI32 src, KMask k) =>
    VCVTDQ2PD_EvexRegister(dest, src, k, 2);
public void VCVTDQ2PD_Evex256Register(SimdF64 dest, SimdI32 src, KMask k) =>
    VCVTDQ2PD_EvexRegister(dest, src, k, 4);
public void VCVTDQ2PD_Evex512Register(SimdF64 dest, SimdI32 src, KMask k) =>
    VCVTDQ2PD_EvexRegister(dest, src, k, 8);

Intrinsics

Exceptions

SIMD Floating-Point

#XM
  • #P - Inexact result.

Other Exceptions

VEX Encoded Form: See Type 2 Exception Conditions.
EVEX Encoded Form: See Type E2 Exception Conditions.

#UD
  • If VEX.vvvv is not 1111b.
  • If EVEX.vvvvv is not 11111b.