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
drd/tests/Makefile.am: Use -faligned-new for C++ code if supported
[valgrind.git]
/
VEX
/
test
/
x87tst.c
blob
d079477359488018ee63151333dd02a0261ef398
1
2
#include <stdio.h>
3
#include <math.h>
4
5
double
d
;
6
int
i
;
7
8
extern
void
do_tst
(
void
);
9
10
asm
(
11
"
\n
"
12
"do_tst:
\n
"
13
"
\t
xorl %eax,%eax
\n
"
14
"
\t
fld d
\n
"
15
"
\t
ftst
\n
"
16
"
\t
fnstsw %ax
\n
"
17
"
\t
movl %eax, i
\n
"
18
"
\t
ret
\n
"
19
);
20
21
int
main
(
void
)
22
{
23
d
= -
1.23
;
do_tst
();
printf
(
"%f -> 0x%x
\n
"
,
d
,
i
);
24
d
=
0.0
;
do_tst
();
printf
(
"%f -> 0x%x
\n
"
,
d
,
i
);
25
d
=
9.87
;
do_tst
();
printf
(
"%f -> 0x%x
\n
"
,
d
,
i
);
26
return
0
;
27
}