Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Jakob__Wenzel
Beginner
103 Views

Castastropic error when compiling AVX512 intrinsic code

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
103 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

 

Melanie_B_Intel
Employee
103 Views

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

Jakob__Wenzel
Beginner
103 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)

Melanie_B_Intel
Employee
103 Views

No, it is identical intrinsics: 

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

Melanie_B_Intel
Employee
103 Views

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

Reply