Intel® C++ Compiler 16.0 User and Reference Guide

_mm512_round_ps/ _mm512_mask_round_ps

Rounds float32 vectors. Corresponding instruction is VROUNDPS. This intrinsic only applies to Intel® Many Integrated Core Architecture (Intel® MIC Architecture).

Syntax

Without Mask

extern _m512 __cdecl _mm512_round_ps(_m512 v2, int rc, _MM_EXP_ADJ_ENUM expadj);

With Mask

extern _m512 __cdecl _mm512_mask_round_ps(_m512 v1_old, __mmask16 k1, _m512 v2, int rc, _MM_EXP_ADJ_ENUM expadj);

Parameters

v2

float32 vector used for rounding

v1_old

Source vector that retains old values of the destination vector; the resulting vector gets corresponding elements from v1_old for zero mask bits

k1

Writemask; only those elements of the source vectors with corresponding bit set to '1' in the k1 mask are computed and stored in the result; elements in the result vector corresponding to zero bit in k1 are copied from corresponding elements of vector v1_old

expadj

The exponent value of two by which the result of integer to float conversion is multiplied by in order to adjust the exponent after conversion. Converting integer values to float values requires adjustment of the exponent after conversion. The converted value is multiplied by some power of two, which can be any of the following expadj values:

  • _MM_EXPADJ_NONE - 2**0 (32.0 - no exp adjustment)
  • _MM_EXPADJ_4 - 2**4  (28.4)
  • _MM_EXPADJ_5 - 2**5  (27.5)
  • _MM_EXPADJ_8 - 2**8  (24.8)
  • _MM_EXPADJ_16 - 2**16 (16.16)
  • _MM_EXPADJ_24 - 2**24 (8.24)
  • _MM_EXPADJ_31 - 2**31 (1.31)
  • _MM_EXPADJ_32 - 2**32 (0.32)

rc

Rounding control values; these can be one of the following:

  • _MM_FROUND_TO_NEAREST_INT - rounds to nearest even
  • _MM_FROUND_TO_NEG_INF - rounds to negative infinity
  • _MM_FROUND_TO_POS_INF - rounds to positive infinity
  • _MM_FROUND_TO_ZERO - rounds to zero
  • _MM_FROUND_CUR_DIRECTION - rounds using default from MXCSR register

Description

Performs an element-by-element rounding of the float32 vector v2. The rounding result for each element is a float32 containing an integer or fixed-point value, depending on the value of expadj; the direction of rounding depends on the value of rc.

This intrinsic does not actually convert the result to an int32; the resulting elements are float32, just like the input, but they contain the integer or fixed-point values resulting from specified rounding and scaling.

The masked variant has one additional argument: k1. Only those elements in the source vectors with the corresponding bit set in vector mask k1 are used for computing.

Returns

Returns the result of the rounding operation.