Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7830 Discussions

Castastropic error when compiling AVX512 intrinsic code

Jakob__Wenzel
Beginner
311 Views

Consider the following snippet:

#include <immintrin.h>

__m256i test() {
    return _mm512_cvtps_ph(_mm512_setzero_ps(), _MM_FROUND_CUR_DIRECTION);
}

Compiling yields:

$ icpc test.c
test.c(4): (col. 9) catastrophic error: Illegal value of immediate argument to intrinsic
compilation aborted for test.c (code 1)

The Intel intrinsic docs explicitly mention _MM_FROUND_CUR_DIRECTION as a legal argument, so I'm pretty sure this is a bug. Also, in comparison, the following code with AVX intrinsics works without problems:

#include <immintrin.h>

__m128i test() {
        return _mm256_cvtps_ph(_mm256_setzero_ps(), _MM_FROUND_CUR_DIRECTION);
}
0 Kudos
5 Replies
Melanie_B_Intel
Employee
311 Views

The only rounding modes currently supported for this intrinsic are:

round to nearest int, round to positive or negative infinity, round to zero

I've opened DPD200413418 in our internal bugs database to get clarification about the rounding mode parameter

Thanks for the report

 

0 Kudos
Melanie_B_Intel
Employee
311 Views

Yes this is to confirm your intrinsic usage is correct, we're working on a solution to the problem. Thanks again. --Melanie

0 Kudos
Jakob__Wenzel
Beginner
311 Views

A related question: is there any difference to the intrinsic 

__m256i _mm512_cvt_roundps_ph (__m512 aint rounding)

which has exactly the same signature? For reference:

__m256i _mm512_cvtps_ph (__m512 aint rounding)

0 Kudos
Melanie_B_Intel
Employee
311 Views

No, it is identical intrinsics: 

zmmintrin.h : 
.... 
#define _mm512_cvtps_ph(v1, a) \ 
        _mm512_cvt_roundps_ph((v1), (a)) 
 

0 Kudos
Melanie_B_Intel
Employee
311 Views

PS there's an interactive intrinsics guide here: https://software.intel.com/sites/landingpage/IntrinsicsGuide/

0 Kudos
Reply