1 /* Test that we can remove the conditional move due to CLZ
2 and CTZ being defined at zero. */
4 /* { dg-do compile } */
5 /* { dg-options "-O2" } */
10 return (i
== 0) ? 32 : __builtin_ctz (i
);
16 return (i
!= 0) ? __builtin_ctz (i
) : 32;
20 fooctz3 (unsigned int i
)
22 return (i
> 0) ? __builtin_ctz (i
) : 32;
25 /* { dg-final { scan-assembler-times "rbit\t*" 3 } } */
30 return (i
== 0) ? 32 : __builtin_clz (i
);
36 return (i
!= 0) ? __builtin_clz (i
) : 32;
40 fooclz3 (unsigned int i
)
42 return (i
> 0) ? __builtin_clz (i
) : 32;
45 /* { dg-final { scan-assembler-times "clz\t" 6 } } */
46 /* { dg-final { scan-assembler-not "cmp\t.*0" } } */