blob: d079477359488018ee63151333dd02a0261ef398 [file] [log] [blame]
sewardjbbb79142005-03-19 14:25:49 +00001
2#include <stdio.h>
3#include <math.h>
4
5double d;
6int i;
7
8extern void do_tst ( void );
9
10asm(
11"\n"
12"do_tst:\n"
13"\txorl %eax,%eax\n"
14"\tfld d\n"
15"\tftst\n"
16"\tfnstsw %ax\n"
17"\tmovl %eax, i\n"
18"\tret\n"
19);
20
21int 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}