_mm_cvttss_si64

Microsoft Specific

Emits the Streaming SIMD Extensions (SSE) instruction cvttss2si. This instruction extracts a 32-bit floating point value and converts it to a signed 64-bit integer using truncation.

__int64 _mm_cvttss_si64( 
   __m128 a
);

Parameters

  • [in] a
    A 128-bit parameter that contains a floating point value in the lowest 32-bits.

Return value

The result can be expressed with the following equation:

r := CVT(TRUNCATE(a0))

Requirements

Intrinsic

Architecture

_mm_cvttss_si64

x64

Header file <xmmintrin.h>

Remarks

r is the 64-bit signed integer result. a0 is the lower 32 bits of parameter a. The upper 96 bits of a are ignored.

Before you use this intrinsic, software must ensure that the processor supports the instruction.

Example

#include <stdio.h>
#include <xmmintrin.h>

int main ()
{
    __m128 a;

    a.m128_f32[0] = 100.5;

    __int64 res = _mm_cvttss_si64(a);

    printf_s("Original a: %f\n", a.m128_f32[0]);
    printf_s("Result res: %I64d\n", res);

    return 0;
}
Original a: 100.500000
Result res: 100

See Also

Reference

Compiler Intrinsics