repo.or.cz
/
valgrind.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
regtest: broaden none/tests/linux/bug498317 suppression for PPC
[valgrind.git]
/
none
/
tests
/
amd64
/
clc.c
blob
fc3d1d885da15db4e7c7abaaa39f4ab06f345047
1
2
#include <stdio.h>
3
4
typedef
unsigned long long int
ULong
;
5
6
ULong
do_clc
(
void
)
7
{
8
ULong res
;
9
__asm__
__volatile__
(
10
"pushq $0x8d5
\n\t
"
/* OSZACP */
11
"popfq
\n\t
"
12
"clc
\n\t
"
13
"pushfq
\n\t
"
14
"popq %0"
15
:
"=r"
(
res
)
16
:
17
:
"memory"
,
"cc"
18
);
19
return
res
;
20
}
21
22
ULong
do_stc
(
void
)
23
{
24
ULong res
;
25
__asm__
__volatile__
(
26
"pushq $0x0
\n\t
"
27
"popfq
\n\t
"
28
"stc
\n\t
"
29
"pushfq
\n\t
"
30
"popq %0"
31
:
"=r"
(
res
)
32
:
33
:
"memory"
,
"cc"
34
);
35
return
res
;
36
}
37
38
ULong
do_cmc
(
void
)
39
{
40
ULong res
;
41
__asm__
__volatile__
(
42
"pushq $0x0
\n\t
"
43
"popfq
\n\t
"
44
"stc
\n\t
"
45
"cmc
\n\t
"
46
"pushfq
\n\t
"
47
"popq %0"
48
:
"=r"
(
res
)
49
:
50
:
"memory"
,
"cc"
51
);
52
return
res
;
53
}
54
55
int
main
(
void
)
56
{
57
printf
(
"clc: 0x%016llx
\n
"
,
0x8d5
&
do_clc
());
58
printf
(
"stc: 0x%016llx
\n
"
,
0x8d5
&
do_stc
());
59
printf
(
"cmc: 0x%016llx
\n
"
,
0x8d5
&
do_cmc
());
60
return
0
;
61
}