| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-mavx512f -O2 -ftree-vectorize -mno-avx512dq -dp -mprefer-vector-width=512" } */ |
| 3 |
/* { dg-final { scan-assembler-times {cvtmask2.*_pternlog} "1" } } */ |
| 4 |
/* { dg-final { scan-assembler-times {constm1_pternlog} "1" } } */ |
| 5 |
/* { dg-final { scan-assembler-not {(?n)vpternlogd.*\(} } } */ |
| 6 |
|
| 7 |
|
| 8 |
#include <immintrin.h> |
| 9 |
|
| 10 |
__m512i g(void) |
| 11 |
{ |
| 12 |
return (__m512i){ 0 } - 1; |
| 13 |
} |
| 14 |
|
| 15 |
__m512i g1(__m512i* a) |
| 16 |
{ |
| 17 |
return ~(*a); |
| 18 |
} |
| 19 |
|
| 20 |
void |
| 21 |
foo (int* a, int* __restrict b) |
| 22 |
{ |
| 23 |
for (int i = 0; i != 16; i++) |
| 24 |
{ |
| 25 |
if (b[i]) |
| 26 |
a[i] = -1; |
| 27 |
else |
| 28 |
a[i] = 0; |
| 29 |
} |
| 30 |
} |