aio: Remove support for BROKEN_THREAD_SIGNALS
[glibc.git] / sysdeps / i386 / fpu / e_exp10f.S
blob1812b34398fa4d48e51ef059c5348f455514407c
1 /*
2  * Written by Ulrich Drepper.
3  */
5 #include <machine/asm.h>
6 #include <i386-math-asm.h>
8 DEFINE_FLT_MIN
10 #ifdef PIC
11 # define MO(op) op##@GOTOFF(%ecx)
12 #else
13 # define MO(op) op
14 #endif
16         .text
17 /* 10^x = 2^(x * log2(10)) */
18 ENTRY(__ieee754_exp10f)
19 #ifdef  PIC
20         LOAD_PIC_REG (cx)
21 #endif
22         flds    4(%esp)
23 /* I added the following ugly construct because exp(+-Inf) resulted
24    in NaN.  The ugliness results from the bright minds at Intel.
25    For the i686 the code can be written better.
26    -- drepper@cygnus.com.  */
27         fxam                            /* Is NaN or +-Inf?  */
28         fstsw   %ax
29         movb    $0x45, %dh
30         andb    %ah, %dh
31         cmpb    $0x05, %dh
32         je      1f                      /* Is +-Inf, jump.  */
33         fldl2t
34         fmulp                           /* x * log2(10) */
35         fld     %st
36         frndint                         /* int(x * log2(10)) */
37         fsubr   %st,%st(1)              /* fract(x * log2(10)) */
38         fxch
39         f2xm1                           /* 2^(fract(x * log2(10))) - 1 */
40         fld1
41         faddp                           /* 2^(fract(x * log2(10))) */
42         fscale                          /* e^x */
43         fstp    %st(1)
44         FLT_NARROW_EVAL_UFLOW_NONNEG_NAN
45         ret
47 1:      testl   $0x200, %eax            /* Test sign.  */
48         jz      2f                      /* If positive, jump.  */
49         fstp    %st
50         fldz                            /* Set result to 0.  */
51 2:      ret
52 END (__ieee754_exp10f)
53 strong_alias (__ieee754_exp10f, __exp10f_finite)