Print this page
5261 libm should stop using synonyms.h
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.
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
26 26 * Use is subject to license terms.
27 27 */
28 28
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 -#include "libm_synonyms.h"
37 36 #include "libm_protos.h"
38 37
39 38 RO_DATA
40 39 .align 8
41 40 .Lconstant:
42 41 two54 = 0x00
43 42 .word 0x43500000,0x0 ! 2**54
44 43 twom54 = 0x08
45 44 .word 0x3c900000,0x0 ! 2**-54
46 45 tiny = 0x10
47 46 .word 0x00100000,0x0 ! tiny
48 47
49 48 ! variable using fp
50 49 x = -0x8
51 50 y = -0x10
52 51
53 52 ENTRY(nextafter)
54 53 save %sp,-128,%sp
55 54 PIC_SETUP(l7)
56 55 std %i0,[%fp+x]
57 56 or %g0,%i0,%o0 ! save original arguments
58 57 or %g0,%i1,%o1
59 58 std %i2,[%fp+y]
60 59 or %g0,%i2,%o2
61 60 or %g0,%i3,%o3
62 61 ldd [%fp+x],%f2 ! x
63 62 ldd [%fp+y],%f0 ! y
64 63 fcmpd %f2,%f0 ! x:y
65 64 PIC_SET(l7,.Lconstant,l0)
66 65 sethi %hi(0x80000000),%l1
67 66 andn %i0,%l1,%l4
68 67 fbe 9f ! next_return
69 68 nop
70 69 fbu,a 9f ! next_return
71 70 fmuld %f2,%f0,%f0 ! + -> * for Cheetah
72 71 orcc %i1,%l4,%g0 ! see if x is zero
73 72 bne 1f
74 73 tst %i0
75 74 ! x is zero, return sign(y)*min
76 75 and %i2,%l1,%i0
77 76 ba 4f ! next_final
78 77 mov 1,%i1
79 78 1: bge 2f
80 79 nop
81 80 ! x is negative
82 81 fbl 1f ! next_subulp
83 82 nop
84 83 fbg 3f ! next_addulp
85 84 nop
86 85 2:
87 86 fbl 3f ! next_addulp
88 87 nop
89 88 1: ! next_subulp
90 89 subcc %i1,1,%i1
91 90 ba 4f ! next_final
92 91 subx %i0,0,%i0
93 92 3: ! next_addulp
94 93 addcc %i1,1,%i1
95 94 addx %i0,0,%i0
96 95 4: ! next_final
97 96 sethi %hi(0x7ff00000),%l3
98 97 std %i0,[%fp+x]
99 98 andcc %i0,%l3,%i2
100 99 be,a 1f ! xflow
101 100 ldd [%l0+tiny],%f2
102 101 cmp %i2,%l3
103 102 bne,a 9f ! next_return
104 103 ldd [%fp+x],%f0
105 104 call NAME(_SVID_libm_err) ! overflow
106 105 or %g0,46,%o4
107 106 ba 9f
108 107 nop
109 108 1: ! xflow
110 109 fmuld %f2,%f2,%f2
111 110 ldd [%fp+x],%f0
112 111 9: ! next_return
113 112 ret
114 113 restore
115 114
116 115 SET_SIZE(nextafter)
↓ open down ↓ |
70 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX