4 // Copyright (c) 2001 - 2003, Intel Corporation
5 // All rights reserved.
7 // Contributed 2001 by the Intel Numerics Group, Intel Corporation
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions are
13 // * Redistributions of source code must retain the above copyright
14 // notice, this list of conditions and the following disclaimer.
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.
20 // * The name of Intel Corporation may not be used to endorse or promote
21 // products derived from this software without specific prior written
24 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
28 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
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
32 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
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.
36 // Intel Corporation is the author of this code, and requests that all
37 // problem reports or change requests be submitted to it directly at
38 // http://www.intel.com/software/products/opensource/libraries/num.htm.
41 //==============================================================
42 // 08/28/01 New version
43 // 05/20/02 Cleaned up namespace and sf0 syntax
44 // 02/06/03 Reordered header: .section, .global, .proc, .align
47 //==============================================================
48 // long double acosl(long double)
50 // Overview of operation
51 //==============================================================
56 // For |s| in [2^{-4}, sqrt(2)/2]:
57 // Let t= 2^k*1.b1 b2..b6 1, where s= 2^k*1.b1 b2.. b52
58 // acos(s)= pi/2-asin(t)-asin(r), where r= s*sqrt(1-t^2)-t*sqrt(1-s^2), i.e.
59 // r= (s-t)*sqrt(1-t^2)-t*sqrt(1-t^2)*(sqrt((1-s^2)/(1-t^2))-1)
60 // asin(r)-r evaluated as 9-degree polynomial (c3*r^3+c5*r^5+c7*r^7+c9*r^9)
61 // The 64-bit significands of sqrt(1-t^2), 1/(1-t^2) are read from the table,
62 // along with the high and low parts of asin(t) (stored as two double precision
65 // |s| in (sqrt(2)/2, sqrt(255/256)):
66 // Let t= 2^k*1.b1 b2..b6 1, where (1-s^2)*frsqrta(1-s^2)= 2^k*1.b1 b2..b6..
67 // acos(|s|)= asin(t)-asin(r)
68 // acos(-|s|)=pi-asin(t)+asin(r), r= s*t-sqrt(1-s^2)*sqrt(1-t^2)
69 // To minimize accumulated errors, r is computed as
70 // r= (t*s)_s-t^2*y*z+z*y*(t^2-1+s^2)_s+z*y*(1-s^2)_s*x+z'*y*(1-s^2)*PS29+
71 // +(t*s-(t*s)_s)+z*y*((t^2-1-(t^2-1+s^2)_s)+s^2)+z*y*(1-s^2-(1-s^2)_s)+
72 // +ez*z'*y*(1-s^2)*(1-x),
73 // where y= frsqrta(1-s^2), z= (sqrt(1-t^2))_s (rounded to 24 significant bits)
74 // z'= sqrt(1-t^2), x= ((1-s^2)*y^2-1)/2
76 // |s|<2^{-4}: evaluate asin(s) as 17-degree polynomial, return pi/2-asin(s)
77 // (or simply return pi/2-s, if|s|<2^{-64})
79 // |s| in [sqrt(255/256), 1): acos(|s|)= asin(sqrt(1-s^2))
80 // acos(-|s|)= pi-asin(sqrt(1-s^2))
81 // use 17-degree polynomial for asin(sqrt(1-s^2)),
82 // 9-degree polynomial to evaluate sqrt(1-s^2)
83 // High order term is (pi)_high-(y*(1-s^2))_high, for s<0,
84 // or y*(1-s^2)_s, for s>0
90 //==============================================================
99 GR_SAVE_GP= r35 // This reg. can safely be used
104 GR_Parameter_RESULT= r39
105 GR_Parameter_TAG= r40
117 LOCAL_OBJECT_START(T_table)
119 // stores 64-bit significand of 1/(1-t^2), 64-bit significand of sqrt(1-t^2),
120 // asin(t)_high (double precision), asin(t)_low (double precision)
122 data8 0x80828692b71c4391, 0xff7ddcec2d87e879
123 data8 0x3fb022bc0ae531a0, 0x3c9f599c7bb42af6
124 data8 0x80869f0163d0b082, 0xff79cad2247914d3
125 data8 0x3fb062dd26afc320, 0x3ca4eff21bd49c5c
126 data8 0x808ac7d5a8690705, 0xff75a89ed6b626b9
127 data8 0x3fb0a2ff4a1821e0, 0x3cb7e33b58f164cc
128 data8 0x808f0112ad8ad2e0, 0xff7176517c2cc0cb
129 data8 0x3fb0e32279319d80, 0x3caee31546582c43
130 data8 0x80934abba8a1da0a, 0xff6d33e949b1ed31
131 data8 0x3fb12346b8101da0, 0x3cb8bfe463d087cd
132 data8 0x8097a4d3dbe63d8f, 0xff68e16571015c63
133 data8 0x3fb1636c0ac824e0, 0x3c8870a7c5a3556f
134 data8 0x809c0f5e9662b3dd, 0xff647ec520bca0f0
135 data8 0x3fb1a392756ed280, 0x3c964f1a927461ae
136 data8 0x80a08a5f33fadc66, 0xff600c07846a6830
137 data8 0x3fb1e3b9fc19e580, 0x3c69eb3576d56332
138 data8 0x80a515d91d71acd4, 0xff5b892bc475affa
139 data8 0x3fb223e2a2dfbe80, 0x3c6a4e19fd972fb6
140 data8 0x80a9b1cfc86ff7cd, 0xff56f631062cf93d
141 data8 0x3fb2640c6dd76260, 0x3c62041160e0849e
142 data8 0x80ae5e46b78b0d68, 0xff5253166bc17794
143 data8 0x3fb2a43761187c80, 0x3cac61651af678c0
144 data8 0x80b31b417a4b756b, 0xff4d9fdb14463dc8
145 data8 0x3fb2e46380bb6160, 0x3cb06ef23eeba7a1
146 data8 0x80b7e8c3ad33c369, 0xff48dc7e1baf6738
147 data8 0x3fb32490d0d910c0, 0x3caa05f480b300d5
148 data8 0x80bcc6d0f9c784d6, 0xff4408fe9ad13e37
149 data8 0x3fb364bf558b3820, 0x3cb01e7e403aaab9
150 data8 0x80c1b56d1692492d, 0xff3f255ba75f5f4e
151 data8 0x3fb3a4ef12ec3540, 0x3cb4fe8fcdf5f5f1
152 data8 0x80c6b49bc72ec446, 0xff3a319453ebd961
153 data8 0x3fb3e5200d171880, 0x3caf2dc089b2b7e2
154 data8 0x80cbc460dc4e0ae8, 0xff352da7afe64ac6
155 data8 0x3fb425524827a720, 0x3cb75a855e7c6053
156 data8 0x80d0e4c033bee9c4, 0xff301994c79afb32
157 data8 0x3fb46585c83a5e00, 0x3cb3264981c019ab
158 data8 0x80d615bdb87556db, 0xff2af55aa431f291
159 data8 0x3fb4a5ba916c73c0, 0x3c994251d94427b5
160 data8 0x80db575d6291fd8a, 0xff25c0f84bae0cb9
161 data8 0x3fb4e5f0a7dbdb20, 0x3cbee2fcc4c786cb
162 data8 0x80e0a9a33769e535, 0xff207c6cc0ec09fd
163 data8 0x3fb526280fa74620, 0x3c940656e5549b91
164 data8 0x80e60c93498e32cd, 0xff1b27b703a19c98
165 data8 0x3fb56660ccee2740, 0x3ca7082374d7b2cd
166 data8 0x80eb8031b8d4052d, 0xff15c2d6105c72f8
167 data8 0x3fb5a69ae3d0b520, 0x3c7c4d46e09ac68a
168 data8 0x80f10482b25c6c8a, 0xff104dc8e0813ed4
169 data8 0x3fb5e6d6586fec20, 0x3c9aa84ffd9b4958
170 data8 0x80f6998a709c7cfb, 0xff0ac88e6a4ab926
171 data8 0x3fb627132eed9140, 0x3cbced2cbbbe7d16
172 data8 0x80fc3f4d3b657c44, 0xff053325a0c8a2ec
173 data8 0x3fb667516b6c34c0, 0x3c6489c5fc68595a
174 data8 0x8101f5cf67ed2af8, 0xfeff8d8d73dec2bb
175 data8 0x3fb6a791120f33a0, 0x3cbe12acf159dfad
176 data8 0x8107bd1558d6291f, 0xfef9d7c4d043df29
177 data8 0x3fb6e7d226fabba0, 0x3ca386d099cd0dc7
178 data8 0x810d95237e38766a, 0xfef411ca9f80b5f7
179 data8 0x3fb72814ae53cc20, 0x3cb9f35731e71dd6
180 data8 0x81137dfe55aa0e29, 0xfeee3b9dc7eef009
181 data8 0x3fb76858ac403a00, 0x3c74df3dd959141a
182 data8 0x811977aa6a479f0f, 0xfee8553d2cb8122c
183 data8 0x3fb7a89e24e6b0e0, 0x3ca6034406ee42bc
184 data8 0x811f822c54bd5ef8, 0xfee25ea7add46a91
185 data8 0x3fb7e8e51c6eb6a0, 0x3cb82f8f78e68ed7
186 data8 0x81259d88bb4ffac1, 0xfedc57dc2809fb1d
187 data8 0x3fb8292d9700ad60, 0x3cbebb73c0e653f9
188 data8 0x812bc9c451e5a257, 0xfed640d974eb6068
189 data8 0x3fb8697798c5d620, 0x3ca2feee76a9701b
190 data8 0x813206e3da0f3124, 0xfed0199e6ad6b585
191 data8 0x3fb8a9c325e852e0, 0x3cb9e88f2f4d0efe
192 data8 0x813854ec231172f9, 0xfec9e229dcf4747d
193 data8 0x3fb8ea1042932a00, 0x3ca5ff40d81f66fd
194 data8 0x813eb3e209ee858f, 0xfec39a7a9b36538b
195 data8 0x3fb92a5ef2f247c0, 0x3cb5e3bece4d6b07
196 data8 0x814523ca796f56ce, 0xfebd428f72561efe
197 data8 0x3fb96aaf3b3281a0, 0x3cb7b9e499436d7c
198 data8 0x814ba4aa6a2d3ff9, 0xfeb6da672bd48fe4
199 data8 0x3fb9ab011f819860, 0x3cb9168143cc1a7f
200 data8 0x81523686e29bbdd7, 0xfeb062008df81f50
201 data8 0x3fb9eb54a40e3ac0, 0x3cb6e544197eb1e1
202 data8 0x8158d964f7124614, 0xfea9d95a5bcbd65a
203 data8 0x3fba2ba9cd080800, 0x3ca9a717be8f7446
204 data8 0x815f8d49c9d639e4, 0xfea34073551e1ac8
205 data8 0x3fba6c009e9f9260, 0x3c741e989a60938a
206 data8 0x8166523a8b24f626, 0xfe9c974a367f785c
207 data8 0x3fbaac591d0661a0, 0x3cb2c1290107e57d
208 data8 0x816d283c793e0114, 0xfe95ddddb94166cb
209 data8 0x3fbaecb34c6ef600, 0x3c9c7d5fbaec405d
210 data8 0x81740f54e06d55bd, 0xfe8f142c93750c50
211 data8 0x3fbb2d0f310cca00, 0x3cbc09479a9cbcfb
212 data8 0x817b07891b15cd5e, 0xfe883a3577e9fceb
213 data8 0x3fbb6d6ccf1455e0, 0x3cb9450bff4ee307
214 data8 0x818210de91bba6c8, 0xfe814ff7162cf62f
215 data8 0x3fbbadcc2abb1180, 0x3c9227fda12a8d24
216 data8 0x81892b5abb0f2bf9, 0xfe7a55701a8697b1
217 data8 0x3fbbee2d48377700, 0x3cb6fad72acfe356
218 data8 0x819057031bf7760e, 0xfe734a9f2dfa1810
219 data8 0x3fbc2e902bc10600, 0x3cb4465b588d16ad
220 data8 0x819793dd479d4fbe, 0xfe6c2f82f643f68b
221 data8 0x3fbc6ef4d9904580, 0x3c8b9ac54823960d
222 data8 0x819ee1eedf76367a, 0xfe65041a15d8a92c
223 data8 0x3fbcaf5b55dec6a0, 0x3ca2b8d28a954db2
224 data8 0x81a6413d934f7a66, 0xfe5dc8632be3477f
225 data8 0x3fbcefc3a4e727a0, 0x3c9380da83713ab4
226 data8 0x81adb1cf21597d4b, 0xfe567c5cd44431d5
227 data8 0x3fbd302dcae51600, 0x3ca995b83421756a
228 data8 0x81b533a9563310b8, 0xfe4f2005a78fb50f
229 data8 0x3fbd7099cc155180, 0x3caefa2f7a817d5f
230 data8 0x81bcc6d20cf4f373, 0xfe47b35c3b0caaeb
231 data8 0x3fbdb107acb5ae80, 0x3cb455fc372dd026
232 data8 0x81c46b4f2f3d6e68, 0xfe40365f20b316d6
233 data8 0x3fbdf177710518c0, 0x3cbee3dcc5b01434
234 data8 0x81cc2126b53c1144, 0xfe38a90ce72abf36
235 data8 0x3fbe31e91d439620, 0x3cb3e131c950aebd
236 data8 0x81d3e85ea5bd8ee2, 0xfe310b6419c9c33a
237 data8 0x3fbe725cb5b24900, 0x3c01d3fac6029027
238 data8 0x81dbc0fd1637b9c1, 0xfe295d6340932d15
239 data8 0x3fbeb2d23e937300, 0x3c6304cc44aeedd1
240 data8 0x81e3ab082ad5a0a4, 0xfe219f08e03580b3
241 data8 0x3fbef349bc2a77e0, 0x3cac1d2d6abe9c72
242 data8 0x81eba6861683cb97, 0xfe19d0537a0946e2
243 data8 0x3fbf33c332bbe020, 0x3ca0909dba4e96ca
244 data8 0x81f3b37d1afc9979, 0xfe11f1418c0f94e2
245 data8 0x3fbf743ea68d5b60, 0x3c937fc12a2a779a
246 data8 0x81fbd1f388d4be45, 0xfe0a01d190f09063
247 data8 0x3fbfb4bc1be5c340, 0x3cbf51a504b55813
248 data8 0x820401efbf87e248, 0xfe020201fff9efea
249 data8 0x3fbff53b970d1e80, 0x3ca625444b260078
250 data8 0x82106ad2ffdca049, 0xfdf5e3940a49135e
251 data8 0x3fc02aff52065460, 0x3c9125d113e22a57
252 data8 0x8221343d6ea1d3e2, 0xfde581a45429b0a0
253 data8 0x3fc06b84f8e03220, 0x3caccf362295894b
254 data8 0x82324434adbf99c2, 0xfdd4de1a001fb775
255 data8 0x3fc0ac0ed1fe7240, 0x3cc22f676096b0af
256 data8 0x82439aee8d0c7747, 0xfdc3f8e8269d1f03
257 data8 0x3fc0ec9cee9e4820, 0x3cca147e2886a628
258 data8 0x825538a1d0fcb2f0, 0xfdb2d201a9b1ba66
259 data8 0x3fc12d2f6006f0a0, 0x3cc72b36633bc2d4
260 data8 0x82671d86345c5cee, 0xfda1695934d723e7
261 data8 0x3fc16dc63789de60, 0x3cb11f9c47c7b83f
262 data8 0x827949d46a121770, 0xfd8fbee13cbbb823
263 data8 0x3fc1ae618682e620, 0x3cce1b59020cef8e
264 data8 0x828bbdc61eeab9ba, 0xfd7dd28bff0c9f34
265 data8 0x3fc1ef015e586c40, 0x3cafec043e0225ee
266 data8 0x829e7995fb6de9e1, 0xfd6ba44b823ee1ca
267 data8 0x3fc22fa5d07b90c0, 0x3cba905409caf8e3
268 data8 0x82b17d7fa5bbc982, 0xfd5934119557883a
269 data8 0x3fc2704eee685da0, 0x3cb5ef21838a823e
270 data8 0x82c4c9bfc373d276, 0xfd4681cfcfb2c161
271 data8 0x3fc2b0fcc9a5f3e0, 0x3ccc7952c5e0e312
272 data8 0x82d85e93fba50136, 0xfd338d7790ca0f41
273 data8 0x3fc2f1af73c6ba00, 0x3cbecf5f977d1ca9
274 data8 0x82ec3c3af8c76b32, 0xfd2056f9fff97727
275 data8 0x3fc33266fe6889a0, 0x3c9d329c022ebdb5
276 data8 0x830062f46abf6022, 0xfd0cde480c43b327
277 data8 0x3fc373237b34de60, 0x3cc95806d4928adb
278 data8 0x8314d30108ea35f0, 0xfcf923526c1562b2
279 data8 0x3fc3b3e4fbe10520, 0x3cbc299fe7223d54
280 data8 0x83298ca29434df97, 0xfce526099d0737ed
281 data8 0x3fc3f4ab922e4a60, 0x3cb59d8bb8fdbccc
282 data8 0x833e901bd93c7009, 0xfcd0e65de39f1f7c
283 data8 0x3fc435774fea2a60, 0x3c9ec18b43340914
284 data8 0x8353ddb0b278aad8, 0xfcbc643f4b106055
285 data8 0x3fc4764846ee80a0, 0x3cb90402efd87ed6
286 data8 0x836975a60a70c52e, 0xfca79f9da4fab13a
287 data8 0x3fc4b71e8921b860, 0xbc58f23449ed6365
288 data8 0x837f5841ddfa7a46, 0xfc92986889284148
289 data8 0x3fc4f7fa2876fca0, 0xbc6294812bf43acd
290 data8 0x839585cb3e839773, 0xfc7d4e8f554ab12f
291 data8 0x3fc538db36ee6960, 0x3cb910b773d4c578
292 data8 0x83abfe8a5466246f, 0xfc67c2012cb6fa68
293 data8 0x3fc579c1c6953cc0, 0x3cc5ede909fc47fc
294 data8 0x83c2c2c861474d91, 0xfc51f2acf82041d5
295 data8 0x3fc5baade9860880, 0x3cac63cdfc3588e5
296 data8 0x83d9d2cfc2813637, 0xfc3be08165519325
297 data8 0x3fc5fb9fb1e8e3a0, 0x3cbf7c8466578c29
298 data8 0x83f12eebf397daac, 0xfc258b6ce6e6822f
299 data8 0x3fc63c9731f39d40, 0x3cb6d2a7ffca3e9e
300 data8 0x8408d76990b9296e, 0xfc0ef35db402af94
301 data8 0x3fc67d947be9eec0, 0x3cb1980da09e6566
302 data8 0x8420cc9659487cd7, 0xfbf81841c8082dc4
303 data8 0x3fc6be97a21daf00, 0x3cc2ac8330e59aa5
304 data8 0x84390ec132759ecb, 0xfbe0fa06e24cc390
305 data8 0x3fc6ffa0b6ef05e0, 0x3ccc1a030fee56c4
306 data8 0x84519e3a29df811a, 0xfbc9989a85ce0954
307 data8 0x3fc740afcccca000, 0x3cc19692a5301ca6
308 data8 0x846a7b527842d61b, 0xfbb1f3e9f8e45dc4
309 data8 0x3fc781c4f633e2c0, 0x3cc0e98f3868a508
310 data8 0x8483a65c8434b5f0, 0xfb9a0be244f4af45
311 data8 0x3fc7c2e045b12140, 0x3cb2a8d309754420
312 data8 0x849d1fabe4e97dd7, 0xfb81e070362116d1
313 data8 0x3fc80401cddfd120, 0x3ca7a44544aa4ce6
314 data8 0x84b6e795650817ea, 0xfb6971805af8411e
315 data8 0x3fc84529a16ac020, 0x3c9e3b709c7d6f94
316 data8 0x84d0fe6f0589da92, 0xfb50beff0423a2f5
317 data8 0x3fc88657d30c49e0, 0x3cc60d65a7f0a278
318 data8 0x84eb649000a73014, 0xfb37c8d84414755c
319 data8 0x3fc8c78c758e8e80, 0x3cc94b2ee984c2b7
320 data8 0x85061a50ccd13781, 0xfb1e8ef7eeaf764b
321 data8 0x3fc908c79bcba900, 0x3cc8540ae794a2fe
322 data8 0x8521200b1fb8916e, 0xfb05114998f76a83
323 data8 0x3fc94a0958ade6c0, 0x3ca127f49839fa9c
324 data8 0x853c7619f1618bf6, 0xfaeb4fb898b65d19
325 data8 0x3fc98b51bf2ffee0, 0x3c8c9ba7a803909a
326 data8 0x85581cd97f45e274, 0xfad14a3004259931
327 data8 0x3fc9cca0e25d4ac0, 0x3cba458e91d3bf54
328 data8 0x857414a74f8446b4, 0xfab7009ab1945a54
329 data8 0x3fca0df6d551fe80, 0x3cc78ea1d329d2b2
330 data8 0x85905de2341dea46, 0xfa9c72e3370d2fbc
331 data8 0x3fca4f53ab3b6200, 0x3ccf60dca86d57ef
332 data8 0x85acf8ea4e423ff8, 0xfa81a0f3e9fa0ee9
333 data8 0x3fca90b777580aa0, 0x3ca4c4e2ec8a867e
334 data8 0x85c9e62111a92e7d, 0xfa668ab6dec711b1
335 data8 0x3fcad2224cf814e0, 0x3c303de5980d071c
336 data8 0x85e725e947fbee97, 0xfa4b3015e883dbfe
337 data8 0x3fcb13943f7d5f80, 0x3cc29d4eefa5cb1e
338 data8 0x8604b8a7144cd054, 0xfa2f90fa9883a543
339 data8 0x3fcb550d625bc6a0, 0x3c9e01a746152daf
340 data8 0x86229ebff69e2415, 0xfa13ad4e3dfbe1c1
341 data8 0x3fcb968dc9195ea0, 0x3ccc091bd73ae518
342 data8 0x8640d89acf78858c, 0xf9f784f9e5a1877b
343 data8 0x3fcbd815874eb160, 0x3cb5f4b89875e187
344 data8 0x865f669fe390c7f5, 0xf9db17e65944eacf
345 data8 0x3fcc19a4b0a6f9c0, 0x3cc5c0bc2b0bbf14
346 data8 0x867e4938df7dc45f, 0xf9be65fc1f6c2e6e
347 data8 0x3fcc5b3b58e061e0, 0x3cc1ca70df8f57e7
348 data8 0x869d80d0db7e4c0c, 0xf9a16f237aec427a
349 data8 0x3fcc9cd993cc4040, 0x3cbae93acc85eccf
350 data8 0x86bd0dd45f4f8265, 0xf98433446a806e70
351 data8 0x3fccde7f754f5660, 0x3cb22f70e64568d0
352 data8 0x86dcf0b16613e37a, 0xf966b246a8606170
353 data8 0x3fcd202d11620fa0, 0x3c962030e5d4c849
354 data8 0x86fd29d7624b3d5d, 0xf948ec11a9d4c45b
355 data8 0x3fcd61e27c10c0a0, 0x3cc7083c91d59217
356 data8 0x871db9b741dbe44a, 0xf92ae08c9eca4941
357 data8 0x3fcda39fc97be7c0, 0x3cc9258579e57211
358 data8 0x873ea0c3722d6af2, 0xf90c8f9e71633363
359 data8 0x3fcde5650dd86d60, 0x3ca4755a9ea582a9
360 data8 0x875fdf6fe45529e8, 0xf8edf92dc5875319
361 data8 0x3fce27325d6fe520, 0x3cbc1e2b6c1954f9
362 data8 0x878176321154e2bc, 0xf8cf1d20f87270b8
363 data8 0x3fce6907cca0d060, 0x3cb6ca4804750830
364 data8 0x87a36580fe6bccf5, 0xf8affb5e20412199
365 data8 0x3fceaae56fdee040, 0x3cad6b310d6fd46c
366 data8 0x87c5add5417a5cb9, 0xf89093cb0b7c0233
367 data8 0x3fceeccb5bb33900, 0x3cc16e99cedadb20
368 data8 0x87e84fa9057914ca, 0xf870e64d40a15036
369 data8 0x3fcf2eb9a4bcb600, 0x3cc75ee47c8b09e9
370 data8 0x880b4b780f02b709, 0xf850f2c9fdacdf78
371 data8 0x3fcf70b05fb02e20, 0x3cad6350d379f41a
372 data8 0x882ea1bfc0f228ac, 0xf830b926379e6465
373 data8 0x3fcfb2afa158b8a0, 0x3cce0ccd9f829985
374 data8 0x885252ff21146108, 0xf810394699fe0e8e
375 data8 0x3fcff4b77e97f3e0, 0x3c9b30faa7a4c703
376 data8 0x88765fb6dceebbb3, 0xf7ef730f865f6df0
377 data8 0x3fd01b6406332540, 0x3cdc5772c9e0b9bd
378 data8 0x88ad1f69be2cc730, 0xf7bdc59bc9cfbd97
379 data8 0x3fd04cf8ad203480, 0x3caeef44fe21a74a
380 data8 0x88f763f70ae2245e, 0xf77a91c868a9c54e
381 data8 0x3fd08f23ce0162a0, 0x3cd6290ab3fe5889
382 data8 0x89431fc7bc0c2910, 0xf73642973c91298e
383 data8 0x3fd0d1610f0c1ec0, 0x3cc67401a01f08cf
384 data8 0x8990573407c7738e, 0xf6f0d71d1d7a2dd6
385 data8 0x3fd113b0c65d88c0, 0x3cc7aa4020fe546f
386 data8 0x89df0eb108594653, 0xf6aa4e6a05cfdef2
387 data8 0x3fd156134ada6fe0, 0x3cc87369da09600c
388 data8 0x8a2f4ad16e0ed78a, 0xf662a78900c35249
389 data8 0x3fd19888f43427a0, 0x3cc62b220f38e49c
390 data8 0x8a811046373e0819, 0xf619e180181d97cc
391 data8 0x3fd1db121aed7720, 0x3ca3ede7490b52f4
392 data8 0x8ad463df6ea0fa2c, 0xf5cffb504190f9a2
393 data8 0x3fd21daf185fa360, 0x3caafad98c1d6c1b
394 data8 0x8b294a8cf0488daf, 0xf584f3f54b8604e6
395 data8 0x3fd2606046bf95a0, 0x3cdb2d704eeb08fa
396 data8 0x8b7fc95f35647757, 0xf538ca65c960b582
397 data8 0x3fd2a32601231ec0, 0x3cc661619fa2f126
398 data8 0x8bd7e588272276f8, 0xf4eb7d92ff39fccb
399 data8 0x3fd2e600a3865760, 0x3c8a2a36a99aca4a
400 data8 0x8c31a45bf8e9255e, 0xf49d0c68cd09b689
401 data8 0x3fd328f08ad12000, 0x3cb9efaf1d7ab552
402 data8 0x8c8d0b520a35eb18, 0xf44d75cd993cfad2
403 data8 0x3fd36bf614dcc040, 0x3ccacbb590bef70d
404 data8 0x8cea2005d068f23d, 0xf3fcb8a23ab4942b
405 data8 0x3fd3af11a079a6c0, 0x3cd9775872cf037d
406 data8 0x8d48e837c8cd5027, 0xf3aad3c1e2273908
407 data8 0x3fd3f2438d754b40, 0x3ca03304f667109a
408 data8 0x8da969ce732f3ac7, 0xf357c60202e2fd7e
409 data8 0x3fd4358c3ca032e0, 0x3caecf2504ff1a9d
410 data8 0x8e0baad75555e361, 0xf3038e323ae9463a
411 data8 0x3fd478ec0fd419c0, 0x3cc64bdc3d703971
412 data8 0x8e6fb18807ba877e, 0xf2ae2b1c3a6057f7
413 data8 0x3fd4bc6369fa40e0, 0x3cbb7122ec245cf2
414 data8 0x8ed5843f4bda74d5, 0xf2579b83aa556f0c
415 data8 0x3fd4fff2af11e2c0, 0x3c9cfa2dc792d394
416 data8 0x8f3d29862c861fef, 0xf1ffde2612ca1909
417 data8 0x3fd5439a4436d000, 0x3cc38d46d310526b
418 data8 0x8fa6a81128940b2d, 0xf1a6f1bac0075669
419 data8 0x3fd5875a8fa83520, 0x3cd8bf59b8153f8a
420 data8 0x901206c1686317a6, 0xf14cd4f2a730d480
421 data8 0x3fd5cb33f8cf8ac0, 0x3c9502b5c4d0e431
422 data8 0x907f4ca5fe9cf739, 0xf0f186784a125726
423 data8 0x3fd60f26e847b120, 0x3cc8a1a5e0acaa33
424 data8 0x90ee80fd34aeda5e, 0xf09504ef9a212f18
425 data8 0x3fd65333c7e43aa0, 0x3cae5b029cb1f26e
426 data8 0x915fab35e37421c6, 0xf0374ef5daab5c45
427 data8 0x3fd6975b02b8e360, 0x3cd5aa1c280c45e6
428 data8 0x91d2d2f0d894d73c, 0xefd86321822dbb51
429 data8 0x3fd6db9d05213b20, 0x3cbecf2c093ccd8b
430 data8 0x9248000249200009, 0xef7840021aca5a72
431 data8 0x3fd71ffa3cc87fc0, 0x3cb8d273f08d00d9
432 data8 0x92bf3a7351f081d2, 0xef16e42021d7cbd5
433 data8 0x3fd7647318b1ad20, 0x3cbce099d79cdc46
434 data8 0x93388a8386725713, 0xeeb44dfce6820283
435 data8 0x3fd7a908093fc1e0, 0x3ccb033ec17a30d9
436 data8 0x93b3f8aa8e653812, 0xee507c126774fa45
437 data8 0x3fd7edb9803e3c20, 0x3cc10aedb48671eb
438 data8 0x94318d99d341ade4, 0xedeb6cd32f891afb
439 data8 0x3fd83287f0e9cf80, 0x3c994c0c1505cd2a
440 data8 0x94b1523e3dedc630, 0xed851eaa3168f43c
441 data8 0x3fd87773cff956e0, 0x3cda3b7bce6a6b16
442 data8 0x95334fc20577563f, 0xed1d8ffaa2279669
443 data8 0x3fd8bc7d93a70440, 0x3cd4922edc792ce2
444 data8 0x95b78f8e8f92f274, 0xecb4bf1fd2be72da
445 data8 0x3fd901a5b3b9cf40, 0x3cd3fea1b00f9d0d
446 data8 0x963e1b4e63a87c3f, 0xec4aaa6d08694cc1
447 data8 0x3fd946eca98f2700, 0x3cdba4032d968ff1
448 data8 0x96c6fcef314074fc, 0xebdf502d53d65fea
449 data8 0x3fd98c52f024e800, 0x3cbe7be1ab8c95c9
450 data8 0x97523ea3eab028b2, 0xeb72aea36720793e
451 data8 0x3fd9d1d904239860, 0x3cd72d08a6a22b70
452 data8 0x97dfeae6f4ee4a9a, 0xeb04c4096a884e94
453 data8 0x3fda177f63e8ef00, 0x3cd818c3c1ebfac7
454 data8 0x98700c7c6d85d119, 0xea958e90cfe1efd7
455 data8 0x3fda5d468f92a540, 0x3cdf45fbfaa080fe
456 data8 0x9902ae7487a9caa1, 0xea250c6224aab21a
457 data8 0x3fdaa32f090998e0, 0x3cd715a9353cede4
458 data8 0x9997dc2e017a9550, 0xe9b33b9ce2bb7638
459 data8 0x3fdae939540d3f00, 0x3cc545c014943439
460 data8 0x9a2fa158b29b649b, 0xe9401a573f8aa706
461 data8 0x3fdb2f65f63f6c60, 0x3cd4a63c2f2ca8e2
462 data8 0x9aca09f835466186, 0xe8cba69df9f0bf35
463 data8 0x3fdb75b5773075e0, 0x3cda310ce1b217ec
464 data8 0x9b672266ab1e0136, 0xe855de74266193d4
465 data8 0x3fdbbc28606babc0, 0x3cdc84b75cca6c44
466 data8 0x9c06f7579f0b7bd5, 0xe7debfd2f98c060b
467 data8 0x3fdc02bf3d843420, 0x3cd225d967ffb922
468 data8 0x9ca995db058cabdc, 0xe76648a991511c6e
469 data8 0x3fdc497a9c224780, 0x3cde08101c5b825b
470 data8 0x9d4f0b605ce71e88, 0xe6ec76dcbc02d9a7
471 data8 0x3fdc905b0c10d420, 0x3cb1abbaa3edf120
472 data8 0x9df765b9eecad5e6, 0xe6714846bdda7318
473 data8 0x3fdcd7611f4b8a00, 0x3cbf6217ae80aadf
474 data8 0x9ea2b320350540fe, 0xe5f4bab71494cd6b
475 data8 0x3fdd1e8d6a0d56c0, 0x3cb726e048cc235c
476 data8 0x9f51023562fc5676, 0xe576cbf239235ecb
477 data8 0x3fdd65e082df5260, 0x3cd9e66872bd5250
478 data8 0xa002620915c2a2f6, 0xe4f779b15f5ec5a7
479 data8 0x3fddad5b02a82420, 0x3c89743b0b57534b
480 data8 0xa0b6e21c2caf9992, 0xe476c1a233a7873e
481 data8 0x3fddf4fd84bbe160, 0x3cbf7adea9ee3338
482 data8 0xa16e9264cc83a6b2, 0xe3f4a16696608191
483 data8 0x3fde3cc8a6ec6ee0, 0x3cce46f5a51f49c6
484 data8 0xa22983528f3d8d49, 0xe3711694552da8a8
485 data8 0x3fde84bd099a6600, 0x3cdc78f6490a2d31
486 data8 0xa2e7c5d2e2e69460, 0xe2ec1eb4e1e0a5fb
487 data8 0x3fdeccdb4fc685c0, 0x3cdd3aedb56a4825
488 data8 0xa3a96b5599bd2532, 0xe265b74506fbe1c9
489 data8 0x3fdf15241f23b3e0, 0x3cd440f3c6d65f65
490 data8 0xa46e85d1ae49d7de, 0xe1ddddb499b3606f
491 data8 0x3fdf5d98202994a0, 0x3cd6c44bd3fb745a
492 data8 0xa53727ca3e11b99e, 0xe1548f662951b00d
493 data8 0x3fdfa637fe27bf60, 0x3ca8ad1cd33054dd
494 data8 0xa6036453bdc20186, 0xe0c9c9aeabe5e481
495 data8 0x3fdfef0467599580, 0x3cc0f1ac0685d78a
496 data8 0xa6d34f1969dda338, 0xe03d89d5281e4f81
497 data8 0x3fe01bff067d6220, 0x3cc0731e8a9ef057
498 data8 0xa7a6fc62f7246ff3, 0xdfafcd125c323f54
499 data8 0x3fe04092d1ae3b40, 0x3ccabda24b59906d
500 data8 0xa87e811a861df9b9, 0xdf20909061bb9760
501 data8 0x3fe0653df0fd9fc0, 0x3ce94c8dcc722278
502 data8 0xa959f2d2dd687200, 0xde8fd16a4e5f88bd
503 data8 0x3fe08a00c1cae320, 0x3ce6b888bb60a274
504 data8 0xaa3967cdeea58bda, 0xddfd8cabd1240d22
505 data8 0x3fe0aedba3221c00, 0x3ced5941cd486e46
506 data8 0xab904fd587263c84, 0xdd1f4472e1cf64ed
507 data8 0x3fe0e651e85229c0, 0x3cdb6701042299b1
508 data8 0xad686d44dd5a74bb, 0xdbf173e1f6b46e92
509 data8 0x3fe1309cbf4cdb20, 0x3cbf1be7bb3f0ec5
510 data8 0xaf524e15640ebee4, 0xdabd54896f1029f6
511 data8 0x3fe17b4ee1641300, 0x3ce81dd055b792f1
512 data8 0xb14eca24ef7db3fa, 0xd982cb9ae2f47e41
513 data8 0x3fe1c66b9ffd6660, 0x3cd98ea31eb5ddc7
514 data8 0xb35ec807669920ce, 0xd841bd1b8291d0b6
515 data8 0x3fe211f66db3a5a0, 0x3ca480c35a27b4a2
516 data8 0xb5833e4755e04dd1, 0xd6fa0bd3150b6930
517 data8 0x3fe25df2e05b6c40, 0x3ca4bc324287a351
518 data8 0xb7bd34c8000b7bd3, 0xd5ab9939a7d23aa1
519 data8 0x3fe2aa64b32f7780, 0x3cba67314933077c
520 data8 0xba0dc64d126cc135, 0xd4564563ce924481
521 data8 0x3fe2f74fc9289ac0, 0x3cec1a1dc0efc5ec
522 data8 0xbc76222cbbfa74a6, 0xd2f9eeed501125a8
523 data8 0x3fe344b82f859ac0, 0x3ceeef218de413ac
524 data8 0xbef78e31985291a9, 0xd19672e2182f78be
525 data8 0x3fe392a22087b7e0, 0x3cd2619ba201204c
526 data8 0xc19368b2b0629572, 0xd02baca5427e436a
527 data8 0x3fe3e11206694520, 0x3cb5d0b3143fe689
528 data8 0xc44b2ae8c6733e51, 0xceb975d60b6eae5d
529 data8 0x3fe4300c7e945020, 0x3cbd367143da6582
530 data8 0xc7206b894212dfef, 0xcd3fa6326ff0ac9a
531 data8 0x3fe47f965d201d60, 0x3ce797c7a4ec1d63
532 data8 0xca14e1b0622de526, 0xcbbe13773c3c5338
533 data8 0x3fe4cfb4b09d1a20, 0x3cedfadb5347143c
534 data8 0xcd2a6825eae65f82, 0xca34913d425a5ae9
535 data8 0x3fe5206cc637e000, 0x3ce2798b38e54193
536 data8 0xd06301095e1351ee, 0xc8a2f0d3679c08c0
537 data8 0x3fe571c42e3d0be0, 0x3ccd7cb9c6c2ca68
538 data8 0xd3c0d9f50057adda, 0xc70901152d59d16b
539 data8 0x3fe5c3c0c108f940, 0x3ceb6c13563180ab
540 data8 0xd74650a98cc14789, 0xc5668e3d4cbf8828
541 data8 0x3fe61668a46ffa80, 0x3caa9092e9e3c0e5
542 data8 0xdaf5f8579dcc8f8f, 0xc3bb61b3eed42d02
543 data8 0x3fe669c251ad69e0, 0x3cccf896ef3b4fee
544 data8 0xded29f9f9a6171b4, 0xc20741d7f8e8e8af
545 data8 0x3fe6bdd49bea05c0, 0x3cdc6b29937c575d
546 data8 0xe2df5765854ccdb0, 0xc049f1c2d1b8014b
547 data8 0x3fe712a6b76c6e80, 0x3ce1ddc6f2922321
548 data8 0xe71f7a9b94fcb4c3, 0xbe833105ec291e91
549 data8 0x3fe76840418978a0, 0x3ccda46e85432c3d
550 data8 0xeb96b72d3374b91e, 0xbcb2bb61493b28b3
551 data8 0x3fe7bea9496d5a40, 0x3ce37b42ec6e17d3
552 data8 0xf049183c3f53c39b, 0xbad848720223d3a8
553 data8 0x3fe815ea59dab0a0, 0x3cb03ad41bfc415b
554 data8 0xf53b11ec7f415f15, 0xb8f38b57c53c9c48
555 data8 0x3fe86e0c84010760, 0x3cc03bfcfb17fe1f
556 data8 0xfa718f05adbf2c33, 0xb70432500286b185
557 data8 0x3fe8c7196b9225c0, 0x3ced99fcc6866ba9
558 data8 0xfff200c3f5489608, 0xb509e6454dca33cc
559 data8 0x3fe9211b54441080, 0x3cb789cb53515688
560 // The following table entries are not used
561 //data8 0x82e138a0fac48700, 0xb3044a513a8e6132
562 //data8 0x3fe97c1d30f5b7c0, 0x3ce1eb765612d1d0
563 //data8 0x85f4cc7fc670d021, 0xb0f2fb2ea6cbbc88
564 //data8 0x3fe9d82ab4b5fde0, 0x3ced3fe6f27e8039
565 //data8 0x89377c1387d5b908, 0xaed58e9a09014d5c
566 //data8 0x3fea355065f87fa0, 0x3cbef481d25f5b58
567 //data8 0x8cad7a2c98dec333, 0xacab929ce114d451
568 //data8 0x3fea939bb451e2a0, 0x3c8e92b4fbf4560f
569 //data8 0x905b7dfc99583025, 0xaa748cc0dbbbc0ec
570 //data8 0x3feaf31b11270220, 0x3cdced8c61bd7bd5
571 //data8 0x9446d8191f80dd42, 0xa82ff92687235baf
572 //data8 0x3feb53de0bcffc20, 0x3cbe1722fb47509e
573 //data8 0x98758ba086e4000a, 0xa5dd497a9c184f58
574 //data8 0x3febb5f571cb0560, 0x3ce0c7774329a613
575 //data8 0x9cee6c7bf18e4e24, 0xa37be3c3cd1de51b
576 //data8 0x3fec197373bc7be0, 0x3ce08ebdb55c3177
577 //data8 0xa1b944000a1b9440, 0xa10b2101b4f27e03
578 //data8 0x3fec7e6bd023da60, 0x3ce5fc5fd4995959
579 //data8 0xa6defd8ba04d3e38, 0x9e8a4b93cad088ec
580 //data8 0x3fece4f404e29b20, 0x3cea3413401132b5
581 //data8 0xac69dd408a10c62d, 0x9bf89d5d17ddae8c
582 //data8 0x3fed4d2388f63600, 0x3cd5a7fb0d1d4276
583 //data8 0xb265c39cbd80f97a, 0x99553d969fec7beb
584 //data8 0x3fedb714101e0a00, 0x3cdbda21f01193f2
585 //data8 0xb8e081a16ae4ae73, 0x969f3e3ed2a0516c
586 //data8 0x3fee22e1da97bb00, 0x3ce7231177f85f71
587 //data8 0xbfea427678945732, 0x93d5990f9ee787af
588 //data8 0x3fee90ac13b18220, 0x3ce3c8a5453363a5
589 //data8 0xc79611399b8c90c5, 0x90f72bde80febc31
590 //data8 0x3fef009542b712e0, 0x3ce218fd79e8cb56
591 //data8 0xcffa8425040624d7, 0x8e02b4418574ebed
592 //data8 0x3fef72c3d2c57520, 0x3cd32a717f82203f
593 //data8 0xd93299cddcf9cf23, 0x8af6ca48e9c44024
594 //data8 0x3fefe762b77744c0, 0x3ce53478a6bbcf94
595 //data8 0xe35eda760af69ad9, 0x87d1da0d7f45678b
596 //data8 0x3ff02f511b223c00, 0x3ced6e11782c28fc
597 //data8 0xeea6d733421da0a6, 0x84921bbe64ae029a
598 //data8 0x3ff06c5c6f8ce9c0, 0x3ce71fc71c1ffc02
599 //data8 0xfb3b2c73fc6195cc, 0x813589ba3a5651b6
600 //data8 0x3ff0aaf2613700a0, 0x3cf2a72d2fd94ef3
601 //data8 0x84ac1fcec4203245, 0xfb73a828893df19e
602 //data8 0x3ff0eb367c3fd600, 0x3cf8054c158610de
603 //data8 0x8ca50621110c60e6, 0xf438a14c158d867c
604 //data8 0x3ff12d51caa6b580, 0x3ce6bce9748739b6
605 //data8 0x95b8c2062d6f8161, 0xecb3ccdd37b369da
606 //data8 0x3ff1717418520340, 0x3ca5c2732533177c
607 //data8 0xa0262917caab4ad1, 0xe4dde4ddc81fd119
608 //data8 0x3ff1b7d59dd40ba0, 0x3cc4c7c98e870ff5
609 //data8 0xac402c688b72f3f4, 0xdcae469be46d4c8d
610 //data8 0x3ff200b93cc5a540, 0x3c8dd6dc1bfe865a
611 //data8 0xba76968b9eabd9ab, 0xd41a8f3df1115f7f
612 //data8 0x3ff24c6f8f6affa0, 0x3cf1acb6d2a7eff7
613 //data8 0xcb63c87c23a71dc5, 0xcb161074c17f54ec
614 //data8 0x3ff29b5b338b7c80, 0x3ce9b5845f6ec746
615 //data8 0xdfe323b8653af367, 0xc19107d99ab27e42
616 //data8 0x3ff2edf6fac7f5a0, 0x3cf77f961925fa02
617 //data8 0xf93746caaba3e1f1, 0xb777744a9df03bff
618 //data8 0x3ff344df237486c0, 0x3cf6ddf5f6ddda43
619 //data8 0x8ca77052f6c340f0, 0xacaf476f13806648
620 //data8 0x3ff3a0dfa4bb4ae0, 0x3cfee01bbd761bff
621 //data8 0xa1a48604a81d5c62, 0xa11575d30c0aae50
622 //data8 0x3ff4030b73c55360, 0x3cf1cf0e0324d37c
623 //data8 0xbe45074b05579024, 0x9478e362a07dd287
624 //data8 0x3ff46ce4c738c4e0, 0x3ce3179555367d12
625 //data8 0xe7a08b5693d214ec, 0x8690e3575b8a7c3b
626 //data8 0x3ff4e0a887c40a80, 0x3cfbd5d46bfefe69
627 //data8 0x94503d69396d91c7, 0xedd2ce885ff04028
628 //data8 0x3ff561ebd9c18cc0, 0x3cf331bd176b233b
629 //data8 0xced1d96c5bb209e6, 0xc965278083808702
630 //data8 0x3ff5f71d7ff42c80, 0x3ce3301cc0b5a48c
631 //data8 0xabac2cee0fc24e20, 0x9c4eb1136094cbbd
632 //data8 0x3ff6ae4c63222720, 0x3cf5ff46874ee51e
633 //data8 0x8040201008040201, 0xb4d7ac4d9acb1bf4
634 //data8 0x3ff7b7d33b928c40, 0x3cfacdee584023bb
635 LOCAL_OBJECT_END(T_table)
641 LOCAL_OBJECT_START(poly_coeffs)
643 data8 0xaaaaaaaaaaaaaaab, 0x0000000000003ffc
645 data8 0x999999999999999a, 0x0000000000003ffb
647 data8 0x3fa6db6db6db6db7, 0x3f9f1c71c71c71c8
649 data8 0x3C91A62633145C07, 0x3FF921FB54442D18
651 data8 0x3f96e8ba2e8ba2e9, 0x3f91c4ec4ec4ec4e
653 data8 0x3f8c99999999999a, 0x3f87a87878787223
655 data8 0x3CA1A62633145C07, 0x400921FB54442D18
656 LOCAL_OBJECT_END(poly_coeffs)
779 GLOBAL_LIBM_ENTRY(acosl)
782 // get exponent, mantissa (rounded to double precision) of s
785 fnma.s1 F_1S2 = f8, f8, f1
786 // r2 = pointer to T_table
787 addl r2 = @ltoff(T_table), gp
792 mov R_SGNMASK = 0x20000
795 mov R_TMP03 = 0xffff-64;;
804 shl R_TMP4 = R_SGNMASK, 45-17
810 // load RU(sqrt(2)/2) to integer register (in double format, shifted left by 1)
811 movl R_TMP2 = 0x7fcd413cccfe779a;;
816 // load 2^{-64} in FP register
817 setf.exp F_2M64 = R_TMP03
819 // index = (0x7-exponent)|b1 b2.. b6
820 extr.u R_INDEX = R_DBL_S, 46, 9
824 // get t = sign|exponent|b1 b2.. b6 1 x.. x
825 or R_T = R_DBL_S, R_TMP4
828 sub R_TMP4 = R_TMP4, r0, 1;;
833 // get t = sign|exponent|b1 b2.. b6 1 0.. 0
834 andcm R_T = R_T, R_TMP4
836 // eliminate sign from R_DBL_S (shift left by 1)
837 shl R_TMP3 = R_DBL_S, 1
844 // eliminate sign from R_EXP
845 andcm R_EXP0 = R_EXP, R_SGNMASK;;
851 // load start address for T_table
854 // p8 = 1 if |s|> = sqrt(2)/2
855 cmp.geu p8, p0 = R_TMP3, R_TMP2
859 // p7 = 1 if |s|<2^{-4} (exponent of s<bias-4)
860 cmp.lt p7, p0 = R_EXP0, R_TMP
861 // sqrt coefficient cs8 = -33*13/128
862 movl R_TMP2 = 0xc0568000;;
868 // load t in FP register
870 // if |s|<2^{-4}, take alternate path
871 (p7) br.cond.spnt SMALL_S
872 // if |s|> = sqrt(2)/2, take alternate path
873 (p8) br.cond.sptk LARGE_S
877 // index = (4-exponent)|b1 b2.. b6
878 sub R_INDEX = R_INDEX, R_BIAS
879 // sqrt coefficient cs9 = 55*13/128
880 movl R_TMP = 0x40b2c000;;
885 // sqrt coefficient cs8 = -33*13/128
886 setf.s F_CS8 = R_TMP2
888 // shift R_INDEX by 5
889 shl R_INDEX = R_INDEX, 5
893 // sqrt coefficient cs3 = 0.5 (set exponent = bias-1)
894 mov R_TMP4 = 0xffff - 1
896 // sqrt coefficient cs6 = -21/16
897 mov R_TMP6 = 0xbfa8;;
904 // sqrt coefficient cs7 = 33/16
905 movl R_TMP2 = 0x40040000;;
910 // load cs9 = 55*13/128
912 // sqrt coefficient cs5 = 7/8
914 // sqrt coefficient cs6 = 21/16
915 shl R_TMP6 = R_TMP6, 16;;
920 // load significand of 1/(1-t^2)
921 ldf8 F_INV_1T2 = [r2], 8
922 // sqrt coefficient cs7 = 33/16
923 setf.s F_CS7 = R_TMP2
924 // sqrt coefficient cs4 = -5/8
925 mov R_TMP5 = 0xbf20;;
930 // load significand of sqrt(1-t^2)
931 ldf8 F_SQRT_1T2 = [r2], 8
932 // sqrt coefficient cs6 = 21/16
933 setf.s F_CS6 = R_TMP6
934 // sqrt coefficient cs5 = 7/8
935 shl R_TMP3 = R_TMP3, 16;;
940 // sqrt coefficient cs3 = 0.5 (set exponent = bias-1)
941 setf.exp F_CS3 = R_TMP4
942 // r3 = pointer to polynomial coefficients
943 addl r3 = @ltoff(poly_coeffs), gp
944 // sqrt coefficient cs4 = -5/8
945 shl R_TMP5 = R_TMP5, 16;;
950 // sqrt coefficient cs5 = 7/8
951 setf.s F_CS5 = R_TMP3
953 fms.s1 F_D = f8, f1, F_T
954 // set p6 = 1 if s<0, p11 = 1 if s> = 0
955 cmp.ge p6, p11 = R_EXP, R_DBL_S
959 // r3 = load start address to polynomial coefficients
962 fma.s1 F_S2T2 = f8, f1, F_T
968 // sqrt coefficient cs4 = -5/8
969 setf.s F_CS4 = R_TMP5
971 fma.s1 F_S2T2 = F_S2T2, F_D, f0
979 // 0.5/(1-t^2) = 2^{-64}*(2^63/(1-t^2))
980 fma.s1 F_INV_1T2 = F_INV_1T2, F_2M64, f0
987 // set correct exponent for sqrt(1-t^2)
988 fma.s1 F_SQRT_1T2 = F_SQRT_1T2, F_2M64, f0
995 ldfpd F_C7, F_C9 = [r3], 16
996 // x = -(s^2-t^2)/(1-t^2)/2
997 fnma.s1 F_X = F_INV_1T2, F_S2T2, f0
1003 // load asin(t)_high, asin(t)_low
1004 ldfpd F_ATHI, F_ATLO = [r2]
1006 ldfpd F_PI2_LO, F_PI2_HI = [r3]
1008 fma.s1 F_TSQRT = F_T, F_SQRT_1T2, f0;;
1015 fma.s1 F_S89 = F_CS9, F_X, F_CS8
1022 fma.s1 F_S67 = F_CS7, F_X, F_CS6
1029 fma.s1 F_S45 = F_CS5, F_X, F_CS4
1036 fma.s1 F_X2 = F_X, F_X, f0
1044 fnma.s1 F_DTX = F_T, F_X, F_D
1050 // cs3*x+cs2 (cs2 = -0.5 = -cs3)
1051 fms.s1 F_S23 = F_CS3, F_X, F_CS3
1057 // if sign is negative, negate table values: asin(t)_low
1058 (p6) fnma.s1 F_ATLO = F_ATLO, f1, f0
1064 // if sign is negative, negate table values: asin(t)_high
1065 (p6) fnma.s1 F_ATHI = F_ATHI, f1, f0
1072 // cs9*x^3+cs8*x^2+cs7*x+cs6
1073 fma.s1 F_S69 = F_S89, F_X2, F_S67
1080 fma.s1 F_X4 = F_X2, F_X2, f0
1087 // t*sqrt(1-t^2)*x^2
1088 fma.s1 F_TSQRT = F_TSQRT, F_X2, f0
1094 // cs5*x^3+cs4*x^2+cs3*x+cs2
1095 fma.s1 F_S25 = F_S45, F_X2, F_S23
1102 // ((s-t)-t*x)*sqrt(1-t^2)
1103 fma.s1 F_DTX = F_DTX, F_SQRT_1T2, f0
1109 // (pi/2)_high - asin(t)_high
1110 fnma.s1 F_ATHI = F_ATHI, f1, F_PI2_HI
1116 // asin(t)_low - (pi/2)_low
1117 fnma.s1 F_ATLO = F_PI2_LO, f1, F_ATLO
1124 // PS29 = cs9*x^7+..+cs5*x^3+cs4*x^2+cs3*x+cs2
1125 fma.s1 F_S29 = F_S69, F_X4, F_S25
1133 // R = ((s-t)-t*x)*sqrt(1-t^2)-t*sqrt(1-t^2)*x^2*PS29
1134 fnma.s1 F_R = F_S29, F_TSQRT, F_DTX
1142 fma.s1 F_R2 = F_R, F_R, f0
1150 fma.s1 F_P79 = F_C9, F_R2, F_C7
1157 fma.s1 F_P35 = F_C5, F_R2, F_C3
1164 fma.s1 F_R4 = F_R2, F_R2, f0
1171 fma.s1 F_R3 = F_R2, F_R, f0
1179 // c3+c5*R^2+c7*R^4+c9*R^6
1180 fma.s1 F_P39 = F_P79, F_R4, F_P35
1187 // asin(t)_low+R^3*(c3+c5*R^2+c7*R^4+c9*R^6)
1188 fma.s1 F_P39 = F_P39, F_R3, F_ATLO
1195 // R+asin(t)_low+R^3*(c3+c5*R^2+c7*R^4+c9*R^6)
1196 fma.s1 F_P39 = F_P39, f1, F_R
1203 // result = (pi/2)-asin(t)_high+R+asin(t)_low+R^3*(c3+c5*R^2+c7*R^4+c9*R^6)
1204 fnma.s0 f8 = F_P39, f1, F_ATHI
1216 mov R_TMP3 = 0xffff - 1
1217 // y ~ 1/sqrt(1-s^2)
1218 frsqrta.s1 F_Y, p7 = F_1S2
1219 // c9 = 55*13*17/128
1220 mov R_TMP4 = 0x10af7b
1224 // c8 = -33*13*15/128
1225 mov R_TMP5 = 0x184923
1226 movl R_TMP2 = 0xff00000000000000;;
1230 // set p6 = 1 if s<0, p11 = 1 if s>0
1231 cmp.ge p6, p11 = R_EXP, R_DBL_S
1233 fnma.s1 F_1S2 = f8, f8, f1
1235 cmp.eq p9, p0 = r0, r0;;
1241 setf.exp F_05 = R_TMP3
1242 // (1-s^2) rounded to single precision
1243 fnma.s.s1 F_1S2_S = f8, f8, f1
1244 // c9 = 55*13*17/128
1245 shl R_TMP4 = R_TMP4, 10
1249 // AND mask for getting t ~ sqrt(1-s^2)
1250 setf.sig F_ANDMASK = R_TMP2
1252 movl R_TMP2 = 0x0100000000000000;;
1255 .pred.rel "mutex", p6, p11
1259 (p6) fma.s1 F_1AS = f8, f1, f1
1266 (p11) fnma.s1 F_1AS = f8, f1, f1
1272 // c9 = 55*13*17/128
1273 setf.s F_CS9 = R_TMP4
1275 (p6) fnma.s1 F_AS = f8, f1, f0
1276 // c8 = -33*13*15/128
1277 shl R_TMP5 = R_TMP5, 11
1282 mov R_TMP4 = 0x41d68
1284 (p11) fma.s1 F_AS = f8, f1, f0
1290 setf.sig F_ORMASK = R_TMP2
1292 fma.s1 F_Y2 = F_Y, F_Y, f0
1294 shl R_TMP4 = R_TMP4, 12
1299 mov R_TMP6 = 0xc1670
1301 fma.s1 F_T1 = F_Y, F_1S2, f0
1303 mov R_TMP7 = 0x40fc;;
1308 // load c8 = -33*13*15/128
1309 setf.s F_CS8 = R_TMP5
1311 movl R_TMP5 = 0xc08c0000;;
1315 // r3 = pointer to polynomial coefficients
1316 addl r3 = @ltoff(poly_coeffs), gp
1318 fnma.s1 F_DS = F_1S2_S, f1, F_1AS
1319 // p9 = 0 if p7 = 1 (p9 = 1 for special cases only)
1320 (p7) cmp.ne p9, p0 = r0, r0
1324 // load c7 = 33*13/16
1325 setf.s F_CS7 = R_TMP4
1327 movl R_TMP4 = 0x40200000;;
1333 setf.s F_CS4 = R_TMP5
1335 movl R_TMP5 = 0xbfc00000;;
1341 setf.s F_CS3 = R_TMP4
1342 // x = (1-s^2)_s*y^2-1
1343 fms.s1 F_X = F_1S2_S, F_Y2, f1
1345 shl R_TMP6 = R_TMP6, 12
1351 fma.s1 F_Y2_2 = F_Y2, F_05, f0
1357 // load c6 = -33*7/16
1358 setf.s F_CS6 = R_TMP6
1359 // eliminate lower bits from y'
1360 fand F_T = F_T1, F_ANDMASK
1362 shl R_TMP7 = R_TMP7, 16
1367 // r3 = load start address to polynomial coefficients
1370 fma.s1 F_DS = F_AS, F_1AS, F_DS
1371 // p9 = 1 if s is a special input (NaN, or |s|> = 1)
1372 (p9) br.cond.spnt acosl_SPECIAL_CASES;;
1376 // get exponent, significand of y' (in single prec.)
1379 setf.s F_CS2 = R_TMP5
1381 fma.s1 F_Y1S2 = F_Y, F_1S2, f0;;
1388 // if s<0, set s = -s
1389 (p6) fnma.s1 f8 = f8, f1, f0
1396 setf.s F_CS5 = R_TMP7
1397 // x = (1-s^2)_s*y^2-1+(1-(1-s^2)_s-s^2)*y^2
1398 fma.s1 F_X = F_DS, F_Y2, F_X
1399 // for t = 2^k*1.b1 b2.., get 7-k|b1.. b6
1400 extr.u R_INDEX = R_TMP, 17, 9;;
1405 // index = (4-exponent)|b1 b2.. b6
1406 sub R_INDEX = R_INDEX, R_BIAS
1408 // get exponent of y
1409 shr.u R_TMP2 = R_TMP, 23;;
1414 ldfe F_C3 = [r3], 16
1415 // set p8 = 1 if y'<2^{-4}
1416 cmp.gt p8, p0 = 0x7b, R_TMP2
1417 // shift R_INDEX by 5
1418 shl R_INDEX = R_INDEX, 5;;
1423 // get table index for sqrt(1-t^2)
1424 add r2 = r2, R_INDEX
1425 // get t = 2^k*1.b1 b2.. b7 1
1426 for F_T = F_T, F_ORMASK
1427 (p8) br.cond.spnt VERY_LARGE_INPUT;;
1434 ldfe F_C5 = [r3], 16
1436 ldfp8 F_INV_1T2, F_SQRT_1T2 = [r2], 16
1437 // x = ((1-s^2)*y^2-1)/2
1438 fma.s1 F_X = F_X, F_05, f0;;
1446 ldfpd F_C7, F_C9 = [r3], 16
1447 // set correct exponent for t
1448 fmerge.se F_T = F_T1, F_T;;
1454 // get address for loading pi
1457 fma.s1 F_S89 = F_X, F_CS9, F_CS8
1464 fma.s1 F_X2 = F_X, F_X, f0
1471 ldfpd F_PI2_LO, F_PI2_HI = [r3]
1473 fma.s1 F_Y1S2X = F_Y1S2, F_X, f0
1480 fma.s1 F_S67 = F_X, F_CS7, F_CS6
1488 fnma.s1 F_1X = F_X, f1, f1
1495 fma.s1 F_S23 = F_X, F_CS3, F_CS2
1503 fnma.s1 F_1T2 = F_T, F_T, f1
1508 // load asin(t)_high, asin(t)_low
1509 ldfpd F_ATHI, F_ATLO = [r2]
1511 fma.s1 F_S45 = F_X, F_CS5, F_CS4
1520 fma.s1 F_TS = F_T, f8, f0
1527 fma.s1 F_INV_1T2 = F_INV_1T2, F_2M64, f0
1533 // z~sqrt(1-t^2), rounded to 24 significant bits
1534 fma.s.s1 F_Z = F_SQRT_1T2, F_2M64, f0
1541 fma.s1 F_SQRT_1T2 = F_SQRT_1T2, F_2M64, f0
1549 fma.s1 F_Y1S2X2 = F_Y1S2, F_X2, f0
1556 fma.s1 F_X4 = F_X2, F_X2, f0
1563 // s*t rounded to 24 significant bits
1564 fma.s.s1 F_TSS = F_T, f8, f0
1571 fma.s1 F_S69 = F_X2, F_S89, F_S67
1578 // ST = (t^2-1+s^2) rounded to 24 significant bits
1579 fms.s.s1 F_ST = f8, f8, F_1T2
1586 fma.s1 F_S25 = F_X2, F_S45, F_S23
1594 fma.s1 F_INV1T2_2 = F_05, F_INV_1T2, f0
1600 // t*s-sqrt(1-t^2)*(1-s^2)*y
1601 fnma.s1 F_TS = F_Y1S2, F_SQRT_1T2, F_TS
1609 fma.s1 F_ZE = F_INV_1T2, F_SQRT_1T2, f0
1616 fms.s1 F_DZ0 = F_Z, F_Z, F_1T2
1623 // (1-s^2-(1-s^2)_s)*x
1624 fma.s1 F_DS2X = F_X, F_DS, f0
1632 fms.s1 F_DTS = F_T, f8, F_TSS
1639 fma.s1 F_S29 = F_X4, F_S69, F_S25
1647 fma.s1 F_YZ = F_Z, F_Y, f0
1654 fma.s1 F_T2 = F_T, F_T, f0
1662 fma.s1 F_1T2_ST = F_ST, f1, F_1T2
1670 fma.s1 F_Y1S2_1X = F_Y1S2, F_1X, f0
1676 // dz ~ sqrt(1-t^2)-z
1677 fma.s1 F_DZ = F_DZ0, F_ZE, f0
1684 // -1+correction for sqrt(1-t^2)-z
1685 fnma.s1 F_CORR = F_INV1T2_2, F_DZ0, f0
1692 // (PS29*x^2+x)*y*(1-s^2)
1693 fma.s1 F_S19 = F_Y1S2X2, F_S29, F_Y1S2X
1700 fma.s1 F_ZY1S2S = F_YZ, F_1S2_S, f0
1707 fms.s1 F_1T2_ST = f8, f8, F_1T2_ST
1714 // (t*s-(t*s)_s)+z*y*(1-s^2-(1-s^2)_s)*x
1715 fma.s1 F_DTS = F_YZ, F_DS2X, F_DTS
1721 // dz*y*(1-s^2)*(1-x)
1722 fma.s1 F_DZ_TERM = F_DZ, F_Y1S2_1X, f0
1729 // R = t*s-sqrt(1-t^2)*(1-s^2)*y+sqrt(1-t^2)*(1-s^2)*y*PS19
1730 // (used for polynomial evaluation)
1731 fma.s1 F_R = F_S19, F_SQRT_1T2, F_TS
1738 // (PS29*x^2)*y*(1-s^2)
1739 fma.s1 F_S29 = F_Y1S2X2, F_S29, f0
1745 // apply correction to dz*y*(1-s^2)*(1-x)
1746 fma.s1 F_DZ_TERM = F_DZ_TERM, F_CORR, F_DZ_TERM
1754 fma.s1 F_R2 = F_R, F_R, f0
1761 // (t*s-(t*s)_s)+z*y*(1-s^2-(1-s^2)_s)*x+dz*y*(1-s^2)*(1-x)
1762 fma.s1 F_DZ_TERM = F_DZ_TERM, f1, F_DTS
1770 fma.s1 F_P79 = F_C9, F_R2, F_C7
1777 fma.s1 F_P35 = F_C5, F_R2, F_C3
1783 // asin(t)_low-(pi)_low (if s<0)
1784 (p6) fms.s1 F_ATLO = F_ATLO, f1, F_PI2_LO
1791 fma.s1 F_R4 = F_R2, F_R2, f0
1798 fma.s1 F_R3 = F_R2, F_R, f0
1806 fnma.s1 F_TSS = F_T2, F_YZ, F_TSS
1812 // d(ts)+z*y*d(1-s^2)*x+dz*y*(1-s^2)*(1-x)+z*y*(s^2-1+t^2-ST)
1813 fma.s1 F_DZ_TERM = F_YZ, F_1T2_ST, F_DZ_TERM
1820 // (pi)_hi-asin(t)_hi (if s<0)
1821 (p6) fms.s1 F_ATHI = F_PI2_HI, f1, F_ATHI
1827 // c3+c5*R^2+c7*R^4+c9*R^6
1828 fma.s1 F_P39 = F_P79, F_R4, F_P35
1835 // d(ts)+z*y*d(1-s^2)*x+dz*y*(1-s^2)*(1-x)+z*y*(s^2-1+t^2-ST)+
1836 // + sqrt(1-t^2)*y*(1-s^2)*x^2*PS29
1837 fma.s1 F_DZ_TERM = F_SQRT_1T2, F_S29, F_DZ_TERM
1844 // (t*s)_s-t^2*y*z+z*y*ST
1845 fma.s1 F_TSS = F_YZ, F_ST, F_TSS
1851 // -asin(t)_low+R^3*(c3+c5*R^2+c7*R^4+c9*R^6)
1852 fms.s1 F_P39 = F_P39, F_R3, F_ATLO
1859 // d(ts)+z*y*d(1-s^2)*x+dz*y*(1-s^2)*(1-x)+z*y*(s^2-1+t^2-ST) +
1860 // + sqrt(1-t^2)*y*(1-s^2)*x^2*PS29 +
1861 // - asin(t)_low+R^3*(c3+c5*R^2+c7*R^4+c9*R^6)
1862 fma.s1 F_DZ_TERM = F_P39, f1, F_DZ_TERM
1869 // d(ts)+z*y*d(1-s^2)*x+dz*y*(1-s^2)*(1-x)+z*y*(s^2-1+t^2-ST) +
1870 // + sqrt(1-t^2)*y*(1-s^2)*x^2*PS29 + z*y*(1-s^2)_s*x +
1871 // - asin(t)_low+R^3*(c3+c5*R^2+c7*R^4+c9*R^6)
1872 fma.s1 F_DZ_TERM = F_ZY1S2S, F_X, F_DZ_TERM
1879 // d(ts)+z*y*d(1-s^2)*x+dz*y*(1-s^2)*(1-x)+z*y*(s^2-1+t^2-ST) +
1880 // + sqrt(1-t^2)*y*(1-s^2)*x^2*PS29 + z*y*(1-s^2)_s*x +
1881 // - asin(t)_low+R^3*(c3+c5*R^2+c7*R^4+c9*R^6) +
1882 // + (t*s)_s-t^2*y*z+z*y*ST
1883 fma.s1 F_DZ_TERM = F_TSS, f1, F_DZ_TERM
1888 .pred.rel "mutex", p6, p11
1891 // result: add high part of table value
1893 (p11) fnma.s0 f8 = F_DZ_TERM, f1, F_ATHI
1899 // result: add high part of pi-table value
1901 (p6) fma.s0 f8 = F_DZ_TERM, f1, F_ATHI
1912 // use 15-term polynomial approximation
1915 // r3 = pointer to polynomial coefficients
1916 addl r3 = @ltoff(poly_coeffs), gp;;
1917 // load start address for coefficients
1919 mov R_TMP = 0x3fbf;;
1925 ldfe F_C3 = [r3], 16
1926 // p7 = 1 if |s|<2^{-64} (exponent of s<bias-64)
1927 cmp.lt p7, p0 = R_EXP0, R_TMP;;
1931 ldfe F_C5 = [r3], 16
1932 ldfpd F_C11, F_C13 = [r2], 16
1937 ldfpd F_C7, F_C9 = [r3], 16
1938 ldfpd F_C15, F_C17 = [r2]
1946 ldfpd F_PI2_LO, F_PI2_HI = [r3]
1948 fma.s1 F_R2 = f8, f8, f0
1950 (p7) br.cond.spnt RETURN_PI2;;
1957 fma.s1 F_R3 = f8, F_R2, f0
1964 fma.s1 F_R4 = F_R2, F_R2, f0
1972 fma.s1 F_P35 = F_C5, F_R2, F_C3
1979 fma.s1 F_P1113 = F_C13, F_R2, F_C11
1987 fma.s1 F_P79 = F_C9, F_R2, F_C7
1994 fma.s1 F_P1517 = F_C17, F_R2, F_C15
2000 // (pi/2)_high-s_high
2001 fnma.s1 F_T = f8, f1, F_PI2_HI
2007 fma.s1 F_R8 = F_R4, F_R4, f0
2014 // c3+c5*s^2+c7*s^4+c9*s^6
2015 fma.s1 F_P39 = F_P79, F_R4, F_P35
2021 // c11+c13*s^2+c15*s^4+c17*s^6
2022 fma.s1 F_P1117 = F_P1517, F_R4, F_P1113
2029 fms.s1 F_S = F_T, f1, F_PI2_HI
2036 fma.s1 F_P317 = F_R8, F_P1117, F_P39
2043 fma.s1 F_DS = f8, f1, F_S
2049 // (pi/2)_low-s^3*(c3+..+c17*s^14)
2050 fnma.s0 F_P317 = F_P317, F_R3, F_PI2_LO
2056 // (pi/2)_low-s_low-s^3*(c3+..+c17*s^14)
2057 fms.s1 F_P317 = F_P317, f1, F_DS
2063 // result: pi/2-s-c3*s^3-..-c17*s^17
2064 fma.s0 f8 = F_T, f1, F_P317
2077 fms.s0 F_PI2_LO = F_PI2_LO, f1, f8
2084 fma.s0 f8 = F_PI2_HI, f1, F_PI2_LO
2096 // pointer to pi_low, pi_high
2099 ldfe F_C5 = [r3], 16
2100 // x = ((1-(s^2)_s)*y^2-1)/2-(s^2-(s^2)_s)*y^2/2
2101 fma.s1 F_X = F_X, F_05, f0;;
2104 .pred.rel "mutex", p6, p11
2106 // load pi (low, high), if s<0
2107 (p6) ldfpd F_PI2_LO, F_PI2_HI = [r2]
2109 ldfpd F_C7, F_C9 = [r3], 16
2110 // if s>0, set F_PI2_LO=0
2111 (p11) fma.s1 F_PI2_HI = f0, f0, f0;;
2116 (p11) fma.s1 F_PI2_LO = f0, f0, f0
2121 // adjust address for C_11
2124 fma.s1 F_S89 = F_X, F_CS9, F_CS8
2131 fma.s1 F_X2 = F_X, F_X, f0
2139 fma.s1 F_Y1S2X = F_Y1S2, F_X, f0
2145 ldfpd F_C11, F_C13 = [r3], 16
2147 fma.s1 F_S67 = F_X, F_CS7, F_CS6
2154 ldfpd F_C15, F_C17 = [r3], 16
2156 fma.s1 F_S23 = F_X, F_CS3, F_CS2
2164 fma.s1 F_S45 = F_X, F_CS5, F_CS4
2174 fma.s1 F_Y1S2X2 = F_Y1S2, F_X2, f0
2181 fma.s1 F_X4 = F_X2, F_X2, f0
2189 fma.s1 F_S69 = F_X2, F_S89, F_S67
2197 fma.s1 F_S25 = F_X2, F_S45, F_S23
2205 // (pi)_high-y*(1-s^2)_s
2206 fnma.s1 F_HI = F_Y, F_1S2_S, F_PI2_HI
2214 fma.s1 F_S29 = F_X4, F_S69, F_S25
2221 // -(y*(1-s^2)_s)_high
2222 fms.s1 F_1S2_HI = F_HI, f1, F_PI2_HI
2229 // (PS29*x^2+x)*y*(1-s^2)
2230 fma.s1 F_S19 = F_Y1S2X2, F_S29, F_Y1S2X
2237 // y*(1-s^2)_s-(y*(1-s^2))_high
2238 fma.s1 F_DS2 = F_Y, F_1S2_S, F_1S2_HI
2247 // (used for polynomial evaluation)
2248 fnma.s1 F_R = F_S19, f1, F_Y1S2
2255 // y*(1-s^2)-(y*(1-s^2))_high
2256 fma.s1 F_DS2 = F_Y, F_DS, F_DS2
2262 // (pi)_low+(PS29*x^2)*y*(1-s^2)
2263 fma.s1 F_S29 = F_Y1S2X2, F_S29, F_PI2_LO
2271 fma.s1 F_R2 = F_R, F_R, f0
2279 // (pi)_low+(PS29*x^2)*y*(1-s^2)-(y*(1-s^2)-(y*(1-s^2))_high)
2280 fms.s1 F_S29 = F_S29, f1, F_DS2
2288 fma.s1 F_P79 = F_C9, F_R2, F_C7
2295 fma.s1 F_P35 = F_C5, F_R2, F_C3
2304 fma.s1 F_R4 = F_R2, F_R2, f0
2311 fma.s1 F_R3 = F_R2, F_R, f0
2319 fma.s1 F_P1113 = F_C13, F_R2, F_C11
2326 fma.s1 F_P1517 = F_C17, F_R2, F_C15
2333 // (pi)_low+(PS29*x^2)*y*(1-s^2)-(y*(1-s^2)-(y*(1-s^2))_high)+y*(1-s^2)*x
2334 fma.s1 F_S29 = F_Y1S2, F_X, F_S29
2341 // c11+c13*R^2+c15*R^4+c17*R^6
2342 fma.s1 F_P1117 = F_P1517, F_R4, F_P1113
2348 // c3+c5*R^2+c7*R^4+c9*R^6
2349 fma.s1 F_P39 = F_P79, F_R4, F_P35
2358 fma.s1 F_R8 = F_R4, F_R4, f0
2365 // c3+c5*R^2+c7*R^4+c9*R^6+..+c17*R^14
2366 fma.s1 F_P317 = F_P1117, F_R8, F_P39
2373 // (pi)_low-(PS29*x^2)*y*(1-s^2)-(y*(1-s^2)-
2374 // -(y*(1-s^2))_high)+y*(1-s^2)*x - P3, 17
2375 fnma.s1 F_S29 = F_P317, F_R3, F_S29
2379 .pred.rel "mutex", p6, p11
2383 // (pi)_low-(PS29*x^2)*y*(1-s^2)-(y*(1-s^2)-
2384 // -(y*(1-s^2))_high)+y*(1-s^2)*x - P3, 17
2385 // +(pi)_high-(y*(1-s^2))_high
2386 (p6) fma.s0 f8 = F_S29, f1, F_HI
2393 // (PS29*x^2)*y*(1-s^2)-
2394 // -y*(1-s^2)*x + P3, 17
2396 (p11) fms.s0 f8 = F_Y, F_1S2_S, F_S29
2405 acosl_SPECIAL_CASES:
2408 alloc r32 = ar.pfs, 1, 4, 4, 0
2409 // check if the input is a NaN, or unsupported format
2410 // (i.e. not infinity or normal/denormal)
2411 fclass.nm p7, p8 = f8, 0x3f
2419 ldfpd F_PI2_HI, F_PI2_LO = [r3]
2421 fmerge.s F_S = f0, f8
2427 // if NaN, quietize it, and return
2428 (p7) fma.s0 f8 = f8, f1, f0
2429 (p7) br.ret.spnt b0;;
2436 fcmp.eq.s0 p9, p10 = F_S, f1
2443 fma.s1 FR_X = f8, f1, f0
2445 mov GR_Parameter_TAG = 57;;
2451 // if s = 1, result is 0
2452 (p9) fma.s0 f8 = f0, f0, f0
2453 // set p6=0 for |s|>1
2454 (p10) cmp.ne p6, p0 = r0, r0;;
2460 // if s = -1, result is pi
2461 (p6) fma.s0 f8 = F_PI2_HI, f1, F_PI2_LO
2462 // return if |s| = 1
2463 (p9) br.ret.sptk b0;;
2470 frcpa.s1 FR_RESULT, p0 = f1, f0
2477 // return QNaN indefinite (0*Infinity)
2478 fma.s0 FR_RESULT = f0, FR_RESULT, f0
2483 GLOBAL_LIBM_END(acosl)
2486 LOCAL_LIBM_ENTRY(__libm_error_region)
2490 add GR_Parameter_Y=-32,sp // Parameter 2 value
2492 .save ar.pfs,GR_SAVE_PFS
2493 mov GR_SAVE_PFS=ar.pfs // Save ar.pfs
2497 add sp=-64,sp // Create new stack
2499 mov GR_SAVE_GP=gp // Save gp
2505 stfe [GR_Parameter_Y] = f1,16 // Store Parameter 2 on stack
2506 add GR_Parameter_X = 16,sp // Parameter 1 address
2507 .save b0, GR_SAVE_B0
2508 mov GR_SAVE_B0=b0 // Save b0
2514 stfe [GR_Parameter_X] = FR_X // Store Parameter 1 on stack
2515 add GR_Parameter_RESULT = 0,GR_Parameter_Y
2516 nop.b 0 // Parameter 3 address
2519 stfe [GR_Parameter_Y] = FR_RESULT // Store Parameter 3 on stack
2520 add GR_Parameter_Y = -16,GR_Parameter_Y
2521 br.call.sptk b0=__libm_error_support# // Call error handling function
2526 add GR_Parameter_RESULT = 48,sp
2531 ldfe f8 = [GR_Parameter_RESULT] // Get return result off stack
2533 add sp = 64,sp // Restore stack pointer
2534 mov b0 = GR_SAVE_B0 // Restore return address
2538 mov gp = GR_SAVE_GP // Restore gp
2539 mov ar.pfs = GR_SAVE_PFS // Restore ar.pfs
2540 br.ret.sptk b0 // Return
2543 LOCAL_LIBM_END(__libm_error_region)
2545 .type __libm_error_support#,@function
2546 .global __libm_error_support#