| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -march=znver5" } */ |
| 3 |
void bar (); |
| 4 |
int |
| 5 |
test(int a) |
| 6 |
{ |
| 7 |
return a & (a - 1); |
| 8 |
} |
| 9 |
int |
| 10 |
test2(int a) |
| 11 |
{ |
| 12 |
if (a & (a - 1)) |
| 13 |
bar (); |
| 14 |
} |
| 15 |
int |
| 16 |
test3(int a) |
| 17 |
{ |
| 18 |
int ret = a & (a - 1); |
| 19 |
if (ret) |
| 20 |
bar (); |
| 21 |
return ret; |
| 22 |
} |
| 23 |
/* All three functions should produce bslr. |
| 24 |
Only test and test3 needs xor to break false dependency. */ |
| 25 |
/* { dg-final { scan-assembler-times "blsr\[ \\t\]+" 3 } } */ |
| 26 |
/* { dg-final { scan-assembler-times "xor" 2 } } */ |