]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/ia64/fpu/e_powf.S
ia64: strip trailing whitespace
[thirdparty/glibc.git] / sysdeps / ia64 / fpu / e_powf.S
1 .file "powf.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
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.
35 //
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.
39 //
40 // History
41 //==============================================================
42 // 02/02/00 Initial version
43 // 02/03/00 Added p12 to definite over/under path. With odd power we did not
44 // maintain the sign of x in this path.
45 // 04/04/00 Unwind support added
46 // 04/19/00 pow(+-1,inf) now returns NaN
47 // pow(+-val, +-inf) returns 0 or inf, but now does not call error
48 // support
49 // Added s1 to fcvt.fx because invalid flag was incorrectly set.
50 // 08/15/00 Bundle added after call to __libm_error_support to properly
51 // set [the previously overwritten] GR_Parameter_RESULT.
52 // 09/07/00 Improved performance by eliminating bank conflicts and other stalls,
53 // and tweaking the critical path
54 // 09/08/00 Per c99, pow(+-1,inf) now returns 1, and pow(+1,nan) returns 1
55 // 09/28/00 Updated NaN**0 path
56 // 01/20/01 Fixed denormal flag settings.
57 // 02/13/01 Improved speed.
58 // 03/19/01 Reordered exp polynomial to improve speed and eliminate monotonicity
59 // problem in round up, down, and to zero modes. Also corrected
60 // overflow result when x negative, y odd in round up, down, zero.
61 // 06/14/01 Added brace missing from bundle
62 // 12/10/01 Corrected case where x negative, 2^23 <= |y| < 2^24, y odd integer.
63 // 02/08/02 Fixed overflow/underflow cases that were not calling error support.
64 // 05/20/02 Cleaned up namespace and sf0 syntax
65 // 08/29/02 Improved Itanium 2 performance
66 // 02/10/03 Reordered header: .section, .global, .proc, .align
67 // 10/09/03 Modified algorithm to improve performance, reduce table size, and
68 // fix boundary case powf(2.0,-150.0)
69 // 03/31/05 Reformatted delimiters between data tables
70 //
71 // API
72 //==============================================================
73 // float powf(float x, float y)
74 //
75 // Overview of operation
76 //==============================================================
77 //
78 // Three steps...
79 // 1. Log(x)
80 // 2. y Log(x)
81 // 3. exp(y log(x))
82 //
83 // This means we work with the absolute value of x and merge in the sign later.
84 // Log(x) = G + delta + r -rsq/2 + p
85 // G,delta depend on the exponent of x and table entries. The table entries are
86 // indexed by the exponent of x, called K.
87 //
88 // The G and delta come out of the reduction; r is the reduced x.
89 //
90 // B = frcpa(x)
91 // xB-1 is small means that B is the approximate inverse of x.
92 //
93 // Log(x) = Log( (1/B)(Bx) )
94 // = Log(1/B) + Log(Bx)
95 // = Log(1/B) + Log( 1 + (Bx-1))
96 //
97 // x = 2^K 1.x_1x_2.....x_52
98 // B= frcpa(x) = 2^-k Cm
99 // Log(1/B) = Log(1/(2^-K Cm))
100 // Log(1/B) = Log((2^K/ Cm))
101 // Log(1/B) = K Log(2) + Log(1/Cm)
102 //
103 // Log(x) = K Log(2) + Log(1/Cm) + Log( 1 + (Bx-1))
104 //
105 // If you take the significand of x, set the exponent to true 0, then Cm is
106 // the frcpa. We tabulate the Log(1/Cm) values. There are 256 of them.
107 // The frcpa table is indexed by 8 bits, the x_1 thru x_8.
108 // m = x_1x_2...x_8 is an 8-bit index.
109 //
110 // Log(1/Cm) = log(1/frcpa(1+m/256)) where m goes from 0 to 255.
111 //
112 // We tabluate as one double, T for single precision power
113 //
114 // Log(x) = (K Log(2)_hi + T) + (K Log(2)_lo) + Log( 1 + (Bx-1))
115 // Log(x) = G + delta + Log( 1 + (Bx-1))
116 //
117 // The Log( 1 + (Bx-1)) can be calculated as a series in r = Bx-1.
118 //
119 // Log( 1 + (Bx-1)) = r - rsq/2 + p
120 // where p = r^3(P0 + P1*r + P2*r^2)
121 //
122 // Then,
123 //
124 // yLog(x) = yG + y delta + y(r-rsq/2) + yp
125 // yLog(x) = Z1 + e3 + Z2 + Z3
126 //
127 //
128 // exp(yLog(x)) = exp(Z1 + Z2) exp(Z3) exp(e3)
129 //
130 //
131 // exp(Z3) is another series.
132 // exp(e3) is approximated as f3 = 1 + e3
133 //
134 // exp(Z1 + Z2) = exp(Z)
135 // Z (128/log2) = number of log2/128 in Z is N
136 //
137 // s = Z - N log2/128
138 //
139 // exp(Z) = exp(s) exp(N log2/128)
140 //
141 // exp(r) = exp(Z - N log2/128)
142 //
143 // r = s + d = (Z - N (log2/128)_hi) -N (log2/128)_lo
144 // = Z - N (log2/128)
145 //
146 // Z = s+d +N (log2/128)
147 //
148 // exp(Z) = exp(s) (1+d) exp(N log2/128)
149 //
150 // N = M 128 + n
151 //
152 // N log2/128 = M log2 + n log2/128
153 //
154 // n is 8 binary digits = n_7n_6...n_1
155 //
156 // n log2/128 = n_7n_6n_5 16 log2/128 + n_4n_3n_2n_1 log2/128
157 // n log2/128 = n_7n_6n_5 log2/8 + n_4n_3n_2n_1 log2/128
158 // n log2/128 = I2 log2/8 + I1 log2/128
159 //
160 // N log2/128 = M log2 + I2 log2/8 + I1 log2/128
161 //
162 // exp(Z) = exp(s) (1+d) exp(log(2^M) + log(2^I2/8) + log(2^I1/128))
163 // exp(Z) = exp(s) f12 (2^M) 2^I2/8 2^I1/128
164 //
165 // I1, I2 are table indices. Use a series for exp(s).
166 // Then get exp(Z)
167 //
168 // exp(yLog(x)) = exp(Z) exp(Z3) f3
169 // exp(yLog(x)) = exp(Z)f3 exp(Z3)
170 // exp(yLog(x)) = A exp(Z3)
171 //
172 // We actually calculate exp(Z3) -1.
173 // Then,
174 // exp(yLog(x)) = A + A( exp(Z3) -1)
175 //
176
177 // Table Generation
178 //==============================================================
179
180 // The log values
181 // ==============
182 // The operation (K*log2_hi) must be exact. K is the true exponent of x.
183 // If we allow gradual underflow (denormals), K can be represented in 12 bits
184 // (as a two's complement number). We assume 13 bits as an engineering
185 // precaution.
186 //
187 // +------------+----------------+-+
188 // | 13 bits | 50 bits | |
189 // +------------+----------------+-+
190 // 0 1 66
191 // 2 34
192 //
193 // So we want the lsb(log2_hi) to be 2^-50
194 // We get log2 as a quad-extended (15-bit exponent, 128-bit significand)
195 //
196 // 0 fffe b17217f7d1cf79ab c9e3b39803f2f6af (4...)
197 //
198 // Consider numbering the bits left to right, starting at 0 thru 127.
199 // Bit 0 is the 2^-1 bit; bit 49 is the 2^-50 bit.
200 //
201 // ...79ab
202 // 0111 1001 1010 1011
203 // 44
204 // 89
205 //
206 // So if we shift off the rightmost 14 bits, then (shift back only
207 // the top half) we get
208 //
209 // 0 fffe b17217f7d1cf4000 e6af278ece600fcb dabc000000000000
210 //
211 // Put the right 64-bit signficand in an FR register, convert to double;
212 // it is exact. Put the next 128 bits into a quad register and round to double.
213 // The true exponent of the low part is -51.
214 //
215 // hi is 0 fffe b17217f7d1cf4000
216 // lo is 0 ffcc e6af278ece601000
217 //
218 // Convert to double memory format and get
219 //
220 // hi is 0x3fe62e42fefa39e8
221 // lo is 0x3cccd5e4f1d9cc02
222 //
223 // log2_hi + log2_lo is an accurate value for log2.
224 //
225 //
226 // The T and t values
227 // ==================
228 // A similar method is used to generate the T and t values.
229 //
230 // K * log2_hi + T must be exact.
231 //
232 // Smallest T,t
233 // ----------
234 // The smallest T,t is
235 // T t
236 // 0x3f60040155d58800, 0x3c93bce0ce3ddd81 log(1/frcpa(1+0/256))= +1.95503e-003
237 //
238 // The exponent is 0x3f6 (biased) or -9 (true).
239 // For the smallest T value, what we want is to clip the significand such that
240 // when it is shifted right by 9, its lsb is in the bit for 2^-51. The 9 is the
241 // specific for the first entry. In general, it is 0xffff - (biased 15-bit
242 // exponent).
243
244 // Independently, what we have calculated is the table value as a quad
245 // precision number.
246 // Table entry 1 is
247 // 0 fff6 80200aaeac44ef38 338f77605fdf8000
248 //
249 // We store this quad precision number in a data structure that is
250 // sign: 1
251 // exponent: 15
252 // signficand_hi: 64 (includes explicit bit)
253 // signficand_lo: 49
254 // Because the explicit bit is included, the significand is 113 bits.
255 //
256 // Consider significand_hi for table entry 1.
257 //
258 //
259 // +-+--- ... -------+--------------------+
260 // | |
261 // +-+--- ... -------+--------------------+
262 // 0 1 4444444455555555556666
263 // 2345678901234567890123
264 //
265 // Labeled as above, bit 0 is 2^0, bit 1 is 2^-1, etc.
266 // Bit 42 is 2^-42. If we shift to the right by 9, the bit in
267 // bit 42 goes in 51.
268 //
269 // So what we want to do is shift bits 43 thru 63 into significand_lo.
270 // This is shifting bit 42 into bit 63, taking care to retain shifted-off bits.
271 // Then shifting (just with signficaand_hi) back into bit 42.
272 //
273 // The shift_value is 63-42 = 21. In general, this is
274 // 63 - (51 -(0xffff - 0xfff6))
275 // For this example, it is
276 // 63 - (51 - 9) = 63 - 42 = 21
277 //
278 // This means we are shifting 21 bits into significand_lo. We must maintain more
279 // that a 128-bit signficand not to lose bits. So before the shift we put the
280 // 128-bit significand into a 256-bit signficand and then shift.
281 // The 256-bit significand has four parts: hh, hl, lh, and ll.
282 //
283 // Start off with
284 // hh hl lh ll
285 // <64> <49><15_0> <64_0> <64_0>
286 //
287 // After shift by 21 (then return for significand_hi),
288 // <43><21_0> <21><43> <6><58_0> <64_0>
289 //
290 // Take the hh part and convert to a double. There is no rounding here.
291 // The conversion is exact. The true exponent of the high part is the same as
292 // the true exponent of the input quad.
293 //
294 // We have some 64 plus significand bits for the low part. In this example, we
295 // have 70 bits. We want to round this to a double. Put them in a quad and then
296 // do a quad fnorm.
297 // For this example the true exponent of the low part is
298 // true_exponent_of_high - 43 = true_exponent_of_high - (64-21)
299 // In general, this is
300 // true_exponent_of_high - (64 - shift_value)
301 //
302 //
303 // Largest T,t
304 // ----------
305 // The largest T,t is
306 // 0x3fe62643fecf9742, 0x3c9e3147684bd37d log(1/frcpa(1+255/256))=+6.92171e-001
307 //
308 // Table entry 256 is
309 // 0 fffe b1321ff67cba178c 51da12f4df5a0000
310 //
311 // The shift value is
312 // 63 - (51 -(0xffff - 0xfffe)) = 13
313 //
314 // The true exponent of the low part is
315 // true_exponent_of_high - (64 - shift_value)
316 // -1 - (64-13) = -52
317 // Biased as a double, this is 0x3cb
318 //
319 //
320 //
321 // So then lsb(T) must be >= 2^-51
322 // msb(Klog2_hi) <= 2^12
323 //
324 // +--------+---------+
325 // | 51 bits | <== largest T
326 // +--------+---------+
327 // | 9 bits | 42 bits | <== smallest T
328 // +------------+----------------+-+
329 // | 13 bits | 50 bits | |
330 // +------------+----------------+-+
331 //
332 // Note: For powf only the table of T is needed
333
334
335 // Special Cases
336 //==============================================================
337
338 // double float
339 // overflow error 24 30
340
341 // underflow error 25 31
342
343 // X zero Y zero
344 // +0 +0 +1 error 26 32
345 // -0 +0 +1 error 26 32
346 // +0 -0 +1 error 26 32
347 // -0 -0 +1 error 26 32
348
349 // X zero Y negative
350 // +0 -odd integer +inf error 27 33 divide-by-zero
351 // -0 -odd integer -inf error 27 33 divide-by-zero
352 // +0 !-odd integer +inf error 27 33 divide-by-zero
353 // -0 !-odd integer +inf error 27 33 divide-by-zero
354 // +0 -inf +inf error 27 33 divide-by-zero
355 // -0 -inf +inf error 27 33 divide-by-zero
356
357 // X zero Y positve
358 // +0 +odd integer +0
359 // -0 +odd integer -0
360 // +0 !+odd integer +0
361 // -0 !+odd integer +0
362 // +0 +inf +0
363 // -0 +inf +0
364 // +0 Y NaN quiet Y invalid if Y SNaN
365 // -0 Y NaN quiet Y invalid if Y SNaN
366
367 // X one
368 // -1 Y inf +1
369 // -1 Y NaN quiet Y invalid if Y SNaN
370 // +1 Y NaN +1 invalid if Y SNaN
371 // +1 Y any else +1
372
373 // X - Y not integer QNAN error 28 34 invalid
374
375 // X NaN Y 0 +1 error 29 35
376 // X NaN Y NaN quiet X invalid if X or Y SNaN
377 // X NaN Y any else quiet X invalid if X SNaN
378 // X !+1 Y NaN quiet Y invalid if Y SNaN
379
380
381 // X +inf Y >0 +inf
382 // X -inf Y >0, !odd integer +inf
383 // X -inf Y >0, odd integer -inf
384
385 // X +inf Y <0 +0
386 // X -inf Y <0, !odd integer +0
387 // X -inf Y <0, odd integer -0
388
389 // X +inf Y =0 +1
390 // X -inf Y =0 +1
391
392 // |X|<1 Y +inf +0
393 // |X|<1 Y -inf +inf
394 // |X|>1 Y +inf +inf
395 // |X|>1 Y -inf +0
396
397 // X any Y =0 +1
398
399 // Assembly macros
400 //==============================================================
401
402 // integer registers used
403
404 pow_GR_exp_half = r10
405 pow_GR_signexp_Xm1 = r11
406 pow_GR_tmp = r11
407
408 pow_GR_signexp_X = r14
409 pow_GR_17ones = r15
410 pow_GR_Fpsr = r15
411 pow_AD_P = r16
412 pow_GR_rcs0_mask = r16
413 pow_GR_exp_2tom8 = r17
414 pow_GR_rcs0 = r17
415 pow_GR_sig_X = r18
416 pow_GR_10033 = r19
417 pow_GR_16ones = r20
418
419 pow_AD_Tt = r21
420 pow_GR_exp_X = r22
421 pow_AD_Q = r23
422 pow_GR_true_exp_X = r24
423 pow_GR_y_zero = r25
424
425 pow_GR_exp_Y = r26
426 pow_AD_tbl1 = r27
427 pow_AD_tbl2 = r28
428 pow_GR_offset = r29
429 pow_GR_exp_Xm1 = r30
430 pow_GR_xneg_yodd = r31
431
432 pow_GR_int_N = r38
433 pow_GR_index1 = r39
434 pow_GR_index2 = r40
435
436 pow_AD_T1 = r41
437 pow_AD_T2 = r42
438 pow_int_GR_M = r43
439 pow_GR_sig_int_Y = r44
440 pow_GR_sign_Y_Gpr = r45
441
442 pow_GR_17ones_m1 = r46
443 pow_GR_one = r47
444 pow_GR_sign_Y = r48
445 pow_GR_signexp_Y_Gpr = r49
446 pow_GR_exp_Y_Gpr = r50
447
448 pow_GR_true_exp_Y_Gpr = r51
449 pow_GR_signexp_Y = r52
450 pow_GR_x_one = r53
451 pow_GR_big_pos = r55
452
453 pow_GR_big_neg = r56
454
455 GR_SAVE_B0 = r50
456 GR_SAVE_GP = r51
457 GR_SAVE_PFS = r52
458
459 GR_Parameter_X = r53
460 GR_Parameter_Y = r54
461 GR_Parameter_RESULT = r55
462 pow_GR_tag = r56
463
464
465 // floating point registers used
466
467 POW_B = f32
468 POW_NORM_X = f33
469 POW_Xm1 = f34
470 POW_r1 = f34
471
472 POW_NORM_Y = f37
473 POW_Q2 = f38
474 POW_eps = f39
475 POW_P2 = f40
476
477 POW_P0 = f42
478 POW_log2_lo = f43
479 POW_r = f44
480 POW_Q0_half = f45
481
482 POW_tmp = f47
483 POW_log2_hi = f48
484 POW_Q1 = f49
485 POW_P1 = f50
486
487 POW_log2_by_128_hi = f51
488 POW_inv_log2_by_128 = f52
489 POW_rsq = f53
490 POW_Yrcub = f54
491 POW_log2_by_128_lo = f55
492
493 POW_xsq = f57
494 POW_v2 = f59
495 POW_T = f60
496
497 POW_RSHF = f62
498 POW_v210 = f63
499 POW_twoV = f65
500
501 POW_U = f66
502 POW_G = f67
503 POW_delta = f68
504 POW_V = f70
505
506 POW_p = f71
507 POW_Z = f72
508 POW_e3 = f73
509 POW_Z2 = f75
510
511 POW_W1 = f77
512 POW_Z3 = f80
513
514 POW_Z3sq = f85
515
516 POW_Nfloat = f87
517 POW_f3 = f89
518 POW_q = f90
519
520 POW_T1 = f96
521 POW_T2 = f97
522 POW_2M = f98
523 POW_s = f99
524 POW_f12 = f100
525
526 POW_ssq = f101
527 POW_T1T2 = f102
528 POW_1ps = f103
529 POW_A = f104
530 POW_es = f105
531
532 POW_Xp1 = f106
533 POW_int_K = f107
534 POW_K = f108
535 POW_f123 = f109
536 POW_Gpr = f110
537
538 POW_Y_Gpr = f111
539 POW_int_Y = f112
540 POW_2Mqp1 = f113
541
542 POW_float_int_Y = f116
543 POW_ftz_urm_f8 = f117
544 POW_wre_urm_f8 = f118
545 POW_big_neg = f119
546 POW_big_pos = f120
547
548 // Data tables
549 //==============================================================
550
551 RODATA
552
553 .align 16
554
555 LOCAL_OBJECT_START(pow_table_P)
556 data8 0x80000000000018E5, 0x0000BFFD // P_1
557 data8 0xb8aa3b295c17f0bc, 0x00004006 // inv_ln2_by_128
558 //
559 //
560 data8 0x3FA5555555554A9E // Q_2
561 data8 0x0000000000000000 // Pad
562 data8 0x3FC5555555554733 // Q_1
563 data8 0x43e8000000000000 // Right shift constant for exp
564 data8 0xc9e3b39803f2f6af, 0x00003fb7 // ln2_by_128_lo
565 LOCAL_OBJECT_END(pow_table_P)
566
567 LOCAL_OBJECT_START(pow_table_Q)
568 data8 0xCCCCCCCC4ED2BA7F, 0x00003FFC // P_2
569 data8 0xAAAAAAAAAAAAB505, 0x00003FFD // P_0
570 data8 0x3fe62e42fefa39e8, 0x3cccd5e4f1d9cc02 // log2 hi lo = +6.93147e-001
571 data8 0xb17217f7d1cf79ab, 0x00003ff7 // ln2_by_128_hi
572 LOCAL_OBJECT_END(pow_table_Q)
573
574
575 LOCAL_OBJECT_START(pow_Tt)
576 data8 0x3f60040155d58800 // log(1/frcpa(1+0/256))= +1.95503e-003
577 data8 0x3f78121214586a00 // log(1/frcpa(1+1/256))= +5.87661e-003
578 data8 0x3f841929f9683200 // log(1/frcpa(1+2/256))= +9.81362e-003
579 data8 0x3f8c317384c75f00 // log(1/frcpa(1+3/256))= +1.37662e-002
580 data8 0x3f91a6b91ac73380 // log(1/frcpa(1+4/256))= +1.72376e-002
581 data8 0x3f95ba9a5d9ac000 // log(1/frcpa(1+5/256))= +2.12196e-002
582 data8 0x3f99d2a807432580 // log(1/frcpa(1+6/256))= +2.52177e-002
583 data8 0x3f9d6b2725979800 // log(1/frcpa(1+7/256))= +2.87291e-002
584 data8 0x3fa0c58fa19dfa80 // log(1/frcpa(1+8/256))= +3.27573e-002
585 data8 0x3fa2954c78cbce00 // log(1/frcpa(1+9/256))= +3.62953e-002
586 data8 0x3fa4a94d2da96c40 // log(1/frcpa(1+10/256))= +4.03542e-002
587 data8 0x3fa67c94f2d4bb40 // log(1/frcpa(1+11/256))= +4.39192e-002
588 data8 0x3fa85188b630f040 // log(1/frcpa(1+12/256))= +4.74971e-002
589 data8 0x3faa6b8abe73af40 // log(1/frcpa(1+13/256))= +5.16017e-002
590 data8 0x3fac441e06f72a80 // log(1/frcpa(1+14/256))= +5.52072e-002
591 data8 0x3fae1e6713606d00 // log(1/frcpa(1+15/256))= +5.88257e-002
592 data8 0x3faffa6911ab9300 // log(1/frcpa(1+16/256))= +6.24574e-002
593 data8 0x3fb0ec139c5da600 // log(1/frcpa(1+17/256))= +6.61022e-002
594 data8 0x3fb1dbd2643d1900 // log(1/frcpa(1+18/256))= +6.97605e-002
595 data8 0x3fb2cc7284fe5f00 // log(1/frcpa(1+19/256))= +7.34321e-002
596 data8 0x3fb3bdf5a7d1ee60 // log(1/frcpa(1+20/256))= +7.71173e-002
597 data8 0x3fb4b05d7aa012e0 // log(1/frcpa(1+21/256))= +8.08161e-002
598 data8 0x3fb580db7ceb5700 // log(1/frcpa(1+22/256))= +8.39975e-002
599 data8 0x3fb674f089365a60 // log(1/frcpa(1+23/256))= +8.77219e-002
600 data8 0x3fb769ef2c6b5680 // log(1/frcpa(1+24/256))= +9.14602e-002
601 data8 0x3fb85fd927506a40 // log(1/frcpa(1+25/256))= +9.52125e-002
602 data8 0x3fb9335e5d594980 // log(1/frcpa(1+26/256))= +9.84401e-002
603 data8 0x3fba2b0220c8e5e0 // log(1/frcpa(1+27/256))= +1.02219e-001
604 data8 0x3fbb0004ac1a86a0 // log(1/frcpa(1+28/256))= +1.05469e-001
605 data8 0x3fbbf968769fca00 // log(1/frcpa(1+29/256))= +1.09274e-001
606 data8 0x3fbccfedbfee13a0 // log(1/frcpa(1+30/256))= +1.12548e-001
607 data8 0x3fbda727638446a0 // log(1/frcpa(1+31/256))= +1.15832e-001
608 data8 0x3fbea3257fe10f60 // log(1/frcpa(1+32/256))= +1.19677e-001
609 data8 0x3fbf7be9fedbfde0 // log(1/frcpa(1+33/256))= +1.22985e-001
610 data8 0x3fc02ab352ff25f0 // log(1/frcpa(1+34/256))= +1.26303e-001
611 data8 0x3fc097ce579d2040 // log(1/frcpa(1+35/256))= +1.29633e-001
612 data8 0x3fc1178e8227e470 // log(1/frcpa(1+36/256))= +1.33531e-001
613 data8 0x3fc185747dbecf30 // log(1/frcpa(1+37/256))= +1.36885e-001
614 data8 0x3fc1f3b925f25d40 // log(1/frcpa(1+38/256))= +1.40250e-001
615 data8 0x3fc2625d1e6ddf50 // log(1/frcpa(1+39/256))= +1.43627e-001
616 data8 0x3fc2d1610c868130 // log(1/frcpa(1+40/256))= +1.47015e-001
617 data8 0x3fc340c597411420 // log(1/frcpa(1+41/256))= +1.50414e-001
618 data8 0x3fc3b08b6757f2a0 // log(1/frcpa(1+42/256))= +1.53825e-001
619 data8 0x3fc40dfb08378000 // log(1/frcpa(1+43/256))= +1.56677e-001
620 data8 0x3fc47e74e8ca5f70 // log(1/frcpa(1+44/256))= +1.60109e-001
621 data8 0x3fc4ef51f6466de0 // log(1/frcpa(1+45/256))= +1.63553e-001
622 data8 0x3fc56092e02ba510 // log(1/frcpa(1+46/256))= +1.67010e-001
623 data8 0x3fc5d23857cd74d0 // log(1/frcpa(1+47/256))= +1.70478e-001
624 data8 0x3fc6313a37335d70 // log(1/frcpa(1+48/256))= +1.73377e-001
625 data8 0x3fc6a399dabbd380 // log(1/frcpa(1+49/256))= +1.76868e-001
626 data8 0x3fc70337dd3ce410 // log(1/frcpa(1+50/256))= +1.79786e-001
627 data8 0x3fc77654128f6120 // log(1/frcpa(1+51/256))= +1.83299e-001
628 data8 0x3fc7e9d82a0b0220 // log(1/frcpa(1+52/256))= +1.86824e-001
629 data8 0x3fc84a6b759f5120 // log(1/frcpa(1+53/256))= +1.89771e-001
630 data8 0x3fc8ab47d5f5a300 // log(1/frcpa(1+54/256))= +1.92727e-001
631 data8 0x3fc91fe490965810 // log(1/frcpa(1+55/256))= +1.96286e-001
632 data8 0x3fc981634011aa70 // log(1/frcpa(1+56/256))= +1.99261e-001
633 data8 0x3fc9f6c407089660 // log(1/frcpa(1+57/256))= +2.02843e-001
634 data8 0x3fca58e729348f40 // log(1/frcpa(1+58/256))= +2.05838e-001
635 data8 0x3fcabb55c31693a0 // log(1/frcpa(1+59/256))= +2.08842e-001
636 data8 0x3fcb1e104919efd0 // log(1/frcpa(1+60/256))= +2.11855e-001
637 data8 0x3fcb94ee93e367c0 // log(1/frcpa(1+61/256))= +2.15483e-001
638 data8 0x3fcbf851c0675550 // log(1/frcpa(1+62/256))= +2.18516e-001
639 data8 0x3fcc5c0254bf23a0 // log(1/frcpa(1+63/256))= +2.21558e-001
640 data8 0x3fccc000c9db3c50 // log(1/frcpa(1+64/256))= +2.24609e-001
641 data8 0x3fcd244d99c85670 // log(1/frcpa(1+65/256))= +2.27670e-001
642 data8 0x3fcd88e93fb2f450 // log(1/frcpa(1+66/256))= +2.30741e-001
643 data8 0x3fcdedd437eaef00 // log(1/frcpa(1+67/256))= +2.33820e-001
644 data8 0x3fce530effe71010 // log(1/frcpa(1+68/256))= +2.36910e-001
645 data8 0x3fceb89a1648b970 // log(1/frcpa(1+69/256))= +2.40009e-001
646 data8 0x3fcf1e75fadf9bd0 // log(1/frcpa(1+70/256))= +2.43117e-001
647 data8 0x3fcf84a32ead7c30 // log(1/frcpa(1+71/256))= +2.46235e-001
648 data8 0x3fcfeb2233ea07c0 // log(1/frcpa(1+72/256))= +2.49363e-001
649 data8 0x3fd028f9c7035c18 // log(1/frcpa(1+73/256))= +2.52501e-001
650 data8 0x3fd05c8be0d96358 // log(1/frcpa(1+74/256))= +2.55649e-001
651 data8 0x3fd085eb8f8ae790 // log(1/frcpa(1+75/256))= +2.58174e-001
652 data8 0x3fd0b9c8e32d1910 // log(1/frcpa(1+76/256))= +2.61339e-001
653 data8 0x3fd0edd060b78080 // log(1/frcpa(1+77/256))= +2.64515e-001
654 data8 0x3fd122024cf00638 // log(1/frcpa(1+78/256))= +2.67701e-001
655 data8 0x3fd14be2927aecd0 // log(1/frcpa(1+79/256))= +2.70257e-001
656 data8 0x3fd180618ef18ad8 // log(1/frcpa(1+80/256))= +2.73461e-001
657 data8 0x3fd1b50bbe2fc638 // log(1/frcpa(1+81/256))= +2.76675e-001
658 data8 0x3fd1df4cc7cf2428 // log(1/frcpa(1+82/256))= +2.79254e-001
659 data8 0x3fd214456d0eb8d0 // log(1/frcpa(1+83/256))= +2.82487e-001
660 data8 0x3fd23ec5991eba48 // log(1/frcpa(1+84/256))= +2.85081e-001
661 data8 0x3fd2740d9f870af8 // log(1/frcpa(1+85/256))= +2.88333e-001
662 data8 0x3fd29ecdabcdfa00 // log(1/frcpa(1+86/256))= +2.90943e-001
663 data8 0x3fd2d46602adcce8 // log(1/frcpa(1+87/256))= +2.94214e-001
664 data8 0x3fd2ff66b04ea9d0 // log(1/frcpa(1+88/256))= +2.96838e-001
665 data8 0x3fd335504b355a30 // log(1/frcpa(1+89/256))= +3.00129e-001
666 data8 0x3fd360925ec44f58 // log(1/frcpa(1+90/256))= +3.02769e-001
667 data8 0x3fd38bf1c3337e70 // log(1/frcpa(1+91/256))= +3.05417e-001
668 data8 0x3fd3c25277333180 // log(1/frcpa(1+92/256))= +3.08735e-001
669 data8 0x3fd3edf463c16838 // log(1/frcpa(1+93/256))= +3.11399e-001
670 data8 0x3fd419b423d5e8c0 // log(1/frcpa(1+94/256))= +3.14069e-001
671 data8 0x3fd44591e0539f48 // log(1/frcpa(1+95/256))= +3.16746e-001
672 data8 0x3fd47c9175b6f0a8 // log(1/frcpa(1+96/256))= +3.20103e-001
673 data8 0x3fd4a8b341552b08 // log(1/frcpa(1+97/256))= +3.22797e-001
674 data8 0x3fd4d4f390890198 // log(1/frcpa(1+98/256))= +3.25498e-001
675 data8 0x3fd501528da1f960 // log(1/frcpa(1+99/256))= +3.28206e-001
676 data8 0x3fd52dd06347d4f0 // log(1/frcpa(1+100/256))= +3.30921e-001
677 data8 0x3fd55a6d3c7b8a88 // log(1/frcpa(1+101/256))= +3.33644e-001
678 data8 0x3fd5925d2b112a58 // log(1/frcpa(1+102/256))= +3.37058e-001
679 data8 0x3fd5bf406b543db0 // log(1/frcpa(1+103/256))= +3.39798e-001
680 data8 0x3fd5ec433d5c35a8 // log(1/frcpa(1+104/256))= +3.42545e-001
681 data8 0x3fd61965cdb02c18 // log(1/frcpa(1+105/256))= +3.45300e-001
682 data8 0x3fd646a84935b2a0 // log(1/frcpa(1+106/256))= +3.48063e-001
683 data8 0x3fd6740add31de90 // log(1/frcpa(1+107/256))= +3.50833e-001
684 data8 0x3fd6a18db74a58c0 // log(1/frcpa(1+108/256))= +3.53610e-001
685 data8 0x3fd6cf31058670e8 // log(1/frcpa(1+109/256))= +3.56396e-001
686 data8 0x3fd6f180e852f0b8 // log(1/frcpa(1+110/256))= +3.58490e-001
687 data8 0x3fd71f5d71b894e8 // log(1/frcpa(1+111/256))= +3.61289e-001
688 data8 0x3fd74d5aefd66d58 // log(1/frcpa(1+112/256))= +3.64096e-001
689 data8 0x3fd77b79922bd378 // log(1/frcpa(1+113/256))= +3.66911e-001
690 data8 0x3fd7a9b9889f19e0 // log(1/frcpa(1+114/256))= +3.69734e-001
691 data8 0x3fd7d81b037eb6a0 // log(1/frcpa(1+115/256))= +3.72565e-001
692 data8 0x3fd8069e33827230 // log(1/frcpa(1+116/256))= +3.75404e-001
693 data8 0x3fd82996d3ef8bc8 // log(1/frcpa(1+117/256))= +3.77538e-001
694 data8 0x3fd85855776dcbf8 // log(1/frcpa(1+118/256))= +3.80391e-001
695 data8 0x3fd8873658327cc8 // log(1/frcpa(1+119/256))= +3.83253e-001
696 data8 0x3fd8aa75973ab8c8 // log(1/frcpa(1+120/256))= +3.85404e-001
697 data8 0x3fd8d992dc8824e0 // log(1/frcpa(1+121/256))= +3.88280e-001
698 data8 0x3fd908d2ea7d9510 // log(1/frcpa(1+122/256))= +3.91164e-001
699 data8 0x3fd92c59e79c0e50 // log(1/frcpa(1+123/256))= +3.93332e-001
700 data8 0x3fd95bd750ee3ed0 // log(1/frcpa(1+124/256))= +3.96231e-001
701 data8 0x3fd98b7811a3ee58 // log(1/frcpa(1+125/256))= +3.99138e-001
702 data8 0x3fd9af47f33d4068 // log(1/frcpa(1+126/256))= +4.01323e-001
703 data8 0x3fd9df270c1914a0 // log(1/frcpa(1+127/256))= +4.04245e-001
704 data8 0x3fda0325ed14fda0 // log(1/frcpa(1+128/256))= +4.06442e-001
705 data8 0x3fda33440224fa78 // log(1/frcpa(1+129/256))= +4.09379e-001
706 data8 0x3fda57725e80c380 // log(1/frcpa(1+130/256))= +4.11587e-001
707 data8 0x3fda87d0165dd198 // log(1/frcpa(1+131/256))= +4.14539e-001
708 data8 0x3fdaac2e6c03f890 // log(1/frcpa(1+132/256))= +4.16759e-001
709 data8 0x3fdadccc6fdf6a80 // log(1/frcpa(1+133/256))= +4.19726e-001
710 data8 0x3fdb015b3eb1e790 // log(1/frcpa(1+134/256))= +4.21958e-001
711 data8 0x3fdb323a3a635948 // log(1/frcpa(1+135/256))= +4.24941e-001
712 data8 0x3fdb56fa04462908 // log(1/frcpa(1+136/256))= +4.27184e-001
713 data8 0x3fdb881aa659bc90 // log(1/frcpa(1+137/256))= +4.30182e-001
714 data8 0x3fdbad0bef3db160 // log(1/frcpa(1+138/256))= +4.32437e-001
715 data8 0x3fdbd21297781c28 // log(1/frcpa(1+139/256))= +4.34697e-001
716 data8 0x3fdc039236f08818 // log(1/frcpa(1+140/256))= +4.37718e-001
717 data8 0x3fdc28cb1e4d32f8 // log(1/frcpa(1+141/256))= +4.39990e-001
718 data8 0x3fdc4e19b84723c0 // log(1/frcpa(1+142/256))= +4.42267e-001
719 data8 0x3fdc7ff9c74554c8 // log(1/frcpa(1+143/256))= +4.45311e-001
720 data8 0x3fdca57b64e9db00 // log(1/frcpa(1+144/256))= +4.47600e-001
721 data8 0x3fdccb130a5ceba8 // log(1/frcpa(1+145/256))= +4.49895e-001
722 data8 0x3fdcf0c0d18f3268 // log(1/frcpa(1+146/256))= +4.52194e-001
723 data8 0x3fdd232075b5a200 // log(1/frcpa(1+147/256))= +4.55269e-001
724 data8 0x3fdd490246defa68 // log(1/frcpa(1+148/256))= +4.57581e-001
725 data8 0x3fdd6efa918d25c8 // log(1/frcpa(1+149/256))= +4.59899e-001
726 data8 0x3fdd9509707ae528 // log(1/frcpa(1+150/256))= +4.62221e-001
727 data8 0x3fddbb2efe92c550 // log(1/frcpa(1+151/256))= +4.64550e-001
728 data8 0x3fddee2f3445e4a8 // log(1/frcpa(1+152/256))= +4.67663e-001
729 data8 0x3fde148a1a2726c8 // log(1/frcpa(1+153/256))= +4.70004e-001
730 data8 0x3fde3afc0a49ff38 // log(1/frcpa(1+154/256))= +4.72350e-001
731 data8 0x3fde6185206d5168 // log(1/frcpa(1+155/256))= +4.74702e-001
732 data8 0x3fde882578823d50 // log(1/frcpa(1+156/256))= +4.77060e-001
733 data8 0x3fdeaedd2eac9908 // log(1/frcpa(1+157/256))= +4.79423e-001
734 data8 0x3fded5ac5f436be0 // log(1/frcpa(1+158/256))= +4.81792e-001
735 data8 0x3fdefc9326d16ab8 // log(1/frcpa(1+159/256))= +4.84166e-001
736 data8 0x3fdf2391a21575f8 // log(1/frcpa(1+160/256))= +4.86546e-001
737 data8 0x3fdf4aa7ee031928 // log(1/frcpa(1+161/256))= +4.88932e-001
738 data8 0x3fdf71d627c30bb0 // log(1/frcpa(1+162/256))= +4.91323e-001
739 data8 0x3fdf991c6cb3b378 // log(1/frcpa(1+163/256))= +4.93720e-001
740 data8 0x3fdfc07ada69a908 // log(1/frcpa(1+164/256))= +4.96123e-001
741 data8 0x3fdfe7f18eb03d38 // log(1/frcpa(1+165/256))= +4.98532e-001
742 data8 0x3fe007c053c5002c // log(1/frcpa(1+166/256))= +5.00946e-001
743 data8 0x3fe01b942198a5a0 // log(1/frcpa(1+167/256))= +5.03367e-001
744 data8 0x3fe02f74400c64e8 // log(1/frcpa(1+168/256))= +5.05793e-001
745 data8 0x3fe04360be7603ac // log(1/frcpa(1+169/256))= +5.08225e-001
746 data8 0x3fe05759ac47fe30 // log(1/frcpa(1+170/256))= +5.10663e-001
747 data8 0x3fe06b5f1911cf50 // log(1/frcpa(1+171/256))= +5.13107e-001
748 data8 0x3fe078bf0533c568 // log(1/frcpa(1+172/256))= +5.14740e-001
749 data8 0x3fe08cd9687e7b0c // log(1/frcpa(1+173/256))= +5.17194e-001
750 data8 0x3fe0a10074cf9018 // log(1/frcpa(1+174/256))= +5.19654e-001
751 data8 0x3fe0b5343a234474 // log(1/frcpa(1+175/256))= +5.22120e-001
752 data8 0x3fe0c974c89431cc // log(1/frcpa(1+176/256))= +5.24592e-001
753 data8 0x3fe0ddc2305b9884 // log(1/frcpa(1+177/256))= +5.27070e-001
754 data8 0x3fe0eb524bafc918 // log(1/frcpa(1+178/256))= +5.28726e-001
755 data8 0x3fe0ffb54213a474 // log(1/frcpa(1+179/256))= +5.31214e-001
756 data8 0x3fe114253da97d9c // log(1/frcpa(1+180/256))= +5.33709e-001
757 data8 0x3fe128a24f1d9afc // log(1/frcpa(1+181/256))= +5.36210e-001
758 data8 0x3fe1365252bf0864 // log(1/frcpa(1+182/256))= +5.37881e-001
759 data8 0x3fe14ae558b4a92c // log(1/frcpa(1+183/256))= +5.40393e-001
760 data8 0x3fe15f85a19c7658 // log(1/frcpa(1+184/256))= +5.42910e-001
761 data8 0x3fe16d4d38c119f8 // log(1/frcpa(1+185/256))= +5.44592e-001
762 data8 0x3fe18203c20dd130 // log(1/frcpa(1+186/256))= +5.47121e-001
763 data8 0x3fe196c7bc4b1f38 // log(1/frcpa(1+187/256))= +5.49656e-001
764 data8 0x3fe1a4a738b7a33c // log(1/frcpa(1+188/256))= +5.51349e-001
765 data8 0x3fe1b981c0c9653c // log(1/frcpa(1+189/256))= +5.53895e-001
766 data8 0x3fe1ce69e8bb1068 // log(1/frcpa(1+190/256))= +5.56447e-001
767 data8 0x3fe1dc619de06944 // log(1/frcpa(1+191/256))= +5.58152e-001
768 data8 0x3fe1f160a2ad0da0 // log(1/frcpa(1+192/256))= +5.60715e-001
769 data8 0x3fe2066d7740737c // log(1/frcpa(1+193/256))= +5.63285e-001
770 data8 0x3fe2147dba47a390 // log(1/frcpa(1+194/256))= +5.65001e-001
771 data8 0x3fe229a1bc5ebac0 // log(1/frcpa(1+195/256))= +5.67582e-001
772 data8 0x3fe237c1841a502c // log(1/frcpa(1+196/256))= +5.69306e-001
773 data8 0x3fe24cfce6f80d98 // log(1/frcpa(1+197/256))= +5.71898e-001
774 data8 0x3fe25b2c55cd5760 // log(1/frcpa(1+198/256))= +5.73630e-001
775 data8 0x3fe2707f4d5f7c40 // log(1/frcpa(1+199/256))= +5.76233e-001
776 data8 0x3fe285e0842ca380 // log(1/frcpa(1+200/256))= +5.78842e-001
777 data8 0x3fe294294708b770 // log(1/frcpa(1+201/256))= +5.80586e-001
778 data8 0x3fe2a9a2670aff0c // log(1/frcpa(1+202/256))= +5.83207e-001
779 data8 0x3fe2b7fb2c8d1cc0 // log(1/frcpa(1+203/256))= +5.84959e-001
780 data8 0x3fe2c65a6395f5f4 // log(1/frcpa(1+204/256))= +5.86713e-001
781 data8 0x3fe2dbf557b0df40 // log(1/frcpa(1+205/256))= +5.89350e-001
782 data8 0x3fe2ea64c3f97654 // log(1/frcpa(1+206/256))= +5.91113e-001
783 data8 0x3fe3001823684d70 // log(1/frcpa(1+207/256))= +5.93762e-001
784 data8 0x3fe30e97e9a8b5cc // log(1/frcpa(1+208/256))= +5.95531e-001
785 data8 0x3fe32463ebdd34e8 // log(1/frcpa(1+209/256))= +5.98192e-001
786 data8 0x3fe332f4314ad794 // log(1/frcpa(1+210/256))= +5.99970e-001
787 data8 0x3fe348d90e7464cc // log(1/frcpa(1+211/256))= +6.02643e-001
788 data8 0x3fe35779f8c43d6c // log(1/frcpa(1+212/256))= +6.04428e-001
789 data8 0x3fe36621961a6a98 // log(1/frcpa(1+213/256))= +6.06217e-001
790 data8 0x3fe37c299f3c3668 // log(1/frcpa(1+214/256))= +6.08907e-001
791 data8 0x3fe38ae2171976e4 // log(1/frcpa(1+215/256))= +6.10704e-001
792 data8 0x3fe399a157a603e4 // log(1/frcpa(1+216/256))= +6.12504e-001
793 data8 0x3fe3afccfe77b9d0 // log(1/frcpa(1+217/256))= +6.15210e-001
794 data8 0x3fe3be9d503533b4 // log(1/frcpa(1+218/256))= +6.17018e-001
795 data8 0x3fe3cd7480b4a8a0 // log(1/frcpa(1+219/256))= +6.18830e-001
796 data8 0x3fe3e3c43918f76c // log(1/frcpa(1+220/256))= +6.21554e-001
797 data8 0x3fe3f2acb27ed6c4 // log(1/frcpa(1+221/256))= +6.23373e-001
798 data8 0x3fe4019c2125ca90 // log(1/frcpa(1+222/256))= +6.25197e-001
799 data8 0x3fe4181061389720 // log(1/frcpa(1+223/256))= +6.27937e-001
800 data8 0x3fe42711518df544 // log(1/frcpa(1+224/256))= +6.29769e-001
801 data8 0x3fe436194e12b6bc // log(1/frcpa(1+225/256))= +6.31604e-001
802 data8 0x3fe445285d68ea68 // log(1/frcpa(1+226/256))= +6.33442e-001
803 data8 0x3fe45bcc464c8938 // log(1/frcpa(1+227/256))= +6.36206e-001
804 data8 0x3fe46aed21f117fc // log(1/frcpa(1+228/256))= +6.38053e-001
805 data8 0x3fe47a1527e8a2d0 // log(1/frcpa(1+229/256))= +6.39903e-001
806 data8 0x3fe489445efffcc8 // log(1/frcpa(1+230/256))= +6.41756e-001
807 data8 0x3fe4a018bcb69834 // log(1/frcpa(1+231/256))= +6.44543e-001
808 data8 0x3fe4af5a0c9d65d4 // log(1/frcpa(1+232/256))= +6.46405e-001
809 data8 0x3fe4bea2a5bdbe84 // log(1/frcpa(1+233/256))= +6.48271e-001
810 data8 0x3fe4cdf28f10ac44 // log(1/frcpa(1+234/256))= +6.50140e-001
811 data8 0x3fe4dd49cf994058 // log(1/frcpa(1+235/256))= +6.52013e-001
812 data8 0x3fe4eca86e64a680 // log(1/frcpa(1+236/256))= +6.53889e-001
813 data8 0x3fe503c43cd8eb68 // log(1/frcpa(1+237/256))= +6.56710e-001
814 data8 0x3fe513356667fc54 // log(1/frcpa(1+238/256))= +6.58595e-001
815 data8 0x3fe522ae0738a3d4 // log(1/frcpa(1+239/256))= +6.60483e-001
816 data8 0x3fe5322e26867854 // log(1/frcpa(1+240/256))= +6.62376e-001
817 data8 0x3fe541b5cb979808 // log(1/frcpa(1+241/256))= +6.64271e-001
818 data8 0x3fe55144fdbcbd60 // log(1/frcpa(1+242/256))= +6.66171e-001
819 data8 0x3fe560dbc45153c4 // log(1/frcpa(1+243/256))= +6.68074e-001
820 data8 0x3fe5707a26bb8c64 // log(1/frcpa(1+244/256))= +6.69980e-001
821 data8 0x3fe587f60ed5b8fc // log(1/frcpa(1+245/256))= +6.72847e-001
822 data8 0x3fe597a7977c8f30 // log(1/frcpa(1+246/256))= +6.74763e-001
823 data8 0x3fe5a760d634bb88 // log(1/frcpa(1+247/256))= +6.76682e-001
824 data8 0x3fe5b721d295f10c // log(1/frcpa(1+248/256))= +6.78605e-001
825 data8 0x3fe5c6ea94431ef8 // log(1/frcpa(1+249/256))= +6.80532e-001
826 data8 0x3fe5d6bb22ea86f4 // log(1/frcpa(1+250/256))= +6.82462e-001
827 data8 0x3fe5e6938645d38c // log(1/frcpa(1+251/256))= +6.84397e-001
828 data8 0x3fe5f673c61a2ed0 // log(1/frcpa(1+252/256))= +6.86335e-001
829 data8 0x3fe6065bea385924 // log(1/frcpa(1+253/256))= +6.88276e-001
830 data8 0x3fe6164bfa7cc068 // log(1/frcpa(1+254/256))= +6.90222e-001
831 data8 0x3fe62643fecf9740 // log(1/frcpa(1+255/256))= +6.92171e-001
832 LOCAL_OBJECT_END(pow_Tt)
833
834
835 // Table 1 is 2^(index_1/128) where
836 // index_1 goes from 0 to 15
837 LOCAL_OBJECT_START(pow_tbl1)
838 data8 0x8000000000000000 , 0x00003FFF
839 data8 0x80B1ED4FD999AB6C , 0x00003FFF
840 data8 0x8164D1F3BC030773 , 0x00003FFF
841 data8 0x8218AF4373FC25EC , 0x00003FFF
842 data8 0x82CD8698AC2BA1D7 , 0x00003FFF
843 data8 0x8383594EEFB6EE37 , 0x00003FFF
844 data8 0x843A28C3ACDE4046 , 0x00003FFF
845 data8 0x84F1F656379C1A29 , 0x00003FFF
846 data8 0x85AAC367CC487B15 , 0x00003FFF
847 data8 0x8664915B923FBA04 , 0x00003FFF
848 data8 0x871F61969E8D1010 , 0x00003FFF
849 data8 0x87DB357FF698D792 , 0x00003FFF
850 data8 0x88980E8092DA8527 , 0x00003FFF
851 data8 0x8955EE03618E5FDD , 0x00003FFF
852 data8 0x8A14D575496EFD9A , 0x00003FFF
853 data8 0x8AD4C6452C728924 , 0x00003FFF
854 LOCAL_OBJECT_END(pow_tbl1)
855
856
857 // Table 2 is 2^(index_1/8) where
858 // index_2 goes from 0 to 7
859 LOCAL_OBJECT_START(pow_tbl2)
860 data8 0x8000000000000000 , 0x00003FFF
861 data8 0x8B95C1E3EA8BD6E7 , 0x00003FFF
862 data8 0x9837F0518DB8A96F , 0x00003FFF
863 data8 0xA5FED6A9B15138EA , 0x00003FFF
864 data8 0xB504F333F9DE6484 , 0x00003FFF
865 data8 0xC5672A115506DADD , 0x00003FFF
866 data8 0xD744FCCAD69D6AF4 , 0x00003FFF
867 data8 0xEAC0C6E7DD24392F , 0x00003FFF
868 LOCAL_OBJECT_END(pow_tbl2)
869
870 .section .text
871 GLOBAL_LIBM_ENTRY(powf)
872
873 // Get exponent of x. Will be used to calculate K.
874 { .mfi
875 getf.exp pow_GR_signexp_X = f8
876 fms.s1 POW_Xm1 = f8,f1,f1 // Will be used for r1 if x>0
877 mov pow_GR_17ones = 0x1FFFF
878 }
879 { .mfi
880 addl pow_AD_P = @ltoff(pow_table_P), gp
881 fma.s1 POW_Xp1 = f8,f1,f1 // Will be used for r1 if x<0
882 nop.i 999
883 }
884 ;;
885
886 // Get significand of x. Will be used to get index to fetch T, Tt.
887 { .mfi
888 getf.sig pow_GR_sig_X = f8
889 frcpa.s1 POW_B, p6 = f1,f8
890 mov pow_GR_exp_half = 0xFFFE // Exponent for 0.5
891 }
892 { .mfi
893 ld8 pow_AD_P = [pow_AD_P]
894 fma.s1 POW_NORM_X = f8,f1,f0
895 mov pow_GR_exp_2tom8 = 0xFFF7
896 }
897 ;;
898
899 // DOUBLE 0x10033 exponent limit at which y is an integer
900 { .mfi
901 nop.m 999
902 fcmp.lt.s1 p8,p9 = f8, f0 // Test for x<0
903 addl pow_GR_10033 = 0x10033, r0
904 }
905 { .mfi
906 mov pow_GR_16ones = 0xFFFF
907 fma.s1 POW_NORM_Y = f9,f1,f0
908 nop.i 999
909 }
910 ;;
911
912 // p13 = TRUE ==> X is unorm
913 { .mfi
914 setf.exp POW_Q0_half = pow_GR_exp_half // Form 0.5
915 fclass.m p13,p0 = f8, 0x0b // Test for x unorm
916 adds pow_AD_Tt = pow_Tt - pow_table_P, pow_AD_P
917 }
918 { .mfi
919 adds pow_AD_Q = pow_table_Q - pow_table_P, pow_AD_P
920 nop.f 999
921 nop.i 999
922 }
923 ;;
924
925 // p14 = TRUE ==> X is ZERO
926 { .mfi
927 ldfe POW_P2 = [pow_AD_Q], 16
928 fclass.m p14,p0 = f8, 0x07
929 nop.i 999
930 }
931 // Note POW_Xm1 and POW_r1 are used interchangably
932 { .mfb
933 nop.m 999
934 (p8) fnma.s1 POW_Xm1 = POW_Xp1,f1,f0
935 (p13) br.cond.spnt POW_X_DENORM
936 }
937 ;;
938
939 // Continue normal and denormal paths here
940 POW_COMMON:
941 // p11 = TRUE ==> Y is a NAN
942 { .mfi
943 and pow_GR_exp_X = pow_GR_signexp_X, pow_GR_17ones
944 fclass.m p11,p0 = f9, 0xc3
945 nop.i 999
946 }
947 { .mfi
948 nop.m 999
949 fms.s1 POW_r = POW_B, POW_NORM_X,f1
950 mov pow_GR_y_zero = 0
951 }
952 ;;
953
954 // Get exponent of |x|-1 to use in comparison to 2^-8
955 { .mmi
956 getf.exp pow_GR_signexp_Xm1 = POW_Xm1
957 sub pow_GR_true_exp_X = pow_GR_exp_X, pow_GR_16ones
958 extr.u pow_GR_offset = pow_GR_sig_X, 55, 8
959 }
960 ;;
961
962 { .mfi
963 alloc r32=ar.pfs,2,19,4,0
964 fcvt.fx.s1 POW_int_Y = POW_NORM_Y
965 shladd pow_AD_Tt = pow_GR_offset, 3, pow_AD_Tt
966 }
967 { .mfi
968 setf.sig POW_int_K = pow_GR_true_exp_X
969 nop.f 999
970 nop.i 999
971 }
972 ;;
973
974 // p12 = TRUE if Y is ZERO
975 // Compute xsq to decide later if |x|=1
976 { .mfi
977 ldfe POW_P1 = [pow_AD_P], 16
978 fclass.m p12,p0 = f9, 0x07
979 nop.i 999
980 }
981 { .mfb
982 ldfe POW_P0 = [pow_AD_Q], 16
983 fma.s1 POW_xsq = POW_NORM_X, POW_NORM_X, f0
984 (p11) br.cond.spnt POW_Y_NAN // Branch if y=nan
985 }
986 ;;
987
988 { .mmf
989 getf.exp pow_GR_signexp_Y = POW_NORM_Y
990 ldfd POW_T = [pow_AD_Tt]
991 fma.s1 POW_rsq = POW_r, POW_r,f0
992 }
993 ;;
994
995 // p11 = TRUE ==> X is a NAN
996 { .mfi
997 ldfpd POW_log2_hi, POW_log2_lo = [pow_AD_Q], 16
998 fclass.m p11,p0 = POW_NORM_X, 0xc3
999 nop.i 999
1000 }
1001 { .mfi
1002 ldfe POW_inv_log2_by_128 = [pow_AD_P], 16
1003 fma.s1 POW_delta = f0,f0,f0 // delta=0 in case |x| near 1
1004 (p12) mov pow_GR_y_zero = 1
1005 }
1006 ;;
1007
1008 { .mfi
1009 ldfd POW_Q2 = [pow_AD_P], 16
1010 fnma.s1 POW_twoV = POW_r, POW_Q0_half,f1
1011 and pow_GR_exp_Xm1 = pow_GR_signexp_Xm1, pow_GR_17ones
1012 }
1013 { .mfi
1014 nop.m 999
1015 fma.s1 POW_U = POW_NORM_Y,POW_r,f0
1016 nop.i 999
1017 }
1018 ;;
1019
1020 // Determine if we will use the |x| near 1 path (p6) or normal path (p7)
1021 { .mfi
1022 nop.m 999
1023 fcvt.xf POW_K = POW_int_K
1024 cmp.lt p6,p7 = pow_GR_exp_Xm1, pow_GR_exp_2tom8
1025 }
1026 { .mfb
1027 nop.m 999
1028 fma.s1 POW_G = f0,f0,f0 // G=0 in case |x| near 1
1029 (p11) br.cond.spnt POW_X_NAN // Branch if x=nan and y not nan
1030 }
1031 ;;
1032
1033 // If on the x near 1 path, assign r1 to r
1034 { .mfi
1035 ldfpd POW_Q1, POW_RSHF = [pow_AD_P], 16
1036 (p6) fma.s1 POW_r = POW_r1, f1, f0
1037 nop.i 999
1038 }
1039 { .mfb
1040 nop.m 999
1041 (p6) fma.s1 POW_rsq = POW_r1, POW_r1, f0
1042 (p14) br.cond.spnt POW_X_0 // Branch if x zero and y not nan
1043 }
1044 ;;
1045
1046 { .mfi
1047 getf.sig pow_GR_sig_int_Y = POW_int_Y
1048 (p6) fnma.s1 POW_twoV = POW_r1, POW_Q0_half,f1
1049 and pow_GR_exp_Y = pow_GR_signexp_Y, pow_GR_17ones
1050 }
1051 { .mfb
1052 andcm pow_GR_sign_Y = pow_GR_signexp_Y, pow_GR_17ones
1053 (p6) fma.s1 POW_U = POW_NORM_Y,POW_r1,f0
1054 (p12) br.cond.spnt POW_Y_0 // Branch if y=zero, x not zero or nan
1055 }
1056 ;;
1057
1058 { .mfi
1059 ldfe POW_log2_by_128_lo = [pow_AD_P], 16
1060 (p7) fma.s1 POW_Z2 = POW_twoV, POW_U, f0
1061 nop.i 999
1062 }
1063 { .mfi
1064 ldfe POW_log2_by_128_hi = [pow_AD_Q], 16
1065 nop.f 999
1066 nop.i 999
1067 }
1068 ;;
1069
1070 { .mfi
1071 nop.m 999
1072 fcvt.xf POW_float_int_Y = POW_int_Y
1073 nop.i 999
1074 }
1075 { .mfi
1076 nop.m 999
1077 (p7) fma.s1 POW_G = POW_K, POW_log2_hi, POW_T
1078 adds pow_AD_tbl1 = pow_tbl1 - pow_Tt, pow_AD_Q
1079 }
1080 ;;
1081
1082 // p11 = TRUE ==> X is NEGATIVE but not inf
1083 { .mfi
1084 nop.m 999
1085 fclass.m p11,p0 = POW_NORM_X, 0x1a
1086 nop.i 999
1087 }
1088 { .mfi
1089 nop.m 999
1090 (p7) fma.s1 POW_delta = POW_K, POW_log2_lo, f0
1091 adds pow_AD_tbl2 = pow_tbl2 - pow_tbl1, pow_AD_tbl1
1092 }
1093 ;;
1094
1095 { .mfi
1096 nop.m 999
1097 (p6) fma.s1 POW_Z = POW_twoV, POW_U, f0
1098 nop.i 999
1099 }
1100 { .mfi
1101 nop.m 999
1102 fma.s1 POW_v2 = POW_P1, POW_r, POW_P0
1103 nop.i 999
1104 }
1105 ;;
1106
1107 // p11 = TRUE ==> X is NEGATIVE but not inf
1108 // p12 = TRUE ==> X is NEGATIVE AND Y already even int
1109 // p13 = TRUE ==> X is NEGATIVE AND Y possible int
1110 { .mfi
1111 nop.m 999
1112 (p7) fma.s1 POW_Z = POW_NORM_Y, POW_G, POW_Z2
1113 (p11) cmp.gt.unc p12,p13 = pow_GR_exp_Y, pow_GR_10033
1114 }
1115 { .mfi
1116 nop.m 999
1117 fma.s1 POW_Gpr = POW_G, f1, POW_r
1118 nop.i 999
1119 }
1120 ;;
1121
1122 { .mfi
1123 nop.m 999
1124 fma.s1 POW_Yrcub = POW_rsq, POW_U, f0
1125 nop.i 999
1126 }
1127 { .mfi
1128 nop.m 999
1129 fma.s1 POW_p = POW_rsq, POW_P2, POW_v2
1130 nop.i 999
1131 }
1132 ;;
1133
1134 // Test if x inf
1135 { .mfi
1136 nop.m 999
1137 fclass.m p15,p0 = POW_NORM_X, 0x23
1138 nop.i 999
1139 }
1140 // By adding RSHF (1.1000...*2^63) we put integer part in rightmost significand
1141 { .mfi
1142 nop.m 999
1143 fma.s1 POW_W1 = POW_Z, POW_inv_log2_by_128, POW_RSHF
1144 nop.i 999
1145 }
1146 ;;
1147
1148 // p13 = TRUE ==> X is NEGATIVE AND Y possible int
1149 // p10 = TRUE ==> X is NEG and Y is an int
1150 // p12 = TRUE ==> X is NEG and Y is not an int
1151 { .mfi
1152 nop.m 999
1153 (p13) fcmp.eq.unc.s1 p10,p12 = POW_float_int_Y, POW_NORM_Y
1154 mov pow_GR_xneg_yodd = 0
1155 }
1156 { .mfi
1157 nop.m 999
1158 fma.s1 POW_Y_Gpr = POW_NORM_Y, POW_Gpr, f0
1159 nop.i 999
1160 }
1161 ;;
1162
1163 // p11 = TRUE ==> X is +1.0
1164 { .mfi
1165 nop.m 999
1166 fcmp.eq.s1 p11,p0 = POW_NORM_X, f1
1167 nop.i 999
1168 }
1169 ;;
1170
1171 // Extract rounded integer from rightmost significand of POW_W1
1172 // By subtracting RSHF we get rounded integer POW_Nfloat
1173 { .mfi
1174 getf.sig pow_GR_int_N = POW_W1
1175 fms.s1 POW_Nfloat = POW_W1, f1, POW_RSHF
1176 nop.i 999
1177 }
1178 { .mfb
1179 nop.m 999
1180 fma.s1 POW_Z3 = POW_p, POW_Yrcub, f0
1181 (p12) br.cond.spnt POW_X_NEG_Y_NONINT // Branch if x neg, y not integer
1182 }
1183 ;;
1184
1185 // p7 = TRUE ==> Y is +1.0
1186 // p12 = TRUE ==> X is NEGATIVE AND Y is an odd integer
1187 { .mfi
1188 getf.exp pow_GR_signexp_Y_Gpr = POW_Y_Gpr
1189 fcmp.eq.s1 p7,p0 = POW_NORM_Y, f1 // Test for y=1.0
1190 (p10) tbit.nz.unc p12,p0 = pow_GR_sig_int_Y,0
1191 }
1192 { .mfb
1193 nop.m 999
1194 (p11) fma.s.s0 f8 = f1,f1,f0 // If x=1, result is +1
1195 (p15) br.cond.spnt POW_X_INF
1196 }
1197 ;;
1198
1199 // Test x and y and flag denormal
1200 { .mfi
1201 nop.m 999
1202 fcmp.eq.s0 p15,p0 = f8,f9
1203 nop.i 999
1204 }
1205 { .mfb
1206 nop.m 999
1207 fma.s1 POW_e3 = POW_NORM_Y, POW_delta, f0
1208 (p11) br.ret.spnt b0 // Early exit if x=1.0, result is +1
1209 }
1210 ;;
1211
1212 { .mfi
1213 (p12) mov pow_GR_xneg_yodd = 1
1214 fnma.s1 POW_f12 = POW_Nfloat, POW_log2_by_128_lo, f1
1215 nop.i 999
1216 }
1217 { .mfb
1218 nop.m 999
1219 fnma.s1 POW_s = POW_Nfloat, POW_log2_by_128_hi, POW_Z
1220 (p7) br.ret.spnt b0 // Early exit if y=1.0, result is x
1221 }
1222 ;;
1223
1224 { .mmi
1225 and pow_GR_index1 = 0x0f, pow_GR_int_N
1226 and pow_GR_index2 = 0x70, pow_GR_int_N
1227 shr pow_int_GR_M = pow_GR_int_N, 7 // M = N/128
1228 }
1229 ;;
1230
1231 { .mfi
1232 shladd pow_AD_T1 = pow_GR_index1, 4, pow_AD_tbl1
1233 fma.s1 POW_q = POW_Z3, POW_Q1, POW_Q0_half
1234 add pow_int_GR_M = pow_GR_16ones, pow_int_GR_M
1235 }
1236 { .mfi
1237 add pow_AD_T2 = pow_AD_tbl2, pow_GR_index2
1238 fma.s1 POW_Z3sq = POW_Z3, POW_Z3, f0
1239 nop.i 999
1240 }
1241 ;;
1242
1243 { .mmi
1244 ldfe POW_T1 = [pow_AD_T1]
1245 ldfe POW_T2 = [pow_AD_T2]
1246 nop.i 999
1247 }
1248 ;;
1249
1250 // f123 = f12*(e3+1) = f12*e3+f12
1251 { .mfi
1252 setf.exp POW_2M = pow_int_GR_M
1253 fma.s1 POW_f123 = POW_e3,POW_f12,POW_f12
1254 nop.i 999
1255 }
1256 { .mfi
1257 nop.m 999
1258 fma.s1 POW_ssq = POW_s, POW_s, f0
1259 nop.i 999
1260 }
1261 ;;
1262
1263 { .mfi
1264 nop.m 999
1265 fma.s1 POW_v2 = POW_s, POW_Q2, POW_Q1
1266 and pow_GR_exp_Y_Gpr = pow_GR_signexp_Y_Gpr, pow_GR_17ones
1267 }
1268 ;;
1269
1270 { .mfi
1271 cmp.ne p12,p13 = pow_GR_xneg_yodd, r0
1272 fma.s1 POW_q = POW_Z3sq, POW_q, POW_Z3
1273 sub pow_GR_true_exp_Y_Gpr = pow_GR_exp_Y_Gpr, pow_GR_16ones
1274 }
1275 ;;
1276
1277 // p8 TRUE ==> |Y(G + r)| >= 7
1278
1279 // single
1280 // -2^7 -2^6 2^6 2^7
1281 // -----+-----+----+ ... +-----+-----+-----
1282 // p8 | p9 | p8
1283 // | | p10 | |
1284
1285 // Form signexp of constants to indicate overflow
1286 { .mfi
1287 mov pow_GR_big_pos = 0x1007f
1288 nop.f 999
1289 cmp.le p8,p9 = 7, pow_GR_true_exp_Y_Gpr
1290 }
1291 { .mfi
1292 mov pow_GR_big_neg = 0x3007f
1293 nop.f 999
1294 andcm pow_GR_sign_Y_Gpr = pow_GR_signexp_Y_Gpr, pow_GR_17ones
1295 }
1296 ;;
1297
1298 // Form big positive and negative constants to test for possible overflow
1299 // Scale both terms of the polynomial by POW_f123
1300 { .mfi
1301 setf.exp POW_big_pos = pow_GR_big_pos
1302 fma.s1 POW_ssq = POW_ssq, POW_f123, f0
1303 (p9) cmp.le.unc p0,p10 = 6, pow_GR_true_exp_Y_Gpr
1304 }
1305 { .mfb
1306 setf.exp POW_big_neg = pow_GR_big_neg
1307 fma.s1 POW_1ps = POW_s, POW_f123, POW_f123
1308 (p8) br.cond.spnt POW_OVER_UNDER_X_NOT_INF
1309 }
1310 ;;
1311
1312 { .mfi
1313 nop.m 999
1314 (p12) fnma.s1 POW_T1T2 = POW_T1, POW_T2, f0
1315 nop.i 999
1316 }
1317 { .mfi
1318 nop.m 999
1319 (p13) fma.s1 POW_T1T2 = POW_T1, POW_T2, f0
1320 nop.i 999
1321 }
1322 ;;
1323
1324 { .mfi
1325 nop.m 999
1326 fma.s1 POW_v210 = POW_s, POW_v2, POW_Q0_half
1327 nop.i 999
1328 }
1329 { .mfi
1330 nop.m 999
1331 fma.s1 POW_2Mqp1 = POW_2M, POW_q, POW_2M
1332 nop.i 999
1333 }
1334 ;;
1335
1336 { .mfi
1337 nop.m 999
1338 fma.s1 POW_es = POW_ssq, POW_v210, POW_1ps
1339 nop.i 999
1340 }
1341 { .mfi
1342 nop.m 999
1343 fma.s1 POW_A = POW_T1T2, POW_2Mqp1, f0
1344 nop.i 999
1345 }
1346 ;;
1347
1348 // Dummy op to set inexact
1349 { .mfi
1350 nop.m 999
1351 fma.s0 POW_tmp = POW_2M, POW_q, POW_2M
1352 nop.i 999
1353 }
1354 ;;
1355
1356 { .mfb
1357 nop.m 999
1358 fma.s.s0 f8 = POW_A, POW_es, f0
1359 (p10) br.ret.sptk b0 // Exit main branch if no over/underflow
1360 }
1361 ;;
1362
1363 // POSSIBLE_OVER_UNDER
1364 // p6 = TRUE ==> Y_Gpr negative
1365 // Result is already computed. We just need to know if over/underflow occurred.
1366
1367 { .mfb
1368 cmp.eq p0,p6 = pow_GR_sign_Y_Gpr, r0
1369 nop.f 999
1370 (p6) br.cond.spnt POW_POSSIBLE_UNDER
1371 }
1372 ;;
1373
1374 // POSSIBLE_OVER
1375 // We got an answer.
1376 // overflow is a possibility, not a certainty
1377
1378
1379 // We define an overflow when the answer with
1380 // WRE set
1381 // user-defined rounding mode
1382
1383 // double
1384 // Largest double is 7FE (biased double)
1385 // 7FE - 3FF + FFFF = 103FE
1386 // Create + largest_double_plus_ulp
1387 // Create - largest_double_plus_ulp
1388 // Calculate answer with WRE set.
1389
1390 // single
1391 // Largest single is FE (biased double)
1392 // FE - 7F + FFFF = 1007E
1393 // Create + largest_single_plus_ulp
1394 // Create - largest_single_plus_ulp
1395 // Calculate answer with WRE set.
1396
1397 // Cases when answer is ldn+1 are as follows:
1398 // ldn ldn+1
1399 // --+----------|----------+------------
1400 // |
1401 // +inf +inf -inf
1402 // RN RN
1403 // RZ
1404
1405 // Put in s2 (td set, wre set)
1406 { .mfi
1407 nop.m 999
1408 fsetc.s2 0x7F,0x42
1409 nop.i 999
1410 }
1411 ;;
1412
1413 { .mfi
1414 nop.m 999
1415 fma.s.s2 POW_wre_urm_f8 = POW_A, POW_es, f0
1416 nop.i 999
1417 }
1418 ;;
1419
1420 // Return s2 to default
1421 { .mfi
1422 nop.m 999
1423 fsetc.s2 0x7F,0x40
1424 nop.i 999
1425 }
1426 ;;
1427
1428 // p7 = TRUE ==> yes, we have an overflow
1429 { .mfi
1430 nop.m 999
1431 fcmp.ge.s1 p7, p8 = POW_wre_urm_f8, POW_big_pos
1432 nop.i 999
1433 }
1434 ;;
1435
1436 { .mfi
1437 nop.m 999
1438 (p8) fcmp.le.s1 p7, p0 = POW_wre_urm_f8, POW_big_neg
1439 nop.i 999
1440 }
1441 ;;
1442
1443 { .mbb
1444 (p7) mov pow_GR_tag = 30
1445 (p7) br.cond.spnt __libm_error_region // Branch if overflow
1446 br.ret.sptk b0 // Exit if did not overflow
1447 }
1448 ;;
1449
1450
1451 POW_POSSIBLE_UNDER:
1452 // We got an answer. input was < -2^9 but > -2^10 (double)
1453 // We got an answer. input was < -2^6 but > -2^7 (float)
1454 // underflow is a possibility, not a certainty
1455
1456 // We define an underflow when the answer with
1457 // ftz set
1458 // is zero (tiny numbers become zero)
1459 // Notice (from below) that if we have an unlimited exponent range,
1460 // then there is an extra machine number E between the largest denormal and
1461 // the smallest normal.
1462 // So if with unbounded exponent we round to E or below, then we are
1463 // tiny and underflow has occurred.
1464 // But notice that you can be in a situation where we are tiny, namely
1465 // rounded to E, but when the exponent is bounded we round to smallest
1466 // normal. So the answer can be the smallest normal with underflow.
1467 // E
1468 // -----+--------------------+--------------------+-----
1469 // | | |
1470 // 1.1...10 2^-3fff 1.1...11 2^-3fff 1.0...00 2^-3ffe
1471 // 0.1...11 2^-3ffe (biased, 1)
1472 // largest dn smallest normal
1473
1474 // Form small constant (2^-170) to correct underflow result near region of
1475 // smallest denormal in round-nearest.
1476
1477 // Put in s2 (td set, ftz set)
1478 .pred.rel "mutex",p12,p13
1479 { .mfi
1480 mov pow_GR_Fpsr = ar40 // Read the fpsr--need to check rc.s0
1481 fsetc.s2 0x7F,0x41
1482 mov pow_GR_rcs0_mask = 0x0c00 // Set mask for rc.s0
1483 }
1484 { .mfi
1485 (p12) mov pow_GR_tmp = 0x2ffff - 170
1486 nop.f 999
1487 (p13) mov pow_GR_tmp = 0x0ffff - 170
1488 }
1489 ;;
1490
1491 { .mfi
1492 setf.exp POW_eps = pow_GR_tmp // Form 2^-170
1493 fma.s.s2 POW_ftz_urm_f8 = POW_A, POW_es, f0
1494 nop.i 999
1495 }
1496 ;;
1497
1498 // Return s2 to default
1499 { .mfi
1500 nop.m 999
1501 fsetc.s2 0x7F,0x40
1502 nop.i 999
1503 }
1504 ;;
1505
1506 // p7 = TRUE ==> yes, we have an underflow
1507 { .mfi
1508 nop.m 999
1509 fcmp.eq.s1 p7, p0 = POW_ftz_urm_f8, f0
1510 nop.i 999
1511 }
1512 ;;
1513
1514 { .mmi
1515 (p7) and pow_GR_rcs0 = pow_GR_rcs0_mask, pow_GR_Fpsr // Isolate rc.s0
1516 ;;
1517 (p7) cmp.eq.unc p6,p0 = pow_GR_rcs0, r0 // Test for round to nearest
1518 nop.i 999
1519 }
1520 ;;
1521
1522 // Tweak result slightly if underflow to get correct rounding near smallest
1523 // denormal if round-nearest
1524 { .mfi
1525 nop.m 999
1526 (p6) fms.s.s0 f8 = POW_A, POW_es, POW_eps
1527 nop.i 999
1528 }
1529 { .mbb
1530 (p7) mov pow_GR_tag = 31
1531 (p7) br.cond.spnt __libm_error_region // Branch if underflow
1532 br.ret.sptk b0 // Exit if did not underflow
1533 }
1534 ;;
1535
1536 POW_X_DENORM:
1537 // Here if x unorm. Use the NORM_X for getf instructions, and then back
1538 // to normal path
1539 { .mfi
1540 getf.exp pow_GR_signexp_X = POW_NORM_X
1541 nop.f 999
1542 nop.i 999
1543 }
1544 ;;
1545
1546 { .mib
1547 getf.sig pow_GR_sig_X = POW_NORM_X
1548 nop.i 999
1549 br.cond.sptk POW_COMMON
1550 }
1551 ;;
1552
1553 POW_X_0:
1554 // Here if x=0 and y not nan
1555 //
1556 // We have the following cases:
1557 // p6 x=0 and y>0 and is an integer (may be even or odd)
1558 // p7 x=0 and y>0 and is NOT an integer, return +0
1559 // p8 x=0 and y>0 and so big as to always be an even integer, return +0
1560 // p9 x=0 and y>0 and may not be integer
1561 // p10 x=0 and y>0 and is an odd integer, return x
1562 // p11 x=0 and y>0 and is an even integer, return +0
1563 // p12 used in dummy fcmp to set denormal flag if y=unorm
1564 // p13 x=0 and y>0
1565 // p14 x=0 and y=0, branch to code for calling error handling
1566 // p15 x=0 and y<0, branch to code for calling error handling
1567 //
1568 { .mfi
1569 getf.sig pow_GR_sig_int_Y = POW_int_Y // Get signif of int_Y
1570 fcmp.lt.s1 p15,p13 = f9, f0 // Test for y<0
1571 and pow_GR_exp_Y = pow_GR_signexp_Y, pow_GR_17ones
1572 }
1573 { .mfb
1574 cmp.ne p14,p0 = pow_GR_y_zero,r0 // Test for y=0
1575 fcvt.xf POW_float_int_Y = POW_int_Y
1576 (p14) br.cond.spnt POW_X_0_Y_0 // Branch if x=0 and y=0
1577 }
1578 ;;
1579
1580 // If x=0 and y>0, test y and flag denormal
1581 { .mfb
1582 (p13) cmp.gt.unc p8,p9 = pow_GR_exp_Y, pow_GR_10033 // Test y +big = even int
1583 (p13) fcmp.eq.s0 p12,p0 = f9,f0 // If x=0, y>0 dummy op to flag denormal
1584 (p15) br.cond.spnt POW_X_0_Y_NEG // Branch if x=0 and y<0
1585 }
1586 ;;
1587
1588 // Here if x=0 and y>0
1589 { .mfi
1590 nop.m 999
1591 (p9) fcmp.eq.unc.s1 p6,p7 = POW_float_int_Y, POW_NORM_Y // Test y=int
1592 nop.i 999
1593 }
1594 { .mfi
1595 nop.m 999
1596 (p8) fma.s.s0 f8 = f0,f0,f0 // If x=0, y>0 and large even int, return +0
1597 nop.i 999
1598 }
1599 ;;
1600
1601 { .mfi
1602 nop.m 999
1603 (p7) fma.s.s0 f8 = f0,f0,f0 // Result +0 if x=0 and y>0 and not integer
1604 (p6) tbit.nz.unc p10,p11 = pow_GR_sig_int_Y,0 // If y>0 int, test y even/odd
1605 }
1606 ;;
1607
1608 // Note if x=0, y>0 and odd integer, just return x
1609 { .mfb
1610 nop.m 999
1611 (p11) fma.s.s0 f8 = f0,f0,f0 // Result +0 if x=0 and y even integer
1612 br.ret.sptk b0 // Exit if x=0 and y>0
1613 }
1614 ;;
1615
1616 POW_X_0_Y_0:
1617 // When X is +-0 and Y is +-0, IEEE returns 1.0
1618 // We call error support with this value
1619
1620 { .mfb
1621 mov pow_GR_tag = 32
1622 fma.s.s0 f8 = f1,f1,f0
1623 br.cond.sptk __libm_error_region
1624 }
1625 ;;
1626
1627 POW_X_0_Y_NEG:
1628 // When X is +-0 and Y is negative, IEEE returns
1629 // X Y answer
1630 // +0 -odd int +inf
1631 // -0 -odd int -inf
1632
1633 // +0 !-odd int +inf
1634 // -0 !-odd int +inf
1635
1636 // p6 == Y is a floating point number outside the integer.
1637 // Hence it is an integer and is even.
1638 // return +inf
1639
1640 // p7 == Y is a floating point number within the integer range.
1641 // p9 == (int_Y = NORM_Y), Y is an integer, which may be odd or even.
1642 // p11 odd
1643 // return (sign_of_x)inf
1644 // p12 even
1645 // return +inf
1646 // p10 == Y is not an integer
1647 // return +inf
1648 //
1649
1650 { .mfi
1651 nop.m 999
1652 nop.f 999
1653 cmp.gt p6,p7 = pow_GR_exp_Y, pow_GR_10033
1654 }
1655 ;;
1656
1657 { .mfi
1658 mov pow_GR_tag = 33
1659 (p7) fcmp.eq.unc.s1 p9,p10 = POW_float_int_Y, POW_NORM_Y
1660 nop.i 999
1661 }
1662 ;;
1663
1664 { .mfb
1665 nop.m 999
1666 (p6) frcpa.s0 f8,p13 = f1, f0
1667 (p6) br.cond.sptk __libm_error_region // x=0, y<0, y large neg int
1668 }
1669 ;;
1670
1671 { .mfb
1672 nop.m 999
1673 (p10) frcpa.s0 f8,p13 = f1, f0
1674 (p10) br.cond.sptk __libm_error_region // x=0, y<0, y not int
1675 }
1676 ;;
1677
1678 // x=0, y<0, y an int
1679 { .mib
1680 nop.m 999
1681 (p9) tbit.nz.unc p11,p12 = pow_GR_sig_int_Y,0
1682 nop.b 999
1683 }
1684 ;;
1685
1686 { .mfi
1687 nop.m 999
1688 (p12) frcpa.s0 f8,p13 = f1,f0
1689 nop.i 999
1690 }
1691 ;;
1692
1693 { .mfb
1694 nop.m 999
1695 (p11) frcpa.s0 f8,p13 = f1,f8
1696 br.cond.sptk __libm_error_region
1697 }
1698 ;;
1699
1700
1701 POW_Y_0:
1702 // Here for y zero, x anything but zero and nan
1703 // Set flag if x denormal
1704 // Result is +1.0
1705 { .mfi
1706 nop.m 999
1707 fcmp.eq.s0 p6,p0 = f8,f0 // Sets flag if x denormal
1708 nop.i 999
1709 }
1710 { .mfb
1711 nop.m 999
1712 fma.s.s0 f8 = f1,f1,f0
1713 br.ret.sptk b0
1714 }
1715 ;;
1716
1717
1718 POW_X_INF:
1719 // Here when X is +-inf
1720
1721 // X +inf Y +inf +inf
1722 // X -inf Y +inf +inf
1723
1724 // X +inf Y >0 +inf
1725 // X -inf Y >0, !odd integer +inf <== (-inf)^0.5 = +inf !!
1726 // X -inf Y >0, odd integer -inf
1727
1728 // X +inf Y -inf +0
1729 // X -inf Y -inf +0
1730
1731 // X +inf Y <0 +0
1732 // X -inf Y <0, !odd integer +0
1733 // X -inf Y <0, odd integer -0
1734
1735 // X + inf Y=+0 +1
1736 // X + inf Y=-0 +1
1737 // X - inf Y=+0 +1
1738 // X - inf Y=-0 +1
1739
1740 // p13 == Y negative
1741 // p14 == Y positive
1742
1743 // p6 == Y is a floating point number outside the integer.
1744 // Hence it is an integer and is even.
1745 // p13 == (Y negative)
1746 // return +inf
1747 // p14 == (Y positive)
1748 // return +0
1749
1750 // p7 == Y is a floating point number within the integer range.
1751 // p9 == (int_Y = NORM_Y), Y is an integer, which may be odd or even.
1752 // p11 odd
1753 // p13 == (Y negative)
1754 // return (sign_of_x)inf
1755 // p14 == (Y positive)
1756 // return (sign_of_x)0
1757 // pxx even
1758 // p13 == (Y negative)
1759 // return +inf
1760 // p14 == (Y positive)
1761 // return +0
1762
1763 // pxx == Y is not an integer
1764 // p13 == (Y negative)
1765 // return +inf
1766 // p14 == (Y positive)
1767 // return +0
1768 //
1769
1770 // If x=inf, test y and flag denormal
1771 { .mfi
1772 nop.m 999
1773 fcmp.eq.s0 p10,p11 = f9,f0
1774 nop.i 999
1775 }
1776 ;;
1777
1778 { .mfi
1779 nop.m 999
1780 fcmp.lt.s0 p13,p14 = POW_NORM_Y,f0
1781 cmp.gt p6,p7 = pow_GR_exp_Y, pow_GR_10033
1782 }
1783 { .mfi
1784 nop.m 999
1785 fclass.m p12,p0 = f9, 0x23 //@inf
1786 nop.i 999
1787 }
1788 ;;
1789
1790 { .mfi
1791 nop.m 999
1792 fclass.m p15,p0 = f9, 0x07 //@zero
1793 nop.i 999
1794 }
1795 ;;
1796
1797 { .mfb
1798 nop.m 999
1799 (p15) fmerge.s f8 = f1,f1 // Return +1.0 if x=inf, y=0
1800 (p15) br.ret.spnt b0 // Exit if x=inf, y=0
1801 }
1802 ;;
1803
1804 { .mfi
1805 nop.m 999
1806 (p14) frcpa.s1 f8,p10 = f1,f0 // If x=inf, y>0, assume result +inf
1807 nop.i 999
1808 }
1809 { .mfb
1810 nop.m 999
1811 (p13) fma.s.s0 f8 = f0,f0,f0 // If x=inf, y<0, assume result +0.0
1812 (p12) br.ret.spnt b0 // Exit if x=inf, y=inf
1813 }
1814 ;;
1815
1816 // Here if x=inf, and 0 < |y| < inf. Need to correct results if y odd integer.
1817 { .mfi
1818 nop.m 999
1819 (p7) fcmp.eq.unc.s1 p9,p0 = POW_float_int_Y, POW_NORM_Y // Is y integer?
1820 nop.i 999
1821 }
1822 ;;
1823
1824 { .mfi
1825 nop.m 999
1826 nop.f 999
1827 (p9) tbit.nz.unc p11,p0 = pow_GR_sig_int_Y,0 // Test for y odd integer
1828 }
1829 ;;
1830
1831 { .mfb
1832 nop.m 999
1833 (p11) fmerge.s f8 = POW_NORM_X,f8 // If y odd integer use sign of x
1834 br.ret.sptk b0 // Exit for x=inf, 0 < |y| < inf
1835 }
1836 ;;
1837
1838
1839 POW_X_NEG_Y_NONINT:
1840 // When X is negative and Y is a non-integer, IEEE
1841 // returns a qnan indefinite.
1842 // We call error support with this value
1843
1844 { .mfb
1845 mov pow_GR_tag = 34
1846 frcpa.s0 f8,p6 = f0,f0
1847 br.cond.sptk __libm_error_region
1848 }
1849 ;;
1850
1851 POW_X_NAN:
1852 // Here if x=nan, y not nan
1853 { .mfi
1854 nop.m 999
1855 fclass.m p9,p13 = f9, 0x07 // Test y=zero
1856 nop.i 999
1857 }
1858 ;;
1859
1860 { .mfb
1861 nop.m 999
1862 (p13) fma.s.s0 f8 = f8,f1,f0
1863 (p13) br.ret.sptk b0 // Exit if x nan, y anything but zero or nan
1864 }
1865 ;;
1866
1867 POW_X_NAN_Y_0:
1868 // When X is a NAN and Y is zero, IEEE returns 1.
1869 // We call error support with this value.
1870 { .mfi
1871 nop.m 999
1872 fcmp.eq.s0 p6,p0 = f8,f0 // Dummy op to set invalid on snan
1873 nop.i 999
1874 }
1875 { .mfb
1876 mov pow_GR_tag = 35
1877 fma.s.s0 f8 = f0,f0,f1
1878 br.cond.sptk __libm_error_region
1879 }
1880 ;;
1881
1882
1883 POW_OVER_UNDER_X_NOT_INF:
1884
1885 // p8 is TRUE for overflow
1886 // p9 is TRUE for underflow
1887
1888 // if y is infinity, we should not over/underflow
1889
1890 { .mfi
1891 nop.m 999
1892 fcmp.eq.s1 p14, p13 = POW_xsq,f1 // Test |x|=1
1893 cmp.eq p8,p9 = pow_GR_sign_Y_Gpr, r0
1894 }
1895 ;;
1896
1897 { .mfi
1898 nop.m 999
1899 (p14) fclass.m.unc p15, p0 = f9, 0x23 // If |x|=1, test y=inf
1900 nop.i 999
1901 }
1902 { .mfi
1903 nop.m 999
1904 (p13) fclass.m.unc p11,p0 = f9, 0x23 // If |x| not 1, test y=inf
1905 nop.i 999
1906 }
1907 ;;
1908
1909 // p15 = TRUE if |x|=1, y=inf, return +1
1910 { .mfb
1911 nop.m 999
1912 (p15) fma.s.s0 f8 = f1,f1,f0 // If |x|=1, y=inf, result +1
1913 (p15) br.ret.spnt b0 // Exit if |x|=1, y=inf
1914 }
1915 ;;
1916
1917 .pred.rel "mutex",p8,p9
1918 { .mfb
1919 (p8) setf.exp f8 = pow_GR_17ones // If exp(+big), result inf
1920 (p9) fmerge.s f8 = f0,f0 // If exp(-big), result 0
1921 (p11) br.ret.sptk b0 // Exit if |x| not 1, y=inf
1922 }
1923 ;;
1924
1925 { .mfb
1926 nop.m 999
1927 nop.f 999
1928 br.cond.sptk POW_OVER_UNDER_ERROR // Branch if y not inf
1929 }
1930 ;;
1931
1932
1933 POW_Y_NAN:
1934 // Here if y=nan, x anything
1935 // If x = +1 then result is +1, else result is quiet Y
1936 { .mfi
1937 nop.m 999
1938 fcmp.eq.s1 p10,p9 = POW_NORM_X, f1
1939 nop.i 999
1940 }
1941 ;;
1942
1943 { .mfi
1944 nop.m 999
1945 (p10) fcmp.eq.s0 p6,p0 = f9,f1 // Set invalid, even if x=+1
1946 nop.i 999
1947 }
1948 ;;
1949
1950 { .mfi
1951 nop.m 999
1952 (p10) fma.s.s0 f8 = f1,f1,f0
1953 nop.i 999
1954 }
1955 { .mfb
1956 nop.m 999
1957 (p9) fma.s.s0 f8 = f9,f8,f0
1958 br.ret.sptk b0 // Exit y=nan
1959 }
1960 ;;
1961
1962
1963 POW_OVER_UNDER_ERROR:
1964 // Here if we have overflow or underflow.
1965 // Enter with p12 true if x negative and y odd int to force -0 or -inf
1966
1967 { .mfi
1968 sub pow_GR_17ones_m1 = pow_GR_17ones, r0, 1
1969 nop.f 999
1970 mov pow_GR_one = 0x1
1971 }
1972 ;;
1973
1974 // overflow, force inf with O flag
1975 { .mmb
1976 (p8) mov pow_GR_tag = 30
1977 (p8) setf.exp POW_tmp = pow_GR_17ones_m1
1978 nop.b 999
1979 }
1980 ;;
1981
1982 // underflow, force zero with I, U flags
1983 { .mmi
1984 (p9) mov pow_GR_tag = 31
1985 (p9) setf.exp POW_tmp = pow_GR_one
1986 nop.i 999
1987 }
1988 ;;
1989
1990 { .mfi
1991 nop.m 999
1992 fma.s.s0 f8 = POW_tmp, POW_tmp, f0
1993 nop.i 999
1994 }
1995 ;;
1996
1997 // p12 x is negative and y is an odd integer, change sign of result
1998 { .mfi
1999 nop.m 999
2000 (p12) fnma.s.s0 f8 = POW_tmp, POW_tmp, f0
2001 nop.i 999
2002 }
2003 ;;
2004
2005 GLOBAL_LIBM_END(powf)
2006
2007
2008 LOCAL_LIBM_ENTRY(__libm_error_region)
2009
2010 .prologue
2011 { .mfi
2012 add GR_Parameter_Y=-32,sp // Parameter 2 value
2013 nop.f 0
2014 .save ar.pfs,GR_SAVE_PFS
2015 mov GR_SAVE_PFS=ar.pfs // Save ar.pfs
2016 }
2017 { .mfi
2018 .fframe 64
2019 add sp=-64,sp // Create new stack
2020 nop.f 0
2021 mov GR_SAVE_GP=gp // Save gp
2022 };;
2023
2024 { .mmi
2025 stfs [GR_Parameter_Y] = POW_NORM_Y,16 // STORE Parameter 2 on stack
2026 add GR_Parameter_X = 16,sp // Parameter 1 address
2027 .save b0, GR_SAVE_B0
2028 mov GR_SAVE_B0=b0 // Save b0
2029 };;
2030
2031 .body
2032 { .mib
2033 stfs [GR_Parameter_X] = POW_NORM_X // STORE Parameter 1 on stack
2034 add GR_Parameter_RESULT = 0,GR_Parameter_Y // Parameter 3 address
2035 nop.b 0
2036 }
2037 { .mib
2038 stfs [GR_Parameter_Y] = f8 // STORE Parameter 3 on stack
2039 add GR_Parameter_Y = -16,GR_Parameter_Y
2040 br.call.sptk b0=__libm_error_support# // Call error handling function
2041 };;
2042
2043 { .mmi
2044 add GR_Parameter_RESULT = 48,sp
2045 nop.m 0
2046 nop.i 0
2047 };;
2048
2049 { .mmi
2050 ldfs f8 = [GR_Parameter_RESULT] // Get return result off stack
2051 .restore sp
2052 add sp = 64,sp // Restore stack pointer
2053 mov b0 = GR_SAVE_B0 // Restore return address
2054 };;
2055
2056 { .mib
2057 mov gp = GR_SAVE_GP // Restore gp
2058 mov ar.pfs = GR_SAVE_PFS // Restore ar.pfs
2059 br.ret.sptk b0 // Return
2060 };;
2061
2062 LOCAL_LIBM_END(__libm_error_region)
2063
2064 .type __libm_error_support#,@function
2065 .global __libm_error_support#
2066