1 /* Test double on x86. */
3 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
4 /* { dg-options -O2 } */
6 extern void abort (void);
9 mypow (double __x
, double __y
)
11 register double __value
, __exponent
;
12 long __p
= (long) __y
;
13 if (__y
== (double) __p
)
34 ("fmul %%st(1),%%st\n\t" /* y * log2(x) */
36 "frndint\n\t" /* int(y * log2(x)) */
38 "fsub %%st(1),%%st\n\t" /* fract(y * log2(x)) */
39 "f2xm1\n\t" /* 2^(fract(y * log2(x))) - 1 */
40 : "=t" (__value
), "=u" (__exponent
) : "0" (__x
), "1" (__y
));
44 : "=t" (__value
) : "0" (__value
), "u" (__exponent
));
48 const double E1
= 2.71828182845904523536028747135;
50 double fact (double x
)
54 return corr
* mypow(x
/E1
, x
);
62 z
= mypow (46.2/E1
, 46.2);
65 printf ("%26.19e, %26.19e\n", y
, z
);