Share via


_mm256_frcz_ps

Visual Studio 2010 SP1 is required.

Microsoft Specific

Generates the XOP YMM instruction vfrczps to extract the fractional part of each value in its source.

__m256 _mm256_frcz_ps (
   __m256 src
);

Parameters

  • [in] src
    A 256-bit parameter that contains eight 32-bit floating-point values.

Return value

A 256-bit result r that contains eight 32-bit floating-point values.

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

Requirements

Intrinsic

Architecture

_mm256_frcz_ps

XOP

Header file <intrin.h>

Remarks

The fractional portion of each of the eight 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.

Example

#include <stdio.h>
#include <intrin.h>
int main()
{
    __m256 a, d;
    int i;
    a.m256_f32[0] = -3.75;
    for (i = 0; i < 7; i++) {
        a.m256_f32[i+1] = a.m256_f32[i] + 1.5;
    }
    d = _mm256_frcz_ps(a);
    for (i = 0; i < 8; i++) printf_s(" %.3f", a.m256_f32[i]);
    printf_s("\n");
    for (i = 0; i < 8; i++) printf_s(" %.3f", d.m256_f32[i]);
    printf_s("\n");
}
-3.750 -2.250 -0.750 0.750 2.250 3.750 5.250 6.750
-0.750 -0.250 -0.750 0.750 0.250 0.750 0.250 0.750

See Also

Reference

_mm256_frcz_pd

_mm_frcz_sd

_mm_frcz_ss

__cpuid, __cpuidex

XOP Intrinsics Added for Visual Studio 2010 SP1