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 "expl.s"
30
31 #include "libm.h"
32 LIBM_ANSI_PRAGMA_WEAK(expl,function)
33 #include "libm_synonyms.h"
34
35 .data
36 .align 4
37 ln2_hi: .long 0xd1d00000, 0xb17217f7, 0x00003ffe
38 ln2_lo: .long 0x4c67fc0d, 0x8654361c, 0x0000bfce
39
40 ENTRY(expl)
41 movl 12(%esp),%ecx / cx <--sign&bexp(x)
42 andl $0x7fff,%ecx / ecx <-- zero_xtnd(bexp(x))
43 cmpl $0x3ffe,%ecx / Is |x| < 0.5?
44 jb 2f / If so, see which shortcut to take
45 je .check_tail / More checking if 0.5 <= |x| < 1
46 cmpl $0x00007fff,%ecx / bexp(|x|) = bexp(INF)?
47 je .not_finite / if so, x is not finite
48 cmpl $0x0000400e,%ecx / |x| < 32768 = 2^15?
49 jb .finite_non_special / if so, proceed with argument reduction
50 fldt 4(%esp) / x
51 fld1 / 1, x
52 jmp 1f
53 .finite_non_special: / Here, ln(2) < |x| < 2^15
|
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 "expl.s"
30
31 #include "libm.h"
32 LIBM_ANSI_PRAGMA_WEAK(expl,function)
33
34 .data
35 .align 4
36 ln2_hi: .long 0xd1d00000, 0xb17217f7, 0x00003ffe
37 ln2_lo: .long 0x4c67fc0d, 0x8654361c, 0x0000bfce
38
39 ENTRY(expl)
40 movl 12(%esp),%ecx / cx <--sign&bexp(x)
41 andl $0x7fff,%ecx / ecx <-- zero_xtnd(bexp(x))
42 cmpl $0x3ffe,%ecx / Is |x| < 0.5?
43 jb 2f / If so, see which shortcut to take
44 je .check_tail / More checking if 0.5 <= |x| < 1
45 cmpl $0x00007fff,%ecx / bexp(|x|) = bexp(INF)?
46 je .not_finite / if so, x is not finite
47 cmpl $0x0000400e,%ecx / |x| < 32768 = 2^15?
48 jb .finite_non_special / if so, proceed with argument reduction
49 fldt 4(%esp) / x
50 fld1 / 1, x
51 jmp 1f
52 .finite_non_special: / Here, ln(2) < |x| < 2^15
|