none/tests/fdleak_cmsg_supp.supp: Add suppressions for older glibc
[valgrind.git] / none / tests / amd64 / fxtract.c
blobf4dfd36dfd035f60c58def857d2274a091205c56
2 #include <stdio.h>
3 #include <math.h>
5 double arg, res1, res2;
7 extern void do_fxtract ( void );
8 asm("\n"
9 ".text\n"
10 ".global do_fxtract\n"
11 "do_fxtract:\n"
12 "\tfinit\n"
13 "\tfldl arg\n"
14 "\tfxtract\n"
15 "\tfstpl res1\n"
16 "\tfstpl res2\n"
17 "\tret\n"
18 ".previous\n"
21 void try ( double x )
23 arg = x * 1.414213562373049;
24 res1 = res2 = 0.0;
25 do_fxtract();
26 printf("%17.10e -> %14.10f %14.10f\n", arg, res1, res2);
29 int main ( void )
31 int i;
33 /* positives */
35 for (i = 0; i < 40; i++)
36 try( 1.27 + (double)(i*10 - 200) );
38 try(+0.0);
39 try(1.0 / 0.0);
40 try(sqrt(-1.0));
42 try(5.1e-308);
43 try(4.1e-308);
44 try(3.1e-308);
45 try(2.1e-308);
46 try(1.1e-308);
47 try(0.9e-308);
48 try(0.7e-308);
49 try(0.6e-308);
50 try(0.5e-308);
51 try(0.4e-308);
52 try(0.3e-308);
53 try(0.1e-308);
55 try(1.3e-320);
56 try(1.3e-321);
57 try(1.3e-322);
58 try(1.3e-323);
59 try(0.9e-323);
60 try(0.7e-323);
61 try(0.5e-323);
62 try(0.3e-323);
63 try(0.2e-323);
64 try(1.3e-324);
66 /* negatives */
68 printf("\n");
69 for (i = 0; i < 40; i++)
70 try( - (1.27 + (double)(i*10 - 200)) );
72 try(-0.0);
73 try(-(1.0 / 0.0));
74 try(-sqrt(-1.0));
76 try(-5.1e-308);
77 try(-4.1e-308);
78 try(-3.1e-308);
79 try(-2.1e-308);
80 try(-1.1e-308);
81 try(-0.9e-308);
82 try(-0.7e-308);
83 try(-0.6e-308);
84 try(-0.5e-308);
85 try(-0.4e-308);
86 try(-0.3e-308);
87 try(-0.1e-308);
89 try(-1.3e-320);
90 try(-1.3e-321);
91 try(-1.3e-322);
92 try(-1.3e-323);
93 try(-0.9e-323);
94 try(-0.7e-323);
95 try(-0.5e-323);
96 try(-0.3e-323);
97 try(-0.2e-323);
98 try(-1.3e-324);
100 return 0;