| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -march=core-avx2" } */ |
| 3 |
/* { dg-additional-options "-mregparm=1" { target ia32 } } */ |
| 4 |
/* { dg-final { scan-assembler-not "popcnt" } } */ |
| 5 |
/* { dg-final { scan-assembler-not "shr" } } */ |
| 6 |
/* { dg-final { scan-assembler-times "jp" 2 } } */ |
| 7 |
/* { dg-final { scan-assembler-times "jnp" 2 } } */ |
| 8 |
|
| 9 |
void dummy(void); |
| 10 |
|
| 11 |
void pos8(unsigned char x) |
| 12 |
{ |
| 13 |
if (__builtin_parity(x)) |
| 14 |
dummy(); |
| 15 |
} |
| 16 |
|
| 17 |
void neg8(unsigned char x) |
| 18 |
{ |
| 19 |
if (!__builtin_parity(x)) |
| 20 |
dummy(); |
| 21 |
} |
| 22 |
|
| 23 |
void pos16(unsigned short x) |
| 24 |
{ |
| 25 |
if (__builtin_parity(x)) |
| 26 |
dummy(); |
| 27 |
} |
| 28 |
|
| 29 |
void neg16(unsigned short x) |
| 30 |
{ |
| 31 |
if (!__builtin_parity(x)) |
| 32 |
dummy(); |
| 33 |
} |