Convert Doubleword and Quadword Integers to Scalar Single-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)CVTSI2SS instruction converts either a doubleword or quadword integer into a single-precision floating-point value. The result is stored in the destination operand.

The VEX and EVEX forms will copy bits 32..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 CVTSI2SS(SimdF32 dest, I32 src)
{
    dest[0] = ConvertToF32(src);
}
public void CVTSI2SS(SimdF32 dest, I64 src)
{
    dest[0] = ConvertToF32(src);
}

public void VCVTSI2SS_Vex(SimdF32 dest, SimdF32 src1, I32 src2)
{
    dest[0] = ConvertToF32(src2);
    dest[1] = src1[1];
    dest[2] = src1[2];
    dest[3] = src1[3];
    dest[4..] = 0;
}
public void VCVTSI2SS_Vex(SimdF32 dest, SimdF32 src1, I64 src2)
{
    dest[0] = ConvertToF32(src2);
    dest[1] = src1[1];
    dest[2] = src1[2];
    dest[3] = src1[3];
    dest[4..] = 0;
}

public void VCVTSI2SS_EvexMemory(SimdF32 dest, I32 src2) =>
    VCVTSI2SS_Vex(dest, src2);
public void VCVTSI2SS_EvexMemory(SimdF32 dest, I64 src2) =>
    VCVTSI2SS_Vex(dest, src2);

public void VCVTSI2SS_EvexRegister(SimdF32 dest, SimdF32 src1, I32 src2)
{
    if (EVEX.b)
        OverrideRoundingModeForThisInstruction(EVEX.rc);
    dest[0] = ConvertToF32(src2);
    dest[1] = src1[1];
    dest[2] = src1[2];
    dest[3] = src1[3];
    dest[4..] = 0;
}
public void VCVTSI2SS_EvexRegister(SimdF32 dest, SimdF32 src1, I64 src2)
{
    if (EVEX.b)
        OverrideRoundingModeForThisInstruction(EVEX.rc);
    dest[0] = ConvertToF32(src2);
    dest[1] = src1[1];
    dest[2] = src1[2];
    dest[3] = src1[3];
    dest[4..] = 0;
}

Intrinsics

Exceptions

SIMD Floating-Point

#XM
  • #P - Inexact result.

Other Exceptions

VEX Encoded Form: See Type 3 Exception Conditions.
EVEX Encoded Form: See Type E3NF Exception Conditions.

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