4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
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]
22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
32 LIBM_ANSI_PRAGMA_WEAK
(nextafterl
,function
)
36 .LFmaxl: .long 0xffffffff,0xffffffff,0x00007ffe
37 .LFminl: .long 0x1,0x0,0x0
55 movl $
1,-12(%ebp
) /// -12(%ebp
) contains Fminl
57 movl $
0,%ecx
/// final needs this
67 movl $
1,-12(%ebp
) /// -12(%ebp
) contains
-Fminl
69 movl $
0x00008000,%ecx
/// final needs this
76 movl
12(%ebp
),%edx
/ high word of significand of x
77 movl
16(%ebp
),%ecx
/ x
's exponent
81 andl $0x80000000,%eax / look at explicit leading bit
84 jnz .Lnot_pseudonormal / zero value implies pseudonormal
85 addl $1,%ecx / if pseudonormal, turn into equivalent normal
87 movl 8(%ebp),%eax / low x
88 subl $1,%eax / low x - ulp
90 cmpl $0xffffffff,%eax / this means low x was 0
96 cmpl $0x80000000,%edx / look at high x
104 andl $0x7fff,%eax / look at exp x without sign bit
106 jbe .Lsubnormal_result / exp > 1 ==> result will be normal
107 movl $0xffffffff,-8(%ebp)
112 movl $0x7fffffff,-8(%ebp)
114 andl $0x8000,%eax / look at sign bit
124 movl 12(%ebp),%edx / high x
125 movl 16(%ebp),%ecx / x's exponent
126 andl $
0x0000ffff,%ecx
129 andl $
0x80000000,%eax
/ look at explicit leading bit
131 andl $
0x80007fff,%eax
132 jnz
.Lnot_pseudonormal_2 / zero value implies pseudonormal
134 .Lnot_pseudonormal_2:
135 movl
8(%ebp
),%eax
/ low x
136 addl $
1,%eax
/ low x
+ ulp
138 jz
.Lcarry / jump if the content of %eax is 0
144 andl $
0x7fffffff,%eax
145 cmpl $
0x7fffffff,%eax
/ look at high x
152 movl $
0x80000000,-8(%ebp
)
158 andl $
0x00007fff,%ecx
167 fmulp
%st,%st(0) / create overflow signal
173 fmulp
%st,%st(0) / create underflow signal
176 fstp
%st(0) / C99 says to return y when x
== y
179 faddp
%st,%st(1) / x+y
,x