master
1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6
7void sincosl (long double __x, long double *p_sin, long double *p_cos);
8
9void sincosl (long double __x, long double *p_sin, long double *p_cos)
10{
11 long double c, s;
12
13 __asm__ __volatile__ ("fsincos\n\t"
14 "fnstsw %%ax\n\t"
15 "testl $0x400, %%eax\n\t"
16 "jz 1f\n\t"
17 "fldpi\n\t"
18 "fadd %%st(0)\n\t"
19 "fxch %%st(1)\n\t"
20 "2: fprem1\n\t"
21 "fnstsw %%ax\n\t"
22 "testl $0x400, %%eax\n\t"
23 "jnz 2b\n\t"
24 "fstp %%st(1)\n\t"
25 "fsincos\n\t"
26 "1:" : "=t" (c), "=u" (s) : "0" (__x) : "eax");
27 *p_sin = s;
28 *p_cos = c;
29}