Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 3/31/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Intrinsics for Set 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>


variable definition
src

source element to use based on writemask result

k

writemask used as a selector

a

first source vector element


_mm_mask_set1_epi8

__m128i _mm_mask_set1_epi8(__m128i src, __mmask16 k, char a)

CPUID Flags: AVX512BW, AVX512VL

Instruction(s): vpbroadcastb

Broadcast 8-bit integer a to all elements of the return value using writemask k (elements are copied from src when the corresponding mask bit is not set).



_mm_maskz_set1_epi8

__m128i _mm_maskz_set1_epi8(__mmask16 k, char a)

CPUID Flags: AVX512BW, AVX512VL

Instruction(s): vpbroadcastb

Broadcast 8-bit integer a to all elements of the return value using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm256_mask_set1_epi8

__m256i _mm256_mask_set1_epi8(__m256i src, __mmask32 k, char a)

CPUID Flags: AVX512BW, AVX512VL

Instruction(s): vpbroadcastb

Broadcast 8-bit integer a to all elements of the return value using writemask k (elements are copied from src when the corresponding mask bit is not set).



_mm256_maskz_set1_epi8

__m256i _mm256_maskz_set1_epi8(__mmask32 k, char a)

CPUID Flags: AVX512BW, AVX512VL

Instruction(s): vpbroadcastb

Broadcast 8-bit integer a to all elements of the return value using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_mask_set1_epi8

__m512i _mm512_mask_set1_epi8(__m512i src, __mmask64 k, char a)

CPUID Flags: AVX512BW

Instruction(s): vpbroadcastb

Broadcast 8-bit integer a to all elements of the return value using writemask k (elements are copied from src when the corresponding mask bit is not set).



_mm512_maskz_set1_epi8

__m512i _mm512_maskz_set1_epi8(__mmask64 k, char a)

CPUID Flags: AVX512BW

Instruction(s): vpbroadcastb

Broadcast 8-bit integer a to all elements of the return value using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm_mask_set1_epi32

__m128i _mm_mask_set1_epi32(__m128i src, __mmask8 k, int a)

CPUID Flags: AVX512F, AVX512VL

Instruction(s): vpbroadcastd

Broadcast 32-bit integer a to all elements of the return value using writemask k (elements are copied from src when the corresponding mask bit is not set).



_mm_maskz_set1_epi32

__m128i _mm_maskz_set1_epi32(__mmask8 k, int a)

CPUID Flags: AVX512F, AVX512VL

Instruction(s): vpbroadcastd

Broadcast 32-bit integer a to all elements of the return value using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm256_mask_set1_epi32

__m256i _mm256_mask_set1_epi32(__m256i src, __mmask8 k, int a)

CPUID Flags: AVX512F, AVX512VL

Instruction(s): vpbroadcastd

Broadcast 32-bit integer a to all elements of the return value using writemask k (elements are copied from src when the corresponding mask bit is not set).



_mm256_maskz_set1_epi32

__m256i _mm256_maskz_set1_epi32(__mmask8 k, int a)

CPUID Flags: AVX512F, AVX512VL

Instruction(s): vpbroadcastd

Broadcast 32-bit integer a to all elements of the return value using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm_mask_set1_epi64

__m128i _mm_mask_set1_epi64(__m128i src, __mmask8 k, __int64 a)

CPUID Flags: AVX512F, AVX512VL

Instruction(s): vpbroadcastq

Broadcast 64-bit integer a to all elements of the return value using writemask k (elements are copied from src when the corresponding mask bit is not set).



_mm_maskz_set1_epi64

__m128i _mm_maskz_set1_epi64(__mmask8 k, __int64 a)

CPUID Flags: AVX512F, AVX512VL

Instruction(s): vpbroadcastq

Broadcast 64-bit integer a to all elements of the return value using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm256_mask_set1_epi64

__m256i _mm256_mask_set1_epi64(__m256i src, __mmask8 k, __int64 a)

CPUID Flags: AVX512F, AVX512VL

Instruction(s): vpbroadcastq

Broadcast 64-bit integer a to all elements of the return value using writemask k (elements are copied from src when the corresponding mask bit is not set).



_mm256_maskz_set1_epi64

__m256i _mm256_maskz_set1_epi64(__mmask8 k, __int64 a)

CPUID Flags: AVX512F, AVX512VL

Instruction(s): vpbroadcastq

Broadcast 64-bit integer a to all elements of the return value using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm_mask_set1_epi16

__m128i _mm_mask_set1_epi16(__m128i src, __mmask8 k, short a)

CPUID Flags: AVX512BW, AVX512VL

Instruction(s): vpbroadcastw

Broadcast the low packed 16-bit integer from a to all elements of the return value using writemask k (elements are copied from src when the corresponding mask bit is not set).



_mm_maskz_set1_epi16

__m128i _mm_maskz_set1_epi16(__mmask8 k, short a)

CPUID Flags: AVX512BW, AVX512VL

Instruction(s): vpbroadcastw

Broadcast the low packed 16-bit integer from a to all elements of the return value using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm256_mask_set1_epi16

__m256i _mm256_mask_set1_epi16(__m256i src, __mmask16 k, short a)

CPUID Flags: AVX512BW, AVX512VL

Instruction(s): vpbroadcastw

Broadcast the low packed 16-bit integer from a to all elements of the return value using writemask k (elements are copied from src when the corresponding mask bit is not set).



_mm256_maskz_set1_epi16

__m256i _mm256_maskz_set1_epi16(__mmask16 k, short a)

CPUID Flags: AVX512BW, AVX512VL

Instruction(s): vpbroadcastw

Broadcast the low packed 16-bit integer from a to all elements of the return value using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_mask_set1_epi16

__m512i _mm512_mask_set1_epi16(__m512i src, __mmask32 k, short a)

CPUID Flags: AVX512BW

Instruction(s): vpbroadcastw

Broadcast the low packed 16-bit integer from a to all elements of the return value using writemask k (elements are copied from src when the corresponding mask bit is not set).



_mm512_maskz_set1_epi16

__m512i _mm512_maskz_set1_epi16(__mmask32 k, short a)

CPUID Flags: AVX512BW

Instruction(s): vpbroadcastw

Broadcast the low packed 16-bit integer from a to all elements of the return value using zeromask k (elements are zeroed out when the corresponding mask bit is not set).