blob: ee68a9d42c3d0782257236713070606df69ab4a6 (
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;
}
int
test2(int a)
{
if (a & -a)
bar ();
}
int
test3(int a)
{
int ret = a & -a;
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 "blsi\[ \\t\]+" 3 } } */
/* { dg-final { scan-assembler-times "xor" 2 } } */
|