13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
23 */
24 /*
25 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 .file "exp.s"
30
31 #include "libm.h"
32 LIBM_ANSI_PRAGMA_WEAK(exp,function)
33 #include "libm_synonyms.h"
34 #include "libm_protos.h"
35
36 ENTRY(exp)
37 movl 8(%esp),%ecx / ecx <-- hi_32(x)
38 andl $0x7fffffff,%ecx / ecx <-- hi_32(|x|)
39 cmpl $0x3fe62e42,%ecx / Is |x| < ln(2)?
40 jb .shortcut / If so, take a shortcut.
41 je .check_tail / |x| may be only slightly < ln(2)
42 cmpl $0x7ff00000,%ecx / hi_32(|x|) >= hi_32(INF)?
43 jae .not_finite / if so, x is not finite
44 .finite_non_special: / Here, ln(2) < |x| < INF
45 fldl 4(%esp) / push x
46 subl $8,%esp
47 /// overhead of RP save/restore; 63/15
48 fstcw (%esp) /// ; 15/3
49 movw (%esp),%ax /// ; 4/1
50 movw %ax,4(%esp) /// save old RP; 2/1
51 orw $0x0300,%ax /// force 64-bit RP; 2/1
52 movw %ax,(%esp) /// ; 2/1
53 fldcw (%esp) /// ; 19/4
|
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
23 */
24 /*
25 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 .file "exp.s"
30
31 #include "libm.h"
32 LIBM_ANSI_PRAGMA_WEAK(exp,function)
33 #include "libm_protos.h"
34
35 ENTRY(exp)
36 movl 8(%esp),%ecx / ecx <-- hi_32(x)
37 andl $0x7fffffff,%ecx / ecx <-- hi_32(|x|)
38 cmpl $0x3fe62e42,%ecx / Is |x| < ln(2)?
39 jb .shortcut / If so, take a shortcut.
40 je .check_tail / |x| may be only slightly < ln(2)
41 cmpl $0x7ff00000,%ecx / hi_32(|x|) >= hi_32(INF)?
42 jae .not_finite / if so, x is not finite
43 .finite_non_special: / Here, ln(2) < |x| < INF
44 fldl 4(%esp) / push x
45 subl $8,%esp
46 /// overhead of RP save/restore; 63/15
47 fstcw (%esp) /// ; 15/3
48 movw (%esp),%ax /// ; 4/1
49 movw %ax,4(%esp) /// save old RP; 2/1
50 orw $0x0300,%ax /// force 64-bit RP; 2/1
51 movw %ax,(%esp) /// ; 2/1
52 fldcw (%esp) /// ; 19/4
|