Export (0) Print
Expand All


Visual Studio 2010

Visual Studio 2010 SP1 is required.

Microsoft Specific

Generates the XOP XMM instruction vfrczps to extract the fractional part of the two double-precision floating-point values in its source.

__m128d _mm_frcz_ps (
   __m128d src

[in] src

A 128-bit parameter that contains four 32-bit floating-point values.

A 128-bit result r that contains four 32-bit floating-point values.

r[i] := fractional_part_of(src[i]);





Header file <intrin.h>

The fractional portion of each of the four single-precision floating-point values in src is extracted and stored as the corresponding value in the destination. The sign of each result is the sign of its source value.

The vfrczps instruction is part of the XOP family of instructions. Before you use this intrinsic, you must ensure that the processor supports this instruction. To determine hardware support for this instruction, call the __cpuid intrinsic with InfoType = 0x80000001 and check bit 11 of CPUInfo[2] (ECX). This bit is 1 when the instruction is supported, and 0 otherwise.

#include <stdio.h>
#include <intrin.h>
    __m128 a, d;
    int i;
    a.m128_f32[0] = 1.125;
    a.m128_f32[1] = -17.875;
    a.m128_f32[2] = 23.;
    a.m128_f32[3] = -1.75;
    d = _mm_frcz_ps(a);
    for (i = 0; i < 4; i++) printf_s(" %.3f", d.m128_f32[i]);
0.125 -0.875 0.000 -0.750

Community Additions

© 2015 Microsoft