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-check.h
blob
8fad38ad0727749499c362357043d3b1ccb7878b
1
#include <stdio.h>
2
#include <stdlib.h>
3
4
#include
"cpuid.h"
5
6
static void
bmi_test
(
void
);
7
8
static void
9
__attribute__
((
noinline
))
10
do_test
(
void
)
11
{
12
bmi_test
();
13
}
14
15
int
16
main
()
17
{
18
unsigned int
eax
,
ebx
,
ecx
,
edx
;
19
20
if
(
__get_cpuid_max
(
0
,
NULL
) <
7
)
21
return
0
;
22
23
__cpuid_count
(
7
,
0
,
eax
,
ebx
,
ecx
,
edx
);
24
25
/* Run BMI test only if host has BMI support. */
26
if
(
ebx
&
bit_BMI
)
27
{
28
do_test
();
29
#ifdef DEBUG
30
printf
(
"PASSED
\n
"
);
31
#endif
32
}
33
#ifdef DEBUG
34
else
35
printf
(
"SKIPPED
\n
"
);
36
#endif
37
38
return
0
;
39
}