Microsoft Specific

Extracts the lower order floating point value from the parameter.

float _mm_cvtss_f32( 
   __m128 a

[in] a

A 128-bit parameter that contains a floating point value in the lower 32 bits.

The result can be expressed with the following equation:

r := a0




x86, x64

Header file <xmmintrin.h>

r is the 32-bit floating point 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.

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

int main ()
    __m128 a;

    a.m128_f32[0] = -3.5;

    float res = _mm_cvtss_f32(a);

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

    return 0;
Original a: -3.500000
Result res: -3.500000

Adiciones de comunidad