intrinsic

Gabriele Capannini gabriele.capannini@gmail.com
Thu Apr 2 17:59:28 GMT 2020


Hi! I'm implementing a program which makes use of the AVX atan function:

#include <immintrin.h>
int main()
{
__m256 x = _mm256_set_ps(1, 1, 0, -1, -1, -1, 0, 1);
__m256 y = _mm256_set_ps(0, -1, -1, -1, 0, 1, 1, 1);
__m256 r = _mm256_atan_ps(_mm256_div_ps(y,x));
return 0;
}

but when I try to compile I get this error:

$ g++ -march=native -mtune=native foo.cpp -o /tmp/bb46761d15/foo &&
/tmp/bb46761d15/foo
foo.cpp: In function ‘int main()’:
foo.cpp:32:13: error: ‘_mm256_atan_ps’ was not declared in this scope
  __m256 r = _mm256_atan_ps(_mm256_div_ps(y,x));
             ^~~~~~~~~~~~~~
foo.cpp:32:13: note: suggested alternative: ‘_mm256_load_ps’
  __m256 r = _mm256_atan_ps(_mm256_div_ps(y,x));
             ^~~~~~~~~~~~~~
             _mm256_load_ps

Do you have any hint or workaround for this?

Regards, Gabriele



More information about the Gcc-help mailing list