Skip to main content

## _mm_mask_roundscale_sh

# Function _mm_mask_roundscale_sh

1.94.0 · Source

    pub fn _mm_mask_roundscale_sh(
        src: __m128h,
        k: __mmask8,
        a: __m128h,
        b: __m128h,
        const IMM8: i32,
    ) -> __m128h

Available on x86-64 and target feature `avx512fp16` only.
Expand description

Round the lower half-precision (16-bit) floating-point element in b to the number of fraction bits specified by imm8, store the result in the lower element of dst using writemask k (the element is copied from src when mask bit 0 is not set), and copy the upper 7 packed elements from a to the upper elements of dst.

Rounding is done according to the imm8 parameter, which can be one of:

- `_MM_FROUND_TO_NEAREST_INT` : round to nearest
- `_MM_FROUND_TO_NEG_INF` : round down
- `_MM_FROUND_TO_POS_INF` : round up
- `_MM_FROUND_TO_ZERO` : truncate
- `_MM_FROUND_CUR_DIRECTION` : use `MXCSR.RC` - see `_MM_SET_ROUNDING_MODE`

Intel’s documentation