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