Print this page
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libm/amd64/src/locallibm.il
+++ new/usr/src/lib/libm/amd64/src/locallibm.il
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, this CDDL HEADER in each
14 14 / file and 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 / Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25 25 / Use is subject to license terms.
26 26 /
27 27
28 28 / Portions of this file are duplicated as GCC inline assembly in
29 29 / libm_inlines.h. Keep them in sync.
30 30
31 31 .inline __ieee754_sqrt,0
32 32 sqrtsd %xmm0,%xmm0
↓ open down ↓ |
32 lines elided |
↑ open up ↑ |
33 33 .end
34 34
35 35 .inline __inline_sqrtf,0
36 36 sqrtss %xmm0,%xmm0
37 37 .end
38 38
39 39 .inline __inline_sqrt,0
40 40 sqrtsd %xmm0,%xmm0
41 41 .end
42 42
43 - .inline __inline_fstsw,0
44 - fstsw %ax
45 - .end
46 -
47 43 /
48 44 / 00 - 24 bits
49 45 / 01 - reserved
50 46 / 10 - 53 bits
51 47 / 11 - 64 bits
52 48 /
53 49 .inline __swapRP,0
54 50 subq $16,%rsp
55 51 fstcw (%rsp)
56 52 movw (%rsp),%ax
57 53 movw %ax,%cx
58 54 andw $0xfcff,%cx
59 55 andl $0x3,%edi
60 56 shlw $8,%di
61 57 orw %di,%cx
62 58 movl %ecx,(%rsp)
63 59 fldcw (%rsp)
64 60 shrw $8,%ax
65 61 andq $0x3,%rax
66 62 addq $16,%rsp
67 63 .end
68 64
69 65 /
70 66 / 00 - Round to nearest, with even preferred
71 67 / 01 - Round down
72 68 / 10 - Round up
73 69 / 11 - Chop
74 70 /
75 71 .inline __swap87RD,0
76 72 subq $16,%rsp
77 73 fstcw (%rsp)
78 74 movw (%rsp),%ax
79 75 movw %ax,%cx
80 76 andw $0xf3ff,%cx
81 77 andl $0x3,%edi
82 78 shlw $10,%di
83 79 orw %di,%cx
84 80 movl %ecx,(%rsp)
85 81 fldcw (%rsp)
86 82 shrw $10,%ax
87 83 andq $0x3,%rax
88 84 addq $16,%rsp
89 85 .end
90 86
91 87 .inline abs,0
92 88 cmpl $0,%edi
93 89 jge 1f
94 90 negl %edi
95 91 1: movl %edi,%eax
↓ open down ↓ |
39 lines elided |
↑ open up ↑ |
96 92 .end
97 93
98 94 .inline __copysign,0
99 95 movq $0x7fffffffffffffff,%rax
100 96 movdq %rax,%xmm2
101 97 andpd %xmm2,%xmm0
102 98 andnpd %xmm1,%xmm2
103 99 orpd %xmm2,%xmm0
104 100 .end
105 101
106 - .inline __d_sqrt_,0
107 - movlpd (%rdi),%xmm0
108 - sqrtsd %xmm0,%xmm0
109 - .end
110 -
111 102 .inline __fabs,0
112 103 movq $0x7fffffffffffffff,%rax
113 104 movdq %rax,%xmm1
114 105 andpd %xmm1,%xmm0
115 106 .end
116 107
117 108 .inline __fabsf,0
118 109 movl $0x7fffffff,%eax
119 110 movdl %eax,%xmm1
120 111 andps %xmm1,%xmm0
121 112 .end
122 113
123 114 .inline _finite,0
124 115 subq $16,%rsp
↓ open down ↓ |
4 lines elided |
↑ open up ↑ |
125 116 movlpd %xmm0,(%rsp)
126 117 movq (%rsp),%rcx
127 118 movq $0x7fffffffffffffff,%rax
128 119 andq %rcx,%rax
129 120 movq $0x7ff0000000000000,%rcx
130 121 subq %rcx,%rax
131 122 shrq $63,%rax
132 123 addq $16,%rsp
133 124 .end
134 125
135 - .inline __r_sqrt_,0
136 - movss (%rdi),%xmm0
137 - sqrtss %xmm0,%xmm0
138 - .end
139 -
140 126 .inline __signbit,0
141 127 movmskpd %xmm0,%eax
142 - andq $1,%rax
143 - .end
144 -
145 - .inline __signbitf,0
146 - movmskps %xmm0,%eax
147 128 andq $1,%rax
148 129 .end
149 130
150 131 .inline __sqrt,0
151 132 sqrtsd %xmm0,%xmm0
152 133 .end
153 134
154 135 .inline __sqrtf,0
155 136 sqrtss %xmm0,%xmm0
156 137 .end
157 138
158 139 .inline __f95_signf,0
159 140 movl (%rdi),%eax
160 141 movl (%rsi),%ecx
161 142 andl $0x7fffffff,%eax
162 143 andl $0x80000000,%ecx
163 144 orl %ecx,%eax
164 145 movdl %eax,%xmm0
165 146 .end
166 147
167 148 .inline __f95_sign,0
168 149 movq (%rsi),%rax
169 150 movq $0x7fffffffffffffff,%rdx
170 151 shrq $63,%rax
171 152 shlq $63,%rax
172 153 andq (%rdi),%rdx
173 154 orq %rdx,%rax
174 155 movdq %rax,%xmm0
175 156 .end
176 157
177 158 .inline __r_sign,0
178 159 movl $0x7fffffff,%eax
179 160 movl $0x80000000,%edx
180 161 andl (%rdi),%eax
181 162 cmpl (%rsi),%edx
182 163 cmovel %eax,%edx
183 164 andl (%rsi),%edx
184 165 orl %edx,%eax
185 166 movdl %eax,%xmm0
186 167 .end
187 168
188 169 .inline __d_sign,0
189 170 movq $0x7fffffffffffffff,%rax
190 171 movq $0x8000000000000000,%rdx
191 172 andq (%rdi),%rax
192 173 cmpq (%rsi),%rdx
193 174 cmoveq %rax,%rdx
194 175 andq (%rsi),%rdx
195 176 orq %rdx,%rax
196 177 movdq %rax,%xmm0
197 178 .end
↓ open down ↓ |
41 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX