Print this page
5261 libm should stop using synonyms.h
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libm/i386/src/nextafterf.s
+++ new/usr/src/lib/libm/i386/src/nextafterf.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 "nextafterf.s"
30 30
31 31 #include "libm.h"
32 32 LIBM_ANSI_PRAGMA_WEAK(nextafterf,function)
33 -#include "libm_synonyms.h"
34 33
35 34 .data
36 35 .align 4
37 36 Fmaxf: .long 0x7f7fffff
38 37 Fminf: .long 0x1
39 38 ftmpf: .long 0
40 39
41 40
42 41 ENTRY(nextafterf)
43 42 pushl %ebp
44 43 movl %esp,%ebp
45 44 movl $0,%eax /// upper half of %eax must be initialized
46 45 flds 12(%ebp) / y
47 46 subl $4,%esp
48 47 flds 8(%ebp) / x, y
49 48 fucom / x : y
50 49 fstsw %ax
51 50 sahf
52 51 jp .NaN
53 52 je .equal
54 53 fstp %st(1) / x
55 54 ja .bigger
56 55 / x < y
57 56 ftst / x : 0
58 57 movl $0x1,-4(%ebp) / -4(%ebp) contains Fminf
59 58 fnstsw %ax
60 59 sahf
61 60 je .final
62 61 ja .addulp
63 62 jb .subulp
64 63 .bigger:
65 64 / x > y
66 65 ftst / x : 0
67 66 movl $0x80000001,-4(%ebp) / -4(%ebp) contains -Fminf
68 67 fnstsw %ax
69 68 sahf
70 69 je .final
71 70 jb .addulp
72 71 .subulp:
73 72 movl 8(%ebp),%eax / x
74 73 subl $1,%eax / x - ulp
75 74 movl %eax,-4(%ebp)
76 75 jmp .final
77 76 .addulp:
78 77 movl 8(%ebp),%eax / x
79 78 addl $1,%eax / x + ulp
80 79 movl %eax,-4(%ebp)
81 80
82 81 .final:
83 82 fstp %st(0) / empty
84 83 flds -4(%ebp) / z
85 84 andl $0x7f800000,%eax
86 85 jz .underflow
87 86 cmpl $0x7f800000,%eax
88 87 je .overflow
89 88 jmp .return
90 89 .overflow:
91 90 PIC_SETUP(1)
92 91 flds PIC_L(Fmaxf) / Fmaxf, z
93 92 fmul %st(0),%st / overflow-to-Inf, z
94 93 fstps PIC_L(ftmpf) / z & create overflow signal
95 94 PIC_WRAPUP
96 95 jmp .return
97 96 .underflow:
98 97 PIC_SETUP(2)
99 98 flds PIC_L(Fminf) / Fminf, z
100 99 fmul %st(0),%st / underflow-to-0, z
101 100 fstps PIC_L(ftmpf) / z & create underflow signal
102 101 PIC_WRAPUP
103 102 jmp .return
104 103 .equal:
105 104 fstp %st(0) / C99 says to return y when x == y
106 105 jmp .return
107 106 .NaN:
108 107 faddp %st,%st(1) / x+y
109 108 .return:
110 109 fwait
111 110 leave
112 111 ret
113 112 .align 4
114 113 SET_SIZE(nextafterf)
↓ open down ↓ |
71 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX