Print this page
5261 libm should stop using synonyms.h
5298 fabs is 0-sized, confuses dis(1) and others
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Gordon Ross <gwr@nexenta.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libm/i386/src/log.s
+++ new/usr/src/lib/libm/i386/src/log.s
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
↓ open down ↓ |
22 lines elided |
↑ open up ↑ |
23 23 */
24 24 /*
25 25 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
26 26 * Use is subject to license terms.
27 27 */
28 28
29 29 .file "log.s"
30 30
31 31 #include "libm.h"
32 32 LIBM_ANSI_PRAGMA_WEAK(log,function)
33 -#include "libm_synonyms.h"
34 33 #include "libm_protos.h"
35 34
36 35 ENTRY(log)
37 36 fldln2 / loge(2)
38 37 movl 8(%esp),%eax / eax <-- hi_32(x)
39 38 testl $0x80000000,%eax
40 39 jnz .maybe_0_or_less
41 40 testl $0x7fffffff,%eax
42 41 jz .maybe_0
43 42 fldl 4(%esp) / arg, loge(2)
44 43 fyl2x / loge(2)*log2(arg); ln(arg)
45 44 ret
46 45
47 46 .maybe_0:
48 47 movl 4(%esp),%ecx / ecx <-- lo_32(x)
49 48 cmpl $0,%ecx
50 49 je .zero / no branch if x is +denormal
51 50 .neg_nan_reentry:
52 51 fldl 4(%esp) / arg, loge(2)
53 52 fyl2x / loge(2)*log2(arg); ln(arg)
54 53 ret
55 54
56 55 .zero_or_less:
57 56 / x =< 0
58 57 testl $0x7fffffff,%eax
59 58 jnz .less_than_0
60 59 movl 4(%esp),%ecx / ecx <-- lo_32(x)
61 60 cmpl $0,%ecx
62 61 jne .less_than_0 / branch if x is -denormal
63 62 .zero:
64 63 / x = +/-0
65 64 pushl %ebp
66 65 movl %esp,%ebp
67 66 PIC_SETUP(1)
68 67 pushl $16
69 68 jmp .merge
70 69
71 70 .maybe_0_or_less:
72 71 cmpl $0xfff00000,%eax / -INF below hi_32(x)?
73 72 ja .neg_nan_reentry
74 73 jb .zero_or_less
75 74 movl 4(%esp),%ecx / ecx <-- lo_32(x)
76 75 cmpl $0,%ecx / is x NaN or -INF?
77 76 jne .neg_nan_reentry / branch if x is NaN with signbit = 1
78 77 / x = -INF
79 78 .less_than_0:
80 79 pushl %ebp
81 80 movl %esp,%ebp
82 81 PIC_SETUP(2)
83 82 pushl $17
84 83 .merge:
85 84 fstp %st(0) / stack empty
86 85 pushl 12(%ebp)
87 86 pushl 8(%ebp)
88 87 pushl 12(%ebp)
89 88 pushl 8(%ebp)
90 89 call PIC_F(_SVID_libm_err)
91 90 addl $20,%esp
92 91 PIC_WRAPUP
93 92 leave
94 93 ret
95 94 .align 4
96 95 SET_SIZE(log)
↓ open down ↓ |
53 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX