Print this page
5262 libm needs to be carefully unifdef'd
5268 libm doesn't need to hide symbols which are already local
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libm/sparc/src/nextafter.S
+++ new/usr/src/lib/libm/sparc/src/nextafter.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.
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
↓ open down ↓ |
28 lines elided |
↑ open up ↑ |
29 29 .file "nextafter.S"
30 30
31 31 #include "libm.h"
32 32 LIBM_ANSI_PRAGMA_WEAK(nextafter,function)
33 33 .weak _nextafter
34 34 .type _nextafter,#function
35 35 _nextafter = __nextafter
36 36 #include "libm_synonyms.h"
37 37 #include "libm_protos.h"
38 38
39 -#if defined(LIBM_BUILD) && !defined(ELFOBJ)
40 -#define mENTRY(x) ENTRY(__libm/**/x)
41 -#define mNAME(x) NAME(__libm/**/x)
42 -#else
43 -#define mENTRY(x) ENTRY(x)
44 -#define mNAME(x) NAME(x)
45 -#endif
46 -
47 39 RO_DATA
48 40 .align 8
49 41 .Lconstant:
50 42 two54 = 0x00
51 43 .word 0x43500000,0x0 ! 2**54
52 44 twom54 = 0x08
53 45 .word 0x3c900000,0x0 ! 2**-54
54 46 tiny = 0x10
55 47 .word 0x00100000,0x0 ! tiny
56 48
57 49 ! variable using fp
58 50 x = -0x8
59 51 y = -0x10
60 52
61 53 ENTRY(nextafter)
62 54 save %sp,-128,%sp
63 55 PIC_SETUP(l7)
64 56 std %i0,[%fp+x]
65 57 or %g0,%i0,%o0 ! save original arguments
66 58 or %g0,%i1,%o1
67 59 std %i2,[%fp+y]
68 60 or %g0,%i2,%o2
69 61 or %g0,%i3,%o3
70 62 ldd [%fp+x],%f2 ! x
71 63 ldd [%fp+y],%f0 ! y
72 64 fcmpd %f2,%f0 ! x:y
73 65 PIC_SET(l7,.Lconstant,l0)
74 66 sethi %hi(0x80000000),%l1
75 67 andn %i0,%l1,%l4
76 68 fbe 9f ! next_return
77 69 nop
78 70 fbu,a 9f ! next_return
79 71 fmuld %f2,%f0,%f0 ! + -> * for Cheetah
80 72 orcc %i1,%l4,%g0 ! see if x is zero
81 73 bne 1f
82 74 tst %i0
83 75 ! x is zero, return sign(y)*min
84 76 and %i2,%l1,%i0
85 77 ba 4f ! next_final
86 78 mov 1,%i1
87 79 1: bge 2f
88 80 nop
89 81 ! x is negative
90 82 fbl 1f ! next_subulp
91 83 nop
92 84 fbg 3f ! next_addulp
93 85 nop
94 86 2:
95 87 fbl 3f ! next_addulp
96 88 nop
97 89 1: ! next_subulp
98 90 subcc %i1,1,%i1
99 91 ba 4f ! next_final
100 92 subx %i0,0,%i0
101 93 3: ! next_addulp
102 94 addcc %i1,1,%i1
↓ open down ↓ |
46 lines elided |
↑ open up ↑ |
103 95 addx %i0,0,%i0
104 96 4: ! next_final
105 97 sethi %hi(0x7ff00000),%l3
106 98 std %i0,[%fp+x]
107 99 andcc %i0,%l3,%i2
108 100 be,a 1f ! xflow
109 101 ldd [%l0+tiny],%f2
110 102 cmp %i2,%l3
111 103 bne,a 9f ! next_return
112 104 ldd [%fp+x],%f0
113 - call mNAME(_SVID_libm_err) ! overflow
105 + call NAME(_SVID_libm_err) ! overflow
114 106 or %g0,46,%o4
115 107 ba 9f
116 108 nop
117 109 1: ! xflow
118 110 fmuld %f2,%f2,%f2
119 111 ldd [%fp+x],%f0
120 112 9: ! next_return
121 113 ret
122 114 restore
123 115
124 116 SET_SIZE(nextafter)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX