| 1 |
/* PR tree-optimization/97503 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 4 |
/* { dg-additional-options "-mbmi -mlzcnt" { target i?86-*-* x86_64-*-* } } */ |
| 5 |
/* { dg-final { scan-tree-dump-times "\.CLZ" 2 "optimized" { target { { i?86-*-* x86_64-*-* aarch64-*-* powerpc*-*-* } && lp64 } } } } */ |
| 6 |
/* { dg-final { scan-tree-dump-not "__builtin_clz" "optimized" { target { { i?86-*-* x86_64-*-* aarch64-*-* powerpc*-*-*} && lp64 } } } } */ |
| 7 |
/* { dg-final { scan-tree-dump-not "PHI <" "optimized" { target { { i?86-*-* x86_64-*-* aarch64-*-* powerpc*-*-*} && lp64 } } } } */ |
| 8 |
|
| 9 |
int |
| 10 |
foo (int x) |
| 11 |
{ |
| 12 |
return x ? __builtin_clz (x) : 32; |
| 13 |
} |
| 14 |
|
| 15 |
int |
| 16 |
bar (unsigned long long x) |
| 17 |
{ |
| 18 |
return x ? __builtin_clzll (x) : 64; |
| 19 |
} |