# Intrinsics for Miscellaneous FP Operations

The prototypes for Intel® Advanced Vector Extensions 512 (Intel® AVX-512) intrinsics are located in the zmmintrin.h header file.
To use these intrinsics, include the immintrin.h file as follows:

    #include <immintrin.h>

Intrinsic Name | Operation | Corresponding Intel® AVX-512 Instruction
--- | --- | ---
`_mm512_fixupimm_pd`, `_mm512_mask_fixupimm_pd`, `_mm512_maskz_fixupimm_pd` `_mm512_fixupimm_round_pd`, `_mm512_mask_fixupimm_round_pd`, `_mm512_maskz_fixupimm_round_pd` | Fixes up packed float64 elements. | `VFIXUPIMMPD`
`_mm512_fixupimm_ps`, `_mm512_mask_fixupimm_ps`, `_mm512_maskz_fixupimm_ps` `_mm512_fixupimm_round_ps`, `_mm512_mask_fixupimm_round_ps`, `_mm512_maskz_fixupimm_round_ps` | Fixes up packed float32 elements. | `VFIXUPIMMPS`
`_mm_fixupimm_round_sd`, `_mm_mask_fixupimm_round_sd`, `_mm_maskz_fixupimm_round_sd` | Fixes up scalar float64 elements. | `VFIXUPIMMSD`
`_mm_fixupimm_round_ss`, `_mm_mask_fixupimm_round_ss`, `_mm_maskz_fixupimm_round_ss` | Fixes up scalar float32 elements. | `VFIXUPIMMSS`
`_mm_getexp_round_pd`, `_mm_mask_getexp_round_pd`, `_mm_maskz_getexp_round_pd` `_mm_maskz_getexp_round_pd` | Converts exponent of each packed float64 element to a rounded float64 number representing the integer exponent. | `VGETEXPPD`
`_mm_getexp_round_ps`, `_mm_mask_getexp_round_ps`, `_mm_maskz_getexp_round_ps` `_mm_maskz_getexp_round_ps` | Converts exponent of each packed float32 element to a rounded float32 number representing the integer exponent. | `VGETEXPPS`
`_mm_getexp_round_sd`, `_mm_mask_getexp_round_sd`, `_mm_maskz_getexp_round_sd` `_mm_getexp_round_sd`, `_mm_mask_getexp_round_sd`, `_mm_maskz_getexp_round_sd` | Converts exponent of each scalar float64 element to a rounded scalar float64 number representing the integer exponent. | `VGETEXPSD`
`_mm_getexp_round_ss`, `_mm_mask_getexp_round_ss`, `_mm_maskz_getexp_round_ss` | Converts exponent of each scalar float32 element to a rounded scalar float32 number representing the integer exponent. | `VGETEXPSS`

variable | definition
--- | ---
k | writemask used as a selector
a | first source vector element
b | second source vector element
c | third source vector element
src | source element to use based on writemask result
round | Rounding control values; these can be one of the following (along with the `sae` suppress all exceptions flag): `_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
src | source element
imm | reporting flag
src | source element

_mm512_fixupimm_pd

    extern __m512d __cdecl _mm512_fixupimm_pd(__m512d a, __m512d b, __m512i c, int imm);

Fixes up packed float64 elements in a and b using packed 64-bit integers in c, and stores the result.

imm is used to set the required flags reporting.

_mm512_mask_fixupimm_pd

    extern __m512d __cdecl _mm512_mask_fixupimm_pd(__m512d a, __mmask8 k, __m512d b, __m512i c, int imm);

Fixes up packed float64 elements in a and b using packed 64-bit integers in c, and stores the result using writemask k (elements are copied from a when the corresponding mask bit is not set).

imm is used to set the required flags reporting.

_mm512_maskz_fixupimm_pd

    extern __m512d __cdecl _mm512_maskz_fixupimm_pd(__mmask8 k, __m512d a, __m512d b, __m512i c, int imm);

Fixes up packed float64 elements in a and b using packed 64-bit integers in c, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

imm is used to set the required flags reporting.

_mm512_fixupimm_round_pd

    extern __m512d __cdecl _mm512_fixupimm_round_pd(__m512d a, __m512d b, __m512i c, int imm, int round);

Fixes up packed float64 elements in a and b using packed 64-bit integers in c, and stores the result.

imm is used to set the required flags reporting.

_mm512_mask_fixupimm_round_pd

    extern __m512d __cdecl _mm512_mask_fixupimm_round_pd(__m512d a, __mmask8 k, __m512d b, __m512i c, int imm, int round);

Fixes up packed float64 elements in a and b using packed 64-bit integers in c, and stores the result using writemask k (elements are copied from a when the corresponding mask bit is not set).

imm is used to set the required flags reporting.

_mm512_maskz_fixupimm_round_pd

    extern __m512d __cdecl _mm512_maskz_fixupimm_round_pd(__mmask8 k, __m512d a, __m512d b, __m512i c, int imm, int round);

Fixes up packed float64 elements in a and b using packed 64-bit integers in c, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

imm is used to set the required flags reporting.

_mm512_fixupimm_ps

    extern __m512 __cdecl _mm512_fixupimm_ps(__m512 a, __m512 b, __m512i c, int imm);

Fixes up packed float32 elements in a and b using packed 32-bit integers in c, and stores the result. imm is used to set the required flags reporting.

_mm512_mask_fixupimm_ps

    extern __m512 __cdecl _mm512_mask_fixupimm_ps(__m512 a, __mmask16 k, __m512 b, __m512i c, int imm);

Fixes up packed float32 elements in a and b using packed 32-bit integers in c, and stores the result using writemask k (elements are copied from a when the corresponding mask bit is not set).

imm is used to set the required flags reporting.

_mm512_maskz_fixupimm_ps

    extern __m512 __cdecl _mm512_maskz_fixupimm_ps(__mmask16 k, __m512 a, __m512 b, __m512i c, int imm);

Fixes up packed float32 elements in a and b using packed 32-bit integers in c, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

imm is used to set the required flags reporting.

_mm512_fixupimm_round_ps

    extern __m512 __cdecl _mm512_fixupimm_round_ps(__m512 a, __m512 b, __m512i c, int imm, int round);

Fixes up packed float32 elements in a and b using packed 32-bit integers in c, and stores the result. imm is used to set the required flags reporting.

_mm512_mask_fixupimm_round_ps

    extern __m512 __cdecl _mm512_mask_fixupimm_round_ps(__m512 a, __mmask16 k, __m512 b, __m512i, int imm, int round);

Fixes up packed float32 elements in a and b using packed 32-bit integers in c, and stores the result using writemask k (elements are copied from a when the corresponding mask bit is not set).

imm is used to set the required flags reporting.

_mm512_maskz_fixupimm_round_ps

    extern __m512 __cdecl _mm512_maskz_fixupimm_round_ps(__mmask16 k, __m512 a, __m512 b, __m512i, int imm, int round);

Fixes up packed float32 elements in a and b using packed 32-bit integers in c, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

imm is used to set the required flags reporting.

_mm_fixupimm_sd

    extern __m128d __cdecl _mm_fixupimm_sd(__m128d a, __m128d b, __m128i c, int imm);

Fixes up lower float64 elements in a and b using lower 64-bit integer in c, stores the result in lower destination element, and copies upper element from a to upper destination element.

imm is used to set the required flags reporting.

_mm_mask_fixupimm_sd

    extern __m128d __cdecl _mm_mask_fixupimm_sd(__m128d a, __mmask8 k, __m128d b, __m128i c, int imm);

Fixes up lower float64 elements in a and b using lower 64-bit integer in c, stores the result in lower destination element using writemask k (the element is copied from a when mask bit 0 is not set), and copies upper element from a to upper destination element.

imm is used to set the required flags reporting.

_mm_maskz_fixupimm_sd

    extern __m128d __cdecl _mm_maskz_fixupimm_sd(__mmask8 k, __m128d a, __m128d b, __m128i c, int imm);

Fixes up lower float64 elements in a and b using lower 64-bit integer in c, stores the result in lower destination element using zeromask k (the element is zeroed out when mask bit 0 is not set), and copies upper element from a to upper destination element.

imm is used to set the required flags reporting.

_mm_fixupimm_round_sd

    extern __m128d __cdecl _mm_fixupimm_round_sd(__m128d a, __m128d b, __m128i c, int imm, int round);

Fixes up lower float64 elements in a and b using lower 64-bit integer in c, stores the result in lower destination element, and copies upper element from a to upper destination element.

imm is used to set the required flags reporting.

_mm_mask_fixupimm_round_sd

    extern __m128d __cdecl _mm_mask_fixupimm_round_sd(__m128d a, __mmask8 k, __m128d b, __m128i c, int imm, int round);

Fixes up lower float64 elements in a and b using lower 64-bit integer in c, stores the result in lower destination element using writemask k (the element is copied from a when mask bit 0 is not set), and copies upper element from a to upper destination element.

imm is used to set the required flags reporting.

_mm_maskz_fixupimm_round_sd

    extern __m128d __cdecl _mm_maskz_fixupimm_round_sd(__mmask8 k, __m128d a, __m128d b, __m128i c, int imm, int round);

Fixes up lower float64 elements in a and b using lower 64-bit integer in c, stores the result in lower destination element using zeromask k (the element is zeroed out when mask bit 0 is not set), and copies upper element from a to upper destination element.

imm is used to set the required flags reporting.

_mm_fixupimm_round_ss

    extern __m128 __cdecl _mm_fixupimm_round_ss(__m128 a, __m128 b, __m128i c, int imm, int round);

Fixes up lower float32 elements in a and b using lower 32-bit integer in c, stores the result in lower destination element, and copies upper three packed elements from a to upper destination elements.

imm is used to set the required flags reporting.

_mm_mask_fixupimm_round_ss

    extern __m128 __cdecl _mm_mask_fixupimm_round_ss(__m128 a, __mmask8 k, __m128 b, __m128i c, int imm, int round);

Fixes up lower float32 elements in a and b using lower 32-bit integer in c, stores the result in lower destination element using writemask k (the element is copied from a when mask bit 0 is not set), and copies upper three packed elements from a to upper destination elements.

imm is used to set the required flags reporting.

_mm_maskz_fixupimm_round_ss

    extern __m128 __cdecl _mm_maskz_fixupimm_round_ss(__mmask8 k, __m128 a, __m128 b, __m128i c, int imm, int round);

Fixes up lower float32 elements in a and b using lower 32-bit integer in c, stores the result in lower destination element using zeromask k (the element is zeroed out when mask bit 0 is not set), and copies upper three packed elements from a to upper destination elements.

imm is used to set the required flags reporting.

_mm_fixupimm_ss

    extern __m128 __cdecl _mm_fixupimm_ss(__m128 a, __m128 b, __m128i c, int imm);

Fixes up lower float32 elements in a and b using lower 32-bit integer in c, stores the result in lower destination element, and copies upper three packed elements from a to upper destination elements.

imm is used to set the required flags reporting.

_mm_mask_fixupimm_ss

    extern __m128 __cdecl _mm_mask_fixupimm_ss(__m128 a, __mmask8 k, __m128 b, __m128i c, int imm);

Fixes up lower float32 elements in a and b using lower 32-bit integer in c, stores the result in lower destination element using writemask k (the element is copied from a when mask bit 0 is not set), and copies upper three packed elements from a to upper destination elements.

imm is used to set the required flags reporting.

_mm_maskz_fixupimm_ss

    extern __m128 __cdecl _mm_maskz_fixupimm_ss(__mmask8 k, __m128 a, __m128 b, __m128i c, int imm);

Fixes up lower float32 elements in a and b using lower 32-bit integer in c, stores the result in lower destination element using zeromask k (the element is zeroed out when mask bit 0 is not set), and copies upper three packed elements from a to upper destination elements.

imm is used to set the required flags reporting.

_mm512_getexp_pd

    extern __m512d __cdecl _mm512_getexp_pd(__m512d a);

Converts the exponent of each packed float64 element in a to a float64 number representing the integer exponent, and stores the result. This intrinsic essentially calculates `floor(log2(x))` for each element.

_mm512_mask_getexp_pd

    extern __m512d __cdecl _mm512_mask_getexp_pd(__m512d src, __mmask8 k, __m512d a);

Converts the exponent of each packed float64 element in a to a float64 number representing the integer exponent, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates `floor(log2(x))` for each element.

_mm512_maskz_getexp_pd

    extern __m512d __cdecl _mm512_maskz_getexp_pd(__mmask8 k, __m512d a);

Converts the exponent of each packed float64 element in a to a float64 number representing the integer exponent, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates `floor(log2(x))` for each element.

_mm512_getexp_round_pd

    extern __m512d __cdecl _mm512_getexp_round_pd(__m512d a, int round);

Converts the exponent of each packed float64 element in a to a float64 number representing the integer exponent, and stores the result. This intrinsic essentially calculates `floor(log2(x))` for each element.

_mm512_mask_getexp_round_pd

    extern __m512d __cdecl _mm512_mask_getexp_round_pd(__m512d src, __mmask8 a, __m512d, int round);

Converts the exponent of each packed float64 element in a to a float64 number representing the integer exponent, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates `floor(log2(x))` for each element.

_mm512_maskz_getexp_round_pd

    extern __m512d __cdecl _mm512_maskz_getexp_round_pd(__mmask8 k, __m512d a, int round);

Converts the exponent of each packed float64 element in a to a float64 number representing the integer exponent, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates `floor(log2(x))` for each element.

_mm512_getexp_ps

    extern __m512 __cdecl _mm512_getexp_ps(__m512 a);

Converts the exponent of each packed float32 element in a to a float32 number representing the integer exponent, and stores the result. This intrinsic essentially calculates `floor(log2(x))` for each element.

_mm512_mask_getexp_ps

    extern __m512 __cdecl _mm512_mask_getexp_ps(__m512 src, __mmask16 k, __m512 a);

Converts the exponent of each packed float32 element in a to a float32 number representing the integer exponent, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates `floor(log2(x))` for each element.

_mm512_maskz_getexp_ps

    extern __m512d __cdecl _mm512_maskz_getexp_ps(__mmask16 k, __m512 a);

Converts the exponent of each packed float32 element in a to a float32 number representing the integer exponent, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates `floor(log2(x))` for each element.

_mm512_getexp_round_ps

    extern __m512 __cdecl _mm512_getexp_round_ps(__m512 a, int round);

Converts the exponent of each packed float32 element in a to a float32 number representing the integer exponent, and stores the result. This intrinsic essentially calculates `floor(log2(x))` for each element.

_mm512_mask_getexp_round_ps

    extern __m512 __cdecl _mm512_mask_getexp_round_ps(__m512 src, __mmask16 k, __m512 a, int round);

Converts the exponent of each packed float32 element in a to a float32 number representing the integer exponent, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set). This intrinsic essentially calculates `floor(log2(x))` for each element.

_mm512_maskz_getexp_round_ps

    extern __m512 __cdecl _mm512_maskz_getexp_round_ps(__mmask16 k, __m512 a, int round);

Converts the exponent of each packed float32 element in a to a float32 number representing the integer exponent, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set). This intrinsic essentially calculates `floor(log2(x))` for each element.

_mm_getexp_round_sd

    extern __m128d __cdecl _mm_getexp_round_sd(__m128d a, __m128d b, int round);

Converts lower exponent of float64 element in b to a float64 number representing the integer exponent, stores the result in lower destination element, and copies upper element from a to upper destination element. This intrinsic essentially calculates `floor(log2(x))` for lower element.

_mm_mask_getexp_round_sd

    extern __m128d __cdecl _mm_mask_getexp_round_sd(__m128d src, __mmask8 k, __m128d a, __m128d b, int round);

Converts lower exponent of float64 element in b to a float64 number representing the integer exponent, stores the result in lower destination element, and copies upper element from a to upper destination element. This intrinsic essentially calculates `floor(log2(x))` for lower element.

_mm_maskz_getexp_round_sd

    extern __m128d __cdecl _mm_maskz_getexp_round_sd(__mmask8 k, __m128d a, __m128d b, int round);

Converts lower exponent of float64 element in b to a float64 number representing the integer exponent, stores the result in lower destination element using writemask k (the element is copied from src when mask bit 0 is not set), and copies upper element from a to upper destination element. This intrinsic essentially calculates `floor(log2(x))` for lower element.

_mm_getexp_sd

    extern __m128d __cdecl _mm_getexp_sd(__m128d a, __m128d b);

Converts lower exponent of float64 element in b to a float64 number representing the integer exponent, stores the result in lower destination element, and copies upper element from a to upper destination element. This intrinsic essentially calculates `floor(log2(x))` for lower element.

_mm_mask_getexp_sd

    extern __m128d __cdecl _mm_mask_getexp_sd(__m128d src, __mmask8 k, __m128d a, __m128d b);

Converts lower exponent of float64 element in b to a float64 number representing the integer exponent, stores the result in lower destination element using writemask k (the element is copied from src when mask bit 0 is not set), and copies upper element from a to upper destination element. This intrinsic essentially calculates `floor(log2(x))` for lower element.

_mm_maskz_getexp_sd

    extern __m128d __cdecl _mm_maskz_getexp_sd(__mmask8 k, __m128d a, __m128d b);

Converts lower exponent of float64 element in b to a float64 number representing the integer exponent, stores the result in lower destination element using zeromask k (the element is zeroed out when mask bit 0 is not set), and copies upper element from a to upper destination element. This intrinsic essentially calculates `floor(log2(x))` for lower element.

_mm_getexp_round_ss

    extern __m128 __cdecl _mm_getexp_round_ss(__m128 a, __m128 b, int round);

Converts lower exponent of float32 element in b to a float32 number representing the integer exponent, stores the result in lower destination element, and copies upper three packed elements from a to upper destination elements. This intrinsic essentially calculates `floor(log2(x))` for lower element.

_mm_mask_getexp_round_ss

    extern __m128 __cdecl _mm_mask_getexp_round_ss(__m128 src, __mmask8 k, __m128 a, __m128 b, int round);

Converts lower exponent of float32 element in b to a float32 number representing the integer exponent, stores the result in lower destination element using writemask k (the element is copied from src when mask bit 0 is not set), and copies upper three packed elements from a to upper elements. This intrinsic essentially calculates `floor(log2(x))` for lower element.

_mm_maskz_getexp_round_ss

    extern __m128 __cdecl _mm_maskz_getexp_round_ss(__mmask8 k, __m128 a, __m128 b, int round);

Converts lower exponent of float32 element in b to a float32 number representing the integer exponent, stores the result in lower destination element using writemask k (the element is copied from src when mask bit 0 is not set), and copies upper three packed elements from a to upper elements. This intrinsic essentially calculates `floor(log2(x))` for lower element.

_mm_getexp_ss

    extern __m128 __cdecl _mm_getexp_ss(__m128 a, __m128 b);

Converts lower exponent of float32 element in b to a float32 number representing the integer exponent, stores the result in lower destination element, and copies upper three packed elements from a to upper destination elements. This intrinsic essentially calculates `floor(log2(x))` for lower element.

_mm_mask_getexp_ss

    extern __m128 __cdecl _mm_mask_getexp_ss(__m128 src, __mmask8 k, __m128 a, __m128b);

Converts lower exponent of float32 element in b to a float32 number representing the integer exponent, stores the result in lower destination element using writemask k (the element is copied from src when mask bit 0 is not set), and copies upper three packed elements from a to upper destination elements. This intrinsic essentially calculates `floor(log2(x))` for lower element.

_mm_maskz_getexp_ss

    extern __m128 __cdecl _mm_maskz_getexp_ss(__mmask8 k, __m128 a, __m128 b);

Converts lower exponent of float32 element in b to a float32 number representing the integer exponent, stores the result in lower destination element using zeromask k (the element is zeroed out when mask bit 0 is not set), and copies upper three packed elements from a to upper destination elements. This intrinsic essentially calculates `floor(log2(x))` for lower element.

Parent topic: Intrinsics for Miscellaneous Operations