Add missing zstd.h to coregrind Makefile.am noinst_HEADERS
[valgrind.git] / memcheck / tests / x86 / fprem.c
blobc6cd74808e46d349faabf7c0c19dd62cd68b7f72
2 /* Marginally test fprem/fprem1/fsincos; these are hard to check
3 otherwise since compilers hardly ever generate them. */
5 #include <stdio.h>
7 double do_fprem ( void )
9 double res = 0.0;
10 __asm__ __volatile__(
11 "ffree %%st(0)\n\t"
12 "ffree %%st(1)\n\t"
13 "fldpi\n\t"
14 "fldln2\n\t"
15 "fprem\n\t"
16 "fstpl 0(%0)"
17 : : "r"(&res)
19 return res;
22 double do_fprem1 ( void )
24 double res = 0.0;
25 __asm__ __volatile__(
26 "ffree %%st(0)\n\t"
27 "ffree %%st(1)\n\t"
28 "fldpi\n\t"
29 "fldln2\n\t"
30 "fprem1\n\t"
31 "fstpl 0(%0)"
32 : : "r"(&res)
34 return res;
37 double do_fsincos ( void )
39 double res = 0.0;
40 __asm__ __volatile__(
41 "fldln2\n\t"
42 "fsincos\n\t"
43 "fsub %%st(1)\n\t"
44 "fstpl 0(%0)"
45 : : "r"(&res)
47 return res;
50 int main ( void )
52 __asm__ __volatile__("finit");
53 printf("fprem %f\n", do_fprem());
54 printf("fprem1 %f\n", do_fprem1());
55 printf("fsincos %f\n", do_fsincos());
56 return 0;