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 */
6long double acosl (long double x);
7
8long double acosl (long double x)
9{
10 long double res = 0.0L;
11
12 /* acosl = atanl (sqrtl(1 - x^2) / x) */
13 asm volatile (
14 "fld %%st\n\t"
15 "fmul %%st(0)\n\t" /* x^2 */
16 "fld1\n\t"
17 "fsubp\n\t" /* 1 - x^2 */
18 "fsqrt\n\t" /* sqrtl (1 - x^2) */
19 "fxch %%st(1)\n\t"
20 "fpatan"
21 : "=t" (res) : "0" (x) : "st(1)");
22 return res;
23}