public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Calls to auto-vectorized AVX512 functions
@ 2021-02-08  2:51 Naoki Shibata
  2021-02-08 10:42 ` Richard Biener
  0 siblings, 1 reply; 3+ messages in thread
From: Naoki Shibata @ 2021-02-08  2:51 UTC (permalink / raw)
  To: gcc


Hello,

I have a question as to the auto-vectorizer in GCC.

When AVX512 instruction is available, the auto-vectorizer in gcc 
sometimes generates calls to AVX2 functions instead of AVX512 functions.


$ cat vabitest.c
#include <stdio.h>
#include <math.h>

_Pragma ("omp declare simd simdlen(8) notinbranch") 
__attribute__((const)) double myfunc(double x);

#define N 1024
__attribute__ ((__aligned__(256))) double a[N], b[N], c[N];

int main(void) {
   for (int i = 0; i < N; i++) a[i] = myfunc(b[i]);
   for (int i = 0; i < N; i++) c[i] = sin(b[i]);
}

$ gcc-10 -ffast-math -O3 -mavx512f -fopenmp vabitest.c -S -o- | grep _ZGV
         call    _ZGVdN8v_myfunc@PLT
         call    _ZGVeN8v_sin@PLT


Is there a way to force gcc to generate calls to AVX512 function in 
cases like this?

Regards,

Naoki Shibata

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-08 10:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08  2:51 Calls to auto-vectorized AVX512 functions Naoki Shibata
2021-02-08 10:42 ` Richard Biener
2021-02-08 10:55   ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).