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/ieee_funcl.s
+++ new/usr/src/lib/libm/i386/src/ieee_funcl.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 /*
↓ open down ↓ |
21 lines elided |
↑ open up ↑ |
22 22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
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 "ieee_funcl.s"
30 30
31 31 #include "libm.h"
32 -LIBM_ANSI_PRAGMA_WEAK(isinfl,function)
33 -LIBM_ANSI_PRAGMA_WEAK(isnormall,function)
34 -LIBM_ANSI_PRAGMA_WEAK(issubnormall,function)
35 -LIBM_ANSI_PRAGMA_WEAK(iszerol,function)
36 -LIBM_ANSI_PRAGMA_WEAK(signbitl,function)
37 -#include "libm_synonyms.h"
38 32
39 33 ENTRY(isinfl)
40 34 movl 12(%esp),%eax / ax <-- sign and bexp of x
41 35 notl %eax
42 36 andl $0x00007fff,%eax
43 37 jz .L6
44 38 movl $0,%eax
45 39 .not_inf:
46 40 ret
47 41
48 42 .L6: / here, (eax) = 0.0
49 43 movl 8(%esp),%ecx
50 44 xorl $0x80000000,%ecx / handle unsupported implicitly
51 45 orl 4(%esp), %ecx
52 46 jnz .not_inf
53 47 movl $1,%eax
54 48 ret
55 49 .align 4
56 50 SET_SIZE(isinfl)
57 51
58 52 ENTRY(isnormall)
59 53 / TRUE iff (x is finite, but
60 54 / neither subnormal nor zero)
61 55 / iff (msb(sgnfcnd(x) /= 0
62 56 / & 0 < bexp(x) < 0x7fff)
63 57 movl 8(%esp),%eax / eax <-- hi_32(sgnfcnd(x))
64 58 andl $0x80000000,%eax / eax[31] <-- msb(sgnfcnd(x)),
65 59 / rest_of(eax) <-- 0
66 60 jz .L8 / jump iff msb(sgnfcnd(x)) = 0
67 61 movl 12(%esp),%eax / ax <-- sign and bexp of x
68 62 notl %eax / ax[0..14] <-- not(bexp(x))
69 63 andl $0x00007fff,%eax / eax <-- zero_xtnd(not(bexp(x)))
70 64 jz .L8 / jump iff bexp(x) = 0x7fff or 0
71 65 xorl $0x00007fff,%eax / treat pseudo-denormal as subnormal
72 66 jz .L8
73 67 movl $1,%eax
74 68 .L8:
75 69 ret
76 70 .align 4
77 71 SET_SIZE(isnormall)
78 72
79 73 ENTRY(issubnormall)
80 74 / TRUE iff (bexp(x) = 0 &
81 75 / msb(sgnfcnd(x)) = 0 & frac(x) /= 0)
82 76 movl 8(%esp),%eax / eax <-- hi_32(sgnfcnd(x))
83 77 testl $0x80000000,%eax / eax[31] = msb(sgnfcnd(x));
84 78 / set ZF if it's 0.
85 79 jz .may_be_subnorm / jump iff msb(sgnfcnd(x)) = 0
86 80 .not_subnorm:
87 81 movl $0,%eax
88 82 .quicker_out:
89 83 ret
90 84 .may_be_subnorm:
91 85 testl $0x00007fff,12(%esp) / set ZF iff bexp(x) = 0
92 86 jnz .not_subnorm / jump iff bexp(x) /= 0
93 87 orl 4(%esp),%eax / (eax) = 0 iff sgnfcnd(x) = 0
94 88 jz .quicker_out
95 89 movl $1,%eax
96 90 ret
97 91 .align 4
98 92 SET_SIZE(issubnormall)
99 93
100 94 ENTRY(iszerol)
101 95 movl 12(%esp),%eax / ax <-- sign and bexp of x
102 96 andl $0x00007fff,%eax / eax <-- zero_xtnd(bexp(x))
103 97 jz .may_be_zero / jump iff bexp(x) = 0
104 98 .not_zero:
105 99 movl $0,%eax
106 100 ret
107 101 .may_be_zero: / here, (eax) = 0
108 102 orl 8(%esp),%eax / is hi_32(sgnfcnd(x)) = 0?
109 103 jnz .not_zero / jump iff hi_32(sgnfcnd(x)) /= 0
110 104 orl 4(%esp),%eax / is lo_32(sgnfcnd(x)) = 0?
111 105 jnz .not_zero / jump iff lo_32(sgnfcnd(x)) /= 0
112 106 movl $1,%eax
113 107 ret
114 108 .align 4
115 109 SET_SIZE(iszerol)
116 110
117 111 ENTRY(signbitl)
118 112 movl 10(%esp),%eax / eax[31] <-- sign_bit(x)
119 113 shrl $31,%eax / eax <-- zero_xtnd(sign_bit(x))
120 114 ret
121 115 .align 4
122 116 SET_SIZE(signbitl)
↓ open down ↓ |
75 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX