[Bug target/85833] [AVX512] use mask registers instructions instead of scalar code

2018-05-22 Thread wojciech_mula at poczta dot onet.pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85833

--- Comment #3 from Wojciech Mula  ---
Uroš, thank you very much. I didn't pay attention on the AVX512 variant, as I
thought this is so basic instruction that it should be available from AVX512F.

[Bug target/85833] [AVX512] use mask registers instructions instead of scalar code

2018-05-21 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85833

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||jakub at gcc dot gnu.org
 Resolution|--- |DUPLICATE

--- Comment #2 from Jakub Jelinek  ---
And with -mavx512dq this is a dup of already fixed PR82855.

*** This bug has been marked as a duplicate of bug 82855 ***

[Bug target/85833] [AVX512] use mask registers instructions instead of scalar code

2018-05-18 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85833

--- Comment #1 from Uroš Bizjak  ---
(In reply to Wojciech Mula from comment #0)
> There is a simple function, which checks if there is any non-zero element
> in a vector:
> 
> ---ktest.c---
> #include 
> 
> int anynonzero_epi32(__m512i x) {
> const __m512i   zero = _mm512_setzero_si512();
> const __mmask16 mask = _mm512_cmpneq_epi32_mask(x, zero);
> return mask != 0;
> }
> ---eof---
> 
> $ gcc --version
> gcc (Debian 7.3.0-16) 7.3.0
> 
> $ gcc -O2 -S -mavx512f ktest.c && cat ktest.s

ktestw is AVX512DQ instruction.