Processors (Intel® Core™, Intel® Xeon®, etc); processor utilities and programs (Intel® Processor Identification Utility, Intel® Extreme Tuning Utility, Intel® Easy Streaming Wizard, etc.)
12177 Discussions

Can I use __mmask8 in intrinsic functions without AVX512DQ?


Some AVX512F intrinsic functions use __mmask8 masks, but 8-bit mask instructions like KMOVB and KANDB require AVX512DQ. How can I make sure the compiler uses 16-bit mask instructions (KMOVW, KANDW) and not 8-bit mask instructions when I have AVX512F but not AVX512DQ? I am writing generic code and I want to make sure the code works correctly in all compilers. For example:

__mmask8 a, b, c; __m512i x, y, z; ... a = b & c; // use KANDW, not KANDB z = _mm512_mask_mov_epi64(x, a, y);

Or should I write:

__mmask16 a, b, c; __m512i x, y, z; ... a = b & c; // use KANDW, not KANDB z = _mm512_mask_mov_epi64(x, (__mmask8)a, y);






0 Kudos
1 Reply
Super User Retired Employee

Sorry, this is a technical support forum for Intel processors. You need to repost your query in the Intel Developer Zone. Here is link to their forum: Intel Developer Zone forum. Unfortunately, I don't have the privileges that would allow me to move this query for you.