]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/ia64/fpu/s_tanf.S
ia64: strip trailing whitespace
[thirdparty/glibc.git] / sysdeps / ia64 / fpu / s_tanf.S
Content-type: text/html ]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/ia64/fpu/s_tanf.S


500 - Internal Server Error

Malformed UTF-8 character (fatal) at (eval 6) line 1, <$fd> line 477.
CommitLineData
d5efd131
MF
1.file "tancotf.s"
2
3
4// Copyright (c) 2000 - 2005, Intel Corporation
5// All rights reserved.
6//
7// Contributed 2000 by the Intel Numerics Group, Intel Corporation
8//
9// Redistribution and use in source and binary forms, with or without
10// modification, are permitted provided that the following conditions are
11// met:
12//
13// * Redistributions of source code must retain the above copyright
14// notice, this list of conditions and the following disclaimer.
15//
16// * Redistributions in binary form must reproduce the above copyright
17// notice, this list of conditions and the following disclaimer in the
18// documentation and/or other materials provided with the distribution.
19//
20// * The name of Intel Corporation may not be used to endorse or promote
21// products derived from this software without specific prior written
22// permission.
23
0347518d
MF
24// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
d5efd131 26// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0347518d 27// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
d5efd131 28// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
0347518d
MF
29// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
d5efd131 32// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
0347518d
MF
33// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
d5efd131
MF
35//
36// Intel Corporation is the author of this code, and requests that all
0347518d 37// problem reports or change requests be submitted to it directly at
d5efd131
MF
38// http://www.intel.com/software/products/opensource/libraries/num.htm.
39//
40// History
41//==============================================================
42// 02/02/00 Initial version
43// 04/04/00 Unwind support added
44// 12/27/00 Improved speed
45// 02/21/01 Updated to call tanl
46// 05/30/02 Improved speed, added cotf.
47// 11/25/02 Added explicit completer on fnorm
48// 02/10/03 Reordered header: .section, .global, .proc, .align
49// 04/17/03 Eliminated redundant stop bits
50// 03/31/05 Reformatted delimiters between data tables
51//
52// APIs
53//==============================================================
54// float tanf(float)
55// float cotf(float)
56//
57// Algorithm Description for tanf
58//==============================================================
59// The tanf function computes the principle value of the tangent of x,
60// where x is radian argument.
61//
62// There are 5 paths:
63// 1. x = +/-0.0
64// Return tanf(x) = +/-0.0
65//
66// 2. x = [S,Q]NaN
67// Return tanf(x) = QNaN
68//
69// 3. x = +/-Inf
70// Return tanf(x) = QNaN
71//
72// 4. x = r + (Pi/2)*N, N = RoundInt(x*(2/Pi)), N is even, |r|<Pi/4
73// Return tanf(x) = P19(r) = A1*r + A3*r^3 + A5*r^5 + ... + A19*r^19 =
74// = r*(A1 + A3*t + A5*t^2 + ... + A19*t^9) = r*P9(t), where t = r^2
75//
76// 5. x = r + (Pi/2)*N, N = RoundInt(x*(2/Pi)), N is odd, |r|<Pi/4
77// Return tanf(x) = -1/r + P11(r) = -1/r + B1*r + B3*r^3 + ... + B11*r^11 =
78// = -1/r + r*(B1 + B3*t + B5*t^2 + ... + B11*t^5) = -1/r + r*P11(t),
79// where t = r^2
80//
81// Algorithm Description for cotf
82//==============================================================
83// The cotf function computes the principle value of the cotangent of x,
84// where x is radian argument.
85//
86// There are 5 paths:
87// 1. x = +/-0.0
88// Return cotf(x) = +/-Inf and error handling is called
89//
90// 2. x = [S,Q]NaN
91// Return cotf(x) = QNaN
92//
93// 3. x = +/-Inf
94// Return cotf(x) = QNaN
95//
96// 4. x = r + (Pi/2)*N, N = RoundInt(x*(2/Pi)), N is odd, |r|<Pi/4
97// Return cotf(x) = P19(-r) = A1*(-r) + A3*(-r^3) + ... + A19*(-r^19) =
98// = -r*(A1 + A3*t + A5*t^2 + ... + A19*t^9) = -r*P9(t), where t = r^2
99//
100// 5. x = r + (Pi/2)*N, N = RoundInt(x*(2/Pi)), N is even, |r|<Pi/4
101// Return cotf(x) = 1/r + P11(-r) = 1/r + B1*(-r) + ... + B11*(-r^11) =
102// = 1/r - r*(B1 + B3*t + B5*t^2 + ... + B11*t^5) = 1/r - r*P11(t),
103// where t = r^2
104//
105// We set p10 and clear p11 if computing tanf, vice versa for cotf.
106//
107//
108// Registers used
109//==============================================================
110// Floating Point registers used:
111// f8, input
112// f32 -> f80
113//
114// General registers used:
115// r14 -> r23, r32 -> r39
116//
117// Predicate registers used:
118// p6 -> p13
119//
120// Assembly macros
121//==============================================================
122// integer registers
123rExp = r14
124rSignMask = r15
125rRshf = r16
126rScFctrExp = r17
127rIntN = r18
128rSigRcpPiby2 = r19
129rScRshf = r20
130rCoeffA = r21
131rCoeffB = r22
132rExpCut = r23
133
134GR_SAVE_B0 = r33
135GR_SAVE_PFS = r34
136GR_SAVE_GP = r35
137GR_Parameter_X = r36
138GR_Parameter_Y = r37
139GR_Parameter_RESULT = r38
140GR_Parameter_Tag = r39
141
142//==============================================================
143// floating point registers
144fScRcpPiby2 = f32
145fScRshf = f33
146fNormArg = f34
147fScFctr = f35
148fRshf = f36
149fShiftedN = f37
150fN = f38
151fR = f39
152fA01 = f40
153fA03 = f41
154fA05 = f42
155fA07 = f43
156fA09 = f44
157fA11 = f45
158fA13 = f46
159fA15 = f47
160fA17 = f48
161fA19 = f49
162fB01 = f50
163fB03 = f51
164fB05 = f52
165fB07 = f53
166fB09 = f54
167fB11 = f55
168fA03_01 = f56
169fA07_05 = f57
170fA11_09 = f58
171fA15_13 = f59
172fA19_17 = f60
173fA11_05 = f61
174fA19_13 = f62
175fA19_05 = f63
176fRbyA03_01 = f64
177fB03_01 = f65
178fB07_05 = f66
179fB11_09 = f67
180fB11_05 = f68
181fRbyB03_01 = f69
182fRbyB11_01 = f70
183fRp2 = f71
184fRp4 = f72
185fRp8 = f73
186fRp5 = f74
187fY0 = f75
188fY1 = f76
189fD = f77
190fDp2 = f78
191fInvR = f79
192fPiby2 = f80
193//==============================================================
194
195
196RODATA
197.align 16
198
199LOCAL_OBJECT_START(coeff_A)
200data8 0x3FF0000000000000 // A1 = 1.00000000000000000000e+00
201data8 0x3FD5555556BCE758 // A3 = 3.33333334641442641606e-01
202data8 0x3FC111105C2DAE48 // A5 = 1.33333249100689099175e-01
203data8 0x3FABA1F876341060 // A7 = 5.39701122561673229739e-02
204data8 0x3F965FB86D12A38D // A9 = 2.18495194027670719750e-02
205data8 0x3F8265F62415F9D6 // A11 = 8.98353860497717439465e-03
206data8 0x3F69E3AE64CCF58D // A13 = 3.16032468108912746342e-03
207data8 0x3F63920D09D0E6F6 // A15 = 2.38897844840557235331e-03
208LOCAL_OBJECT_END(coeff_A)
209
210LOCAL_OBJECT_START(coeff_B)
211data8 0xC90FDAA22168C235, 0x3FFF // pi/2
212data8 0x3FD55555555358DB // B1 = 3.33333333326107426583e-01
213data8 0x3F96C16C252F643F // B3 = 2.22222230621336129239e-02
214data8 0x3F61566243AB3C60 // B5 = 2.11638633968606896785e-03
215data8 0x3F2BC1169BD4438B // B7 = 2.11748132564551094391e-04
216data8 0x3EF611B4CEA056A1 // B9 = 2.10467959860990200942e-05
217data8 0x3EC600F9E32194BF // B11 = 2.62305891234274186608e-06
218data8 0xBF42BA7BCC177616 // A17 =-5.71546981685324877205e-04
219data8 0x3F4F2614BC6D3BB8 // A19 = 9.50584530849832782542e-04
220LOCAL_OBJECT_END(coeff_B)
221
222
223.section .text
224
225LOCAL_LIBM_ENTRY(cotf)
226
227{ .mlx
228