repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Stop only if there aren't any usable algorithms
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.target
/
i386
/
bmi-blsr-2.c
blob
b3fc4e5e9620d72c6280fb8ae3c9ebaeca4c76ed
1
/* { dg-do run { target { bmi } } } */
2
/* { dg-options "-O2 -mbmi -fno-inline" } */
3
4
#include <x86intrin.h>
5
6
#include
"bmi-check.h"
7
8
int
calc_blsr_u32
(
int
src1
,
int
src2
)
9
{
10
return
(
src1
-
1
) & (
src2
);
11
}
12
13
static void
14
bmi_test
()
15
{
16
unsigned
i
;
17
int
src
=
0xfacec0ff
;
18
int
res
,
res_ref
;
19
20
for
(
i
=
0
;
i
<
5
; ++
i
) {
21
src
=
i
+
src
<<
i
;
22
23
res_ref
=
calc_blsr_u32
(
src
,
src
);
24
res
=
__blsr_u32
(
src
);
25
26
if
(
res
!=
res_ref
)
27
abort
();
28
}
29
}