1.file "log.s"
2
3
4// Copyright (c) 2000 - 2005, Intel Corporation
5// All rights reserved.
6//
7//
8// Redistribution and use in source and binary forms, with or without
9// modification, are permitted provided that the following conditions are
10// met:
11//
12// * Redistributions of source code must retain the above copyright
13// notice, this list of conditions and the following disclaimer.
14//
15// * Redistributions in binary form must reproduce the above copyright
16// notice, this list of conditions and the following disclaimer in the
17// documentation and/or other materials provided with the distribution.
18//
19// * The name of Intel Corporation may not be used to endorse or promote
20// products derived from this software without specific prior written
21// permission.
22
23// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
27// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
31// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
32// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34//
35// Intel Corporation is the author of this code, and requests that all
36// problem reports or change requests be submitted to it directly at
37// http://www.intel.com/software/products/opensource/libraries/num.htm.
38//
39// History
40//==============================================================
41// 02/02/00 Initial version
42// 04/04/00 Unwind support added
43// 06/16/00 Updated table to be rounded correctly
44// 08/15/00 Bundle added after call to __libm_error_support to properly
45//          set [the previously overwritten] GR_Parameter_RESULT.
46// 08/17/00 Improved speed of main path by 5 cycles
47//          Shortened path for x=1.0
48// 01/09/01 Improved speed, fixed flags for neg denormals
49// 05/20/02 Cleaned up namespace and sf0 syntax
50// 05/23/02 Modified algorithm. Now only one polynomial is used
51//          for |x-1| >= 1/256 and for |x-1| < 1/256
52// 12/11/02 Improved performance for Itanium 2
53// 03/31/05 Reformatted delimiters between data tables
54//
55// API
56//==============================================================
57// double log(double)
58// double log10(double)
59//
60//
61// Overview of operation
62//==============================================================
63// Background
64// ----------
65//
66// This algorithm is based on fact that
67// log(a b) = log(a) + log(b).
68// In our case we have x = 2^N f, where 1 <= f < 2.
69// So
70//   log(x) = log(2^N f) = log(2^N) + log(f) = n*log(2) + log(f)
71//
72// To calculate log(f) we do following
73//   log(f) = log(f * frcpa(f) / frcpa(f)) =
74//          = log(f * frcpa(f)) + log(1/frcpa(f))
75//
76// According to definition of IA-64's frcpa instruction it's a
77// floating point that approximates 1/f using a lookup on the
78// top of 8 bits of the input number's significand with relative
79// error < 2^(-8.886). So we have following
80//
81// |(1/f - frcpa(f)) / (1/f))| = |1 - f*frcpa(f)| < 1/256
82//
83// and
84//
85// log(f) = log(f * frcpa(f)) + log(1/frcpa(f)) =
86//        = log(1 + r) + T
87//
88// The first value can be computed by polynomial P(r) approximating
89// log(1 + r) on |r| < 1/256 and the second is precomputed tabular
90// value defined by top 8 bit of f.
91//
92// Finally we have that  log(x) ~ (N*log(2) + T) + P(r)
93//
94// Note that if input argument is close to 1.0 (in our case it means
95// that |1 - x| < 1/256) we can use just polynomial approximation
96// because x = 2^0 * f = f = 1 + r and
97// log(x) = log(1 + r) ~ P(r)
98//
99//
100// To compute log10(x) we use the simple identity
101//
102//  log10(x) = log(x)/log(10)
103//
104// so we have that
105//
106//  log10(x) = (N*log(2) + T  + log(1+r)) / log(10) =
107//           = N*(log(2)/log(10)) + (T/log(10)) + log(1 + r)/log(10)
108//
109//
110// Implementation
111// --------------
112// It can be seen that formulas for log and log10 differ from one another
113// only by coefficients and tabular values. Namely as log as log10 are
114// calculated as (N*L1 + T) + L2*Series(r) where in case of log
115//   L1 = log(2)
116//   T  = log(1/frcpa(x))
117//   L2 = 1.0
118// and in case of log10
119//   L1 = log(2)/log(10)
120//   T  = log(1/frcpa(x))/log(10)
121//   L2 = 1.0/log(10)
122//
123// So common code with two different entry points those set pointers
124// to the base address of coresponding data sets containing values
125// of L2,T and prepare integer representation of L1 needed for following
126// setf instruction.
127//
128// Note that both log and log10 use common approximation polynomial
129// it means we need only one set of coefficients of approximation.
130//
131//
132// 1. |x-1| >= 1/256
133//   InvX = frcpa(x)
134//   r = InvX*x - 1
135//   P(r) = r*((r*A3 - A2) + r^4*((A4 + r*A5) + r^2*(A6 + r*A7)),
136//   all coefficients are calculated in quad and rounded to double
137//   precision. A7,A6,A5,A4 are stored in memory whereas A3 and A2
138//   created with setf.
139//
140//   N = float(n) where n is true unbiased exponent of x
141//
142//   T is tabular value of log(1/frcpa(x)) calculated in quad precision
143//   and represented by two floating-point numbers 64-bit Thi and 32-bit Tlo.
144//   To load Thi,Tlo we get bits from 55 to 62 of register format significand
145//   as index and calculate two addresses
146//     ad_Thi = Thi_table_base_addr + 8 * index
147//     ad_Tlo = Tlo_table_base_addr + 4 * index
148//
149//   L2 (1.0 or 1.0/log(10) depending on function) is calculated in quad
150//   precision and rounded to double extended; it's loaded from memory.
151//
152//   L1 (log(2) or log10(2) depending on function) is calculated in quad
153//   precision and represented by two floating-point 64-bit numbers L1hi,L1lo
154//   stored in memory.
155//
156//   And final result = ((L1hi*N + Thi) + (N*L1lo + Tlo)) + L2*P(r)
157//
158//
159// 2. |x-1| < 1/256
160//   r = x - 1
161//   P(r) = r*((r*A3 - A2) + r^4*((A4 + r*A5) + r^2*(A6 + r*A7)),
162//   A7,A6,A5A4,A3,A2 are the same as in case |x-1| >= 1/256
163//
164//   And final results
165//     log(x)   = P(r)
166//     log10(x) = L2*P(r)
167//
168// 3. How we define is input argument such that |x-1| < 1/256 or not.
169//
170//    To do it we analyze biased exponent and integer representation of
171//    input argument
172//
173//      a) First we test is biased exponent equal to 0xFFFE or 0xFFFF (i.e.
174//         we test is 0.5 <= x < 2). This comparison can be performed using
175//         unsigned version of cmp instruction in such a way
176//         biased_exponent_of_x - 0xFFFE < 2
177//
178//
179//      b) Second (in case when result of a) is true) we need to compare x
180//         with 1-1/256 and 1+1/256 or in double precision memory representation
181//         with 0x3FEFE00000000000 and 0x3FF0100000000000 correspondingly.
182//         This comparison can be made like in a), using unsigned
183//         version of cmp i.e. ix - 0x3FEFE00000000000 < 0x0000300000000000.
184//         0x0000300000000000 is difference between 0x3FF0100000000000 and
185//         0x3FEFE00000000000
186//
187//    Note: NaT, any NaNs, +/-INF, +/-0, negatives and unnormalized numbers are
188//          filtered and processed on special branches.
189//
190
191//
192// Special values
193//==============================================================
194//
195// log(+0)    = -inf
196// log(-0)    = -inf
197//
198// log(+qnan) = +qnan
199// log(-qnan) = -qnan
200// log(+snan) = +qnan
201// log(-snan) = -qnan
202//
203// log(-n)    = QNAN Indefinite
204// log(-inf)  = QNAN Indefinite
205//
206// log(+inf)  = +inf
207//
208//
209// Registers used
210//==============================================================
211// Floating Point registers used:
212// f8, input
213// f7 -> f15,  f32 -> f42
214//
215// General registers used:
216// r8  -> r11
217// r14 -> r23
218//
219// Predicate registers used:
220// p6 -> p15
221
222// Assembly macros
223//==============================================================
224GR_TAG                 = r8
225GR_ad_1                = r8
226GR_ad_2                = r9
227GR_Exp                 = r10
228GR_N                   = r11
229
230GR_x                   = r14
231GR_dx                  = r15
232GR_NearOne             = r15
233GR_xorg                = r16
234GR_mask                = r16
235GR_05                  = r17
236GR_A3                  = r18
237GR_Sig                 = r19
238GR_Ind                 = r19
239GR_Nm1                 = r20
240GR_bias                = r21
241GR_ad_3                = r22
242GR_rexp                = r23
243
244
245GR_SAVE_B0             = r33
246GR_SAVE_PFS            = r34
247GR_SAVE_GP             = r35
248GR_SAVE_SP             = r36
249
250GR_Parameter_X         = r37
251GR_Parameter_Y         = r38
252GR_Parameter_RESULT    = r39
253GR_Parameter_TAG       = r40
254
255
256
257FR_NormX               = f7
258FR_RcpX                = f9
259FR_tmp                 = f9
260FR_r                   = f10
261FR_r2                  = f11
262FR_r4                  = f12
263FR_N                   = f13
264FR_Ln2hi               = f14
265FR_Ln2lo               = f15
266
267FR_A7                  = f32
268FR_A6                  = f33
269FR_A5                  = f34
270FR_A4                  = f35
271FR_A3                  = f36
272FR_A2                  = f37
273
274FR_Thi                 = f38
275FR_NxLn2hipThi         = f38
276FR_NxLn2pT             = f38
277FR_Tlo                 = f39
278FR_NxLn2lopTlo         = f39
279
280FR_InvLn10             = f40
281FR_A32                 = f41
282FR_A321                = f42
283
284
285FR_Y                   = f1
286FR_X                   = f10
287FR_RESULT              = f8
288
289
290// Data
291//==============================================================
292RODATA
293.align 16
294
295LOCAL_OBJECT_START(log_data)
296// coefficients of polynomial approximation
297data8 0x3FC2494104381A8E // A7
298data8 0xBFC5556D556BBB69 // A6
299//
300// two parts of ln(2)
301data8 0x3FE62E42FEF00000,0x3DD473DE6AF278ED
302//
303data8 0x8000000000000000,0x3FFF // 1.0
304//
305data8 0x3FC999999988B5E9 // A5
306data8 0xBFCFFFFFFFF6FFF5 // A4
307//
308// hi parts of ln(1/frcpa(1+i/256)), i=0...255
309data8 0x3F60040155D5889D // 0
310data8 0x3F78121214586B54 // 1
311data8 0x3F841929F96832EF // 2
312data8 0x3F8C317384C75F06 // 3
313data8 0x3F91A6B91AC73386 // 4
314data8 0x3F95BA9A5D9AC039 // 5
315data8 0x3F99D2A8074325F3 // 6
316data8 0x3F9D6B2725979802 // 7
317data8 0x3FA0C58FA19DFAA9 // 8
318data8 0x3FA2954C78CBCE1A // 9
319data8 0x3FA4A94D2DA96C56 // 10
320data8 0x3FA67C94F2D4BB58 // 11
321data8 0x3FA85188B630F068 // 12
322data8 0x3FAA6B8ABE73AF4C // 13
323data8 0x3FAC441E06F72A9E // 14
324data8 0x3FAE1E6713606D06 // 15
325data8 0x3FAFFA6911AB9300 // 16
326data8 0x3FB0EC139C5DA600 // 17
327data8 0x3FB1DBD2643D190B // 18
328data8 0x3FB2CC7284FE5F1C // 19
329data8 0x3FB3BDF5A7D1EE64 // 20
330data8 0x3FB4B05D7AA012E0 // 21
331data8 0x3FB580DB7CEB5701 // 22
332data8 0x3FB674F089365A79 // 23
333data8 0x3FB769EF2C6B568D // 24
334data8 0x3FB85FD927506A47 // 25
335data8 0x3FB9335E5D594988 // 26
336data8 0x3FBA2B0220C8E5F4 // 27
337data8 0x3FBB0004AC1A86AB // 28
338data8 0x3FBBF968769FCA10 // 29
339data8 0x3FBCCFEDBFEE13A8 // 30
340data8 0x3FBDA727638446A2 // 31
341data8 0x3FBEA3257FE10F79 // 32
342data8 0x3FBF7BE9FEDBFDE5 // 33
343data8 0x3FC02AB352FF25F3 // 34
344data8 0x3FC097CE579D204C // 35
345data8 0x3FC1178E8227E47B // 36
346data8 0x3FC185747DBECF33 // 37
347data8 0x3FC1F3B925F25D41 // 38
348data8 0x3FC2625D1E6DDF56 // 39
349data8 0x3FC2D1610C868139 // 40
350data8 0x3FC340C59741142E // 41
351data8 0x3FC3B08B6757F2A9 // 42
352data8 0x3FC40DFB08378003 // 43
353data8 0x3FC47E74E8CA5F7C // 44
354data8 0x3FC4EF51F6466DE4 // 45
355data8 0x3FC56092E02BA516 // 46
356data8 0x3FC5D23857CD74D4 // 47
357data8 0x3FC6313A37335D76 // 48
358data8 0x3FC6A399DABBD383 // 49
359data8 0x3FC70337DD3CE41A // 50
360data8 0x3FC77654128F6127 // 51
361data8 0x3FC7E9D82A0B022D // 52
362data8 0x3FC84A6B759F512E // 53
363data8 0x3FC8AB47D5F5A30F // 54
364data8 0x3FC91FE49096581B // 55
365data8 0x3FC981634011AA75 // 56
366data8 0x3FC9F6C407089664 // 57
367data8 0x3FCA58E729348F43 // 58
368data8 0x3FCABB55C31693AC // 59
369data8 0x3FCB1E104919EFD0 // 60
370data8 0x3FCB94EE93E367CA // 61
371data8 0x3FCBF851C067555E // 62
372data8 0x3FCC5C0254BF23A5 // 63
373data8 0x3FCCC000C9DB3C52 // 64
374data8 0x3FCD244D99C85673 // 65
375data8 0x3FCD88E93FB2F450 // 66
376data8 0x3FCDEDD437EAEF00 // 67
377data8 0x3FCE530EFFE71012 // 68
378data8 0x3FCEB89A1648B971 // 69
379data8 0x3FCF1E75FADF9BDE // 70
380data8 0x3FCF84A32EAD7C35 // 71
381data8 0x3FCFEB2233EA07CD // 72
382data8 0x3FD028F9C7035C1C // 73
383data8 0x3FD05C8BE0D9635A // 74
384data8 0x3FD085EB8F8AE797 // 75
385data8 0x3FD0B9C8E32D1911 // 76
386data8 0x3FD0EDD060B78080 // 77
387data8 0x3FD122024CF0063F // 78
388data8 0x3FD14BE2927AECD4 // 79
389data8 0x3FD180618EF18ADF // 80
390data8 0x3FD1B50BBE2FC63B // 81
391data8 0x3FD1DF4CC7CF242D // 82
392data8 0x3FD214456D0EB8D4 // 83
393data8 0x3FD23EC5991EBA49 // 84
394data8 0x3FD2740D9F870AFB // 85
395data8 0x3FD29ECDABCDFA03 // 86
396data8 0x3FD2D46602ADCCEE // 87
397data8 0x3FD2FF66B04EA9D4 // 88
398data8 0x3FD335504B355A37 // 89
399data8 0x3FD360925EC44F5C // 90
400data8 0x3FD38BF1C3337E74 // 91
401data8 0x3FD3C25277333183 // 92
402data8 0x3FD3EDF463C1683E // 93
403data8 0x3FD419B423D5E8C7 // 94
404data8 0x3FD44591E0539F48 // 95
405data8 0x3FD47C9175B6F0AD // 96
406data8 0x3FD4A8B341552B09 // 97
407data8 0x3FD4D4F39089019F // 98
408data8 0x3FD501528DA1F967 // 99
409data8 0x3FD52DD06347D4F6 // 100
410data8 0x3FD55A6D3C7B8A89 // 101
411data8 0x3FD5925D2B112A59 // 102
412data8 0x3FD5BF406B543DB1 // 103
413data8 0x3FD5EC433D5C35AD // 104
414data8 0x3FD61965CDB02C1E // 105
415data8 0x3FD646A84935B2A1 // 106
416data8 0x3FD6740ADD31DE94 // 107
417data8 0x3FD6A18DB74A58C5 // 108
418data8 0x3FD6CF31058670EC // 109
419data8 0x3FD6F180E852F0B9 // 110
420data8 0x3FD71F5D71B894EF // 111
421data8 0x3FD74D5AEFD66D5C // 112
422data8 0x3FD77B79922BD37D // 113
423data8 0x3FD7A9B9889F19E2 // 114
424data8 0x3FD7D81B037EB6A6 // 115
425data8 0x3FD8069E33827230 // 116
426data8 0x3FD82996D3EF8BCA // 117
427data8 0x3FD85855776DCBFA // 118
428data8 0x3FD8873658327CCE // 119
429data8 0x3FD8AA75973AB8CE // 120
430data8 0x3FD8D992DC8824E4 // 121
431data8 0x3FD908D2EA7D9511 // 122
432data8 0x3FD92C59E79C0E56 // 123
433data8 0x3FD95BD750EE3ED2 // 124
434data8 0x3FD98B7811A3EE5B // 125
435data8 0x3FD9AF47F33D406B // 126
436data8 0x3FD9DF270C1914A7 // 127
437data8 0x3FDA0325ED14FDA4 // 128
438data8 0x3FDA33440224FA78 // 129
439data8 0x3FDA57725E80C382 // 130
440data8 0x3FDA87D0165DD199 // 131
441data8 0x3FDAAC2E6C03F895 // 132
442data8 0x3FDADCCC6FDF6A81 // 133
443data8 0x3FDB015B3EB1E790 // 134
444data8 0x3FDB323A3A635948 // 135
445data8 0x3FDB56FA04462909 // 136
446data8 0x3FDB881AA659BC93 // 137
447data8 0x3FDBAD0BEF3DB164 // 138
448data8 0x3FDBD21297781C2F // 139
449data8 0x3FDC039236F08818 // 140
450data8 0x3FDC28CB1E4D32FC // 141
451data8 0x3FDC4E19B84723C1 // 142
452data8 0x3FDC7FF9C74554C9 // 143
453data8 0x3FDCA57B64E9DB05 // 144
454data8 0x3FDCCB130A5CEBAF // 145
455data8 0x3FDCF0C0D18F326F // 146
456data8 0x3FDD232075B5A201 // 147
457data8 0x3FDD490246DEFA6B // 148
458data8 0x3FDD6EFA918D25CD // 149
459data8 0x3FDD9509707AE52F // 150
460data8 0x3FDDBB2EFE92C554 // 151
461data8 0x3FDDEE2F3445E4AE // 152
462data8 0x3FDE148A1A2726CD // 153
463data8 0x3FDE3AFC0A49FF3F // 154
464data8 0x3FDE6185206D516D // 155
465data8 0x3FDE882578823D51 // 156
466data8 0x3FDEAEDD2EAC990C // 157
467data8 0x3FDED5AC5F436BE2 // 158
468data8 0x3FDEFC9326D16AB8 // 159
469data8 0x3FDF2391A21575FF // 160
470data8 0x3FDF4AA7EE03192C // 161
471data8 0x3FDF71D627C30BB0 // 162
472data8 0x3FDF991C6CB3B379 // 163
473data8 0x3FDFC07ADA69A90F // 164
474data8 0x3FDFE7F18EB03D3E // 165
475data8 0x3FE007C053C5002E // 166
476data8 0x3FE01B942198A5A0 // 167
477data8 0x3FE02F74400C64EA // 168
478data8 0x3FE04360BE7603AC // 169
479data8 0x3FE05759AC47FE33 // 170
480data8 0x3FE06B5F1911CF51 // 171
481data8 0x3FE078BF0533C568 // 172
482data8 0x3FE08CD9687E7B0E // 173
483data8 0x3FE0A10074CF9019 // 174
484data8 0x3FE0B5343A234476 // 175
485data8 0x3FE0C974C89431CD // 176
486data8 0x3FE0DDC2305B9886 // 177
487data8 0x3FE0EB524BAFC918 // 178
488data8 0x3FE0FFB54213A475 // 179
489data8 0x3FE114253DA97D9F // 180
490data8 0x3FE128A24F1D9AFF // 181
491data8 0x3FE1365252BF0864 // 182
492data8 0x3FE14AE558B4A92D // 183
493data8 0x3FE15F85A19C765B // 184
494data8 0x3FE16D4D38C119FA // 185
495data8 0x3FE18203C20DD133 // 186
496data8 0x3FE196C7BC4B1F3A // 187
497data8 0x3FE1A4A738B7A33C // 188
498data8 0x3FE1B981C0C9653C // 189
499data8 0x3FE1CE69E8BB106A // 190
500data8 0x3FE1DC619DE06944 // 191
501data8 0x3FE1F160A2AD0DA3 // 192
502data8 0x3FE2066D7740737E // 193
503data8 0x3FE2147DBA47A393 // 194
504data8 0x3FE229A1BC5EBAC3 // 195
505data8 0x3FE237C1841A502E // 196
506data8 0x3FE24CFCE6F80D9A // 197
507data8 0x3FE25B2C55CD5762 // 198
508data8 0x3FE2707F4D5F7C40 // 199
509data8 0x3FE285E0842CA383 // 200
510data8 0x3FE294294708B773 // 201
511data8 0x3FE2A9A2670AFF0C // 202
512data8 0x3FE2B7FB2C8D1CC0 // 203
513data8 0x3FE2C65A6395F5F5 // 204
514data8 0x3FE2DBF557B0DF42 // 205
515data8 0x3FE2EA64C3F97654 // 206
516data8 0x3FE3001823684D73 // 207
517data8 0x3FE30E97E9A8B5CC // 208
518data8 0x3FE32463EBDD34E9 // 209
519data8 0x3FE332F4314AD795 // 210
520data8 0x3FE348D90E7464CF // 211
521data8 0x3FE35779F8C43D6D // 212
522data8 0x3FE36621961A6A99 // 213
523data8 0x3FE37C299F3C366A // 214
524data8 0x3FE38AE2171976E7 // 215
525data8 0x3FE399A157A603E7 // 216
526data8 0x3FE3AFCCFE77B9D1 // 217
527data8 0x3FE3BE9D503533B5 // 218
528data8 0x3FE3CD7480B4A8A2 // 219
529data8 0x3FE3E3C43918F76C // 220
530data8 0x3FE3F2ACB27ED6C6 // 221
531data8 0x3FE4019C2125CA93 // 222
532data8 0x3FE4181061389722 // 223
533data8 0x3FE42711518DF545 // 224
534data8 0x3FE436194E12B6BF // 225
535data8 0x3FE445285D68EA69 // 226
536data8 0x3FE45BCC464C893A // 227
537data8 0x3FE46AED21F117FC // 228
538data8 0x3FE47A1527E8A2D3 // 229
539data8 0x3FE489445EFFFCCB // 230
540data8 0x3FE4A018BCB69835 // 231
541data8 0x3FE4AF5A0C9D65D7 // 232
542data8 0x3FE4BEA2A5BDBE87 // 233
543data8 0x3FE4CDF28F10AC46 // 234
544data8 0x3FE4DD49CF994058 // 235
545data8 0x3FE4ECA86E64A683 // 236
546data8 0x3FE503C43CD8EB68 // 237
547data8 0x3FE513356667FC57 // 238
548data8 0x3FE522AE0738A3D7 // 239
549data8 0x3FE5322E26867857 // 240
550data8 0x3FE541B5CB979809 // 241
551data8 0x3FE55144FDBCBD62 // 242
552data8 0x3FE560DBC45153C6 // 243
553data8 0x3FE5707A26BB8C66 // 244
554data8 0x3FE587F60ED5B8FF // 245
555data8 0x3FE597A7977C8F31 // 246
556data8 0x3FE5A760D634BB8A // 247
557data8 0x3FE5B721D295F10E // 248
558data8 0x3FE5C6EA94431EF9 // 249
559data8 0x3FE5D6BB22EA86F5 // 250
560data8 0x3FE5E6938645D38F // 251
561data8 0x3FE5F673C61A2ED1 // 252
562data8 0x3FE6065BEA385926 // 253
563data8 0x3FE6164BFA7CC06B // 254
564data8 0x3FE62643FECF9742 // 255
565//
566// lo parts of ln(1/frcpa(1+i/256)), i=0...255
567data4 0x20E70672 // 0
568data4 0x1F60A5D0 // 1
569data4 0x218EABA0 // 2
570data4 0x21403104 // 3
571data4 0x20E9B54E // 4
572data4 0x21EE1382 // 5
573data4 0x226014E3 // 6
574data4 0x2095E5C9 // 7
575data4 0x228BA9D4 // 8
576data4 0x22932B86 // 9
577data4 0x22608A57 // 10
578data4 0x220209F3 // 11
579data4 0x212882CC // 12
580data4 0x220D46E2 // 13
581data4 0x21FA4C28 // 14
582data4 0x229E5BD9 // 15
583data4 0x228C9838 // 16
584data4 0x2311F954 // 17
585data4 0x221365DF // 18
586data4 0x22BD0CB3 // 19
587data4 0x223D4BB7 // 20
588data4 0x22A71BBE // 21
589data4 0x237DB2FA // 22
590data4 0x23194C9D // 23
591data4 0x22EC639E // 24
592data4 0x2367E669 // 25
593data4 0x232E1D5F // 26
594data4 0x234A639B // 27
595data4 0x2365C0E0 // 28
596data4 0x234646C1 // 29
597data4 0x220CBF9C // 30
598data4 0x22A00FD4 // 31
599data4 0x2306A3F2 // 32
600data4 0x23745A9B // 33
601data4 0x2398D756 // 34
602data4 0x23DD0B6A // 35
603data4 0x23DE338B // 36
604data4 0x23A222DF // 37
605data4 0x223164F8 // 38
606data4 0x23B4E87B // 39
607data4 0x23D6CCB8 // 40
608data4 0x220C2099 // 41
609data4 0x21B86B67 // 42
610data4 0x236D14F1 // 43
611data4 0x225A923F // 44
612data4 0x22748723 // 45
613data4 0x22200D13 // 46
614data4 0x23C296EA // 47
615data4 0x2302AC38 // 48
616data4 0x234B1996 // 49
617data4 0x2385E298 // 50
618data4 0x23175BE5 // 51
619data4 0x2193F482 // 52
620data4 0x23BFEA90 // 53
621data4 0x23D70A0C // 54
622data4 0x231CF30A // 55
623data4 0x235D9E90 // 56
624data4 0x221AD0CB // 57
625data4 0x22FAA08B // 58
626data4 0x23D29A87 // 59
627data4 0x20C4B2FE // 60
628data4 0x2381B8B7 // 61
629data4 0x23F8D9FC // 62
630data4 0x23EAAE7B // 63
631data4 0x2329E8AA // 64
632data4 0x23EC0322 // 65
633data4 0x2357FDCB // 66
634data4 0x2392A9AD // 67
635data4 0x22113B02 // 68
636data4 0x22DEE901 // 69
637data4 0x236A6D14 // 70
638data4 0x2371D33E // 71
639data4 0x2146F005 // 72
640data4 0x23230B06 // 73
641data4 0x22F1C77D // 74
642data4 0x23A89FA3 // 75
643data4 0x231D1241 // 76
644data4 0x244DA96C // 77
645data4 0x23ECBB7D // 78
646data4 0x223E42B4 // 79
647data4 0x23801BC9 // 80
648data4 0x23573263 // 81
649data4 0x227C1158 // 82
650data4 0x237BD749 // 83
651data4 0x21DDBAE9 // 84
652data4 0x23401735 // 85
653data4 0x241D9DEE // 86
654data4 0x23BC88CB // 87
655data4 0x2396D5F1 // 88
656data4 0x23FC89CF // 89
657data4 0x2414F9A2 // 90
658data4 0x2474A0F5 // 91
659data4 0x24354B60 // 92
660data4 0x23C1EB40 // 93
661data4 0x2306DD92 // 94
662data4 0x24353B6B // 95
663data4 0x23CD1701 // 96
664data4 0x237C7A1C // 97
665data4 0x245793AA // 98
666data4 0x24563695 // 99
667data4 0x23C51467 // 100
668data4 0x24476B68 // 101
669data4 0x212585A9 // 102
670data4 0x247B8293 // 103
671data4 0x2446848A // 104
672data4 0x246A53F8 // 105
673data4 0x246E496D // 106
674data4 0x23ED1D36 // 107
675data4 0x2314C258 // 108
676data4 0x233244A7 // 109
677data4 0x245B7AF0 // 110
678data4 0x24247130 // 111
679data4 0x22D67B38 // 112
680data4 0x2449F620 // 113
681data4 0x23BBC8B8 // 114
682data4 0x237D3BA0 // 115
683data4 0x245E8F13 // 116
684data4 0x2435573F // 117
685data4 0x242DE666 // 118
686data4 0x2463BC10 // 119
687data4 0x2466587D // 120
688data4 0x2408144B // 121
689data4 0x2405F0E5 // 122
690data4 0x22381CFF // 123
691data4 0x24154F9B // 124
692data4 0x23A4E96E // 125
693data4 0x24052967 // 126
694data4 0x2406963F // 127
695data4 0x23F7D3CB // 128
696data4 0x2448AFF4 // 129
697data4 0x24657A21 // 130
698data4 0x22FBC230 // 131
699data4 0x243C8DEA // 132
700data4 0x225DC4B7 // 133
701data4 0x23496EBF // 134
702data4 0x237C2B2B // 135
703data4 0x23A4A5B1 // 136
704data4 0x2394E9D1 // 137
705data4 0x244BC950 // 138
706data4 0x23C7448F // 139
707data4 0x2404A1AD // 140
708data4 0x246511D5 // 141
709data4 0x24246526 // 142
710data4 0x23111F57 // 143
711data4 0x22868951 // 144
712data4 0x243EB77F // 145
713data4 0x239F3DFF // 146
714data4 0x23089666 // 147
715data4 0x23EBFA6A // 148
716data4 0x23C51312 // 149
717data4 0x23E1DD5E // 150
718data4 0x232C0944 // 151
719data4 0x246A741F // 152
720data4 0x2414DF8D // 153
721data4 0x247B5546 // 154
722data4 0x2415C980 // 155
723data4 0x24324ABD // 156
724data4 0x234EB5E5 // 157
725data4 0x2465E43E // 158
726data4 0x242840D1 // 159
727data4 0x24444057 // 160
728data4 0x245E56F0 // 161
729data4 0x21AE30F8 // 162
730data4 0x23FB3283 // 163
731data4 0x247A4D07 // 164
732data4 0x22AE314D // 165
733data4 0x246B7727 // 166
734data4 0x24EAD526 // 167
735data4 0x24B41DC9 // 168
736data4 0x24EE8062 // 169
737data4 0x24A0C7C4 // 170
738data4 0x24E8DA67 // 171
739data4 0x231120F7 // 172
740data4 0x24401FFB // 173
741data4 0x2412DD09 // 174
742data4 0x248C131A // 175
743data4 0x24C0A7CE // 176
744data4 0x243DD4C8 // 177
745data4 0x24457FEB // 178
746data4 0x24DEEFBB // 179
747data4 0x243C70AE // 180
748data4 0x23E7A6FA // 181
749data4 0x24C2D311 // 182
750data4 0x23026255 // 183
751data4 0x2437C9B9 // 184
752data4 0x246BA847 // 185
753data4 0x2420B448 // 186
754data4 0x24C4CF5A // 187
755data4 0x242C4981 // 188
756data4 0x24DE1525 // 189
757data4 0x24F5CC33 // 190
758data4 0x235A85DA // 191
759data4 0x24A0B64F // 192
760data4 0x244BA0A4 // 193
761data4 0x24AAF30A // 194
762data4 0x244C86F9 // 195
763data4 0x246D5B82 // 196
764data4 0x24529347 // 197
765data4 0x240DD008 // 198
766data4 0x24E98790 // 199
767data4 0x2489B0CE // 200
768data4 0x22BC29AC // 201
769data4 0x23F37C7A // 202
770data4 0x24987FE8 // 203
771data4 0x22AFE20B // 204
772data4 0x24C8D7C2 // 205
773data4 0x24B28B7D // 206
774data4 0x23B6B271 // 207
775data4 0x24C77CB6 // 208
776data4 0x24EF1DCA // 209
777data4 0x24A4F0AC // 210
778data4 0x24CF113E // 211
779data4 0x2496BBAB // 212
780data4 0x23C7CC8A // 213
781data4 0x23AE3961 // 214
782data4 0x2410A895 // 215
783data4 0x23CE3114 // 216
784data4 0x2308247D // 217
785data4 0x240045E9 // 218
786data4 0x24974F60 // 219
787data4 0x242CB39F // 220
788data4 0x24AB8D69 // 221
789data4 0x23436788 // 222
790data4 0x24305E9E // 223
791data4 0x243E71A9 // 224
792data4 0x23C2A6B3 // 225
793data4 0x23FFE6CF // 226
794data4 0x2322D801 // 227
795data4 0x24515F21 // 228
796data4 0x2412A0D6 // 229
797data4 0x24E60D44 // 230
798data4 0x240D9251 // 231
799data4 0x247076E2 // 232
800data4 0x229B101B // 233
801data4 0x247B12DE // 234
802data4 0x244B9127 // 235
803data4 0x2499EC42 // 236
804data4 0x21FC3963 // 237
805data4 0x23E53266 // 238
806data4 0x24CE102D // 239
807data4 0x23CC45D2 // 240
808data4 0x2333171D // 241
809data4 0x246B3533 // 242
810data4 0x24931129 // 243
811data4 0x24405FFA // 244
812data4 0x24CF464D // 245
813data4 0x237095CD // 246
814data4 0x24F86CBD // 247
815data4 0x24E2D84B // 248
816data4 0x21ACBB44 // 249
817data4 0x24F43A8C // 250
818data4 0x249DB931 // 251
819data4 0x24A385EF // 252
820data4 0x238B1279 // 253
821data4 0x2436213E // 254
822data4 0x24F18A3B // 255
823LOCAL_OBJECT_END(log_data)
824
825
826LOCAL_OBJECT_START(log10_data)
827// coefficients of polynoimal approximation
828data8 0x3FC2494104381A8E // A7
829data8 0xBFC5556D556BBB69 // A6
830//
831// two parts of ln(2)/ln(10)
832data8 0x3FD3441350900000, 0x3DCEF3FDE623E256
833//
834data8 0xDE5BD8A937287195,0x3FFD // 1/ln(10)
835//
836data8 0x3FC999999988B5E9 // A5
837data8 0xBFCFFFFFFFF6FFF5 // A4
838//
839// Hi parts of ln(1/frcpa(1+i/256))/ln(10), i=0...255
840data8 0x3F4BD27045BFD024 // 0
841data8 0x3F64E84E793A474A // 1
842data8 0x3F7175085AB85FF0 // 2
843data8 0x3F787CFF9D9147A5 // 3
844data8 0x3F7EA9D372B89FC8 // 4
845data8 0x3F82DF9D95DA961C // 5
846data8 0x3F866DF172D6372B // 6
847data8 0x3F898D79EF5EEDEF // 7
848data8 0x3F8D22ADF3F9579C // 8
849data8 0x3F9024231D30C398 // 9
850data8 0x3F91F23A98897D49 // 10
851data8 0x3F93881A7B818F9E // 11
852data8 0x3F951F6E1E759E35 // 12
853data8 0x3F96F2BCE7ADC5B4 // 13
854data8 0x3F988D362CDF359E // 14
855data8 0x3F9A292BAF010981 // 15
856data8 0x3F9BC6A03117EB97 // 16
857data8 0x3F9D65967DE3AB08 // 17
858data8 0x3F9F061167FC31E7 // 18
859data8 0x3FA05409E4F7819B // 19
860data8 0x3FA125D0432EA20D // 20
861data8 0x3FA1F85D440D299B // 21
862data8 0x3FA2AD755749617C // 22
863data8 0x3FA381772A00E603 // 23
864data8 0x3FA45643E165A70A // 24
865data8 0x3FA52BDD034475B8 // 25
866data8 0x3FA5E3966B7E9295 // 26
867data8 0x3FA6BAAF47C5B244 // 27
868data8 0x3FA773B3E8C4F3C7 // 28
869data8 0x3FA84C51EBEE8D15 // 29
870data8 0x3FA906A6786FC1CA // 30
871data8 0x3FA9C197ABF00DD6 // 31
872data8 0x3FAA9C78712191F7 // 32
873data8 0x3FAB58C09C8D637C // 33
874data8 0x3FAC15A8BCDD7B7E // 34
875data8 0x3FACD331E2C2967B // 35
876data8 0x3FADB11ED766ABF4 // 36
877data8 0x3FAE70089346A9E6 // 37
878data8 0x3FAF2F96C6754AED // 38
879data8 0x3FAFEFCA8D451FD5 // 39
880data8 0x3FB0585283764177 // 40
881data8 0x3FB0B913AAC7D3A6 // 41
882data8 0x3FB11A294F2569F5 // 42
883data8 0x3FB16B51A2696890 // 43
884data8 0x3FB1CD03ADACC8BD // 44
885data8 0x3FB22F0BDD7745F5 // 45
886data8 0x3FB2916ACA38D1E7 // 46
887data8 0x3FB2F4210DF7663C // 47
888data8 0x3FB346A6C3C49065 // 48
889data8 0x3FB3A9FEBC605409 // 49
890data8 0x3FB3FD0C10A3AA54 // 50
891data8 0x3FB46107D3540A81 // 51
892data8 0x3FB4C55DD16967FE // 52
893data8 0x3FB51940330C000A // 53
894data8 0x3FB56D620EE7115E // 54
895data8 0x3FB5D2ABCF26178D // 55
896data8 0x3FB6275AA5DEBF81 // 56
897data8 0x3FB68D4EAF26D7EE // 57
898data8 0x3FB6E28C5C54A28D // 58
899data8 0x3FB7380B9665B7C7 // 59
900data8 0x3FB78DCCC278E85B // 60
901data8 0x3FB7F50C2CF25579 // 61
902data8 0x3FB84B5FD5EAEFD7 // 62
903data8 0x3FB8A1F6BAB2B226 // 63
904data8 0x3FB8F8D144557BDF // 64
905data8 0x3FB94FEFDCD61D92 // 65
906data8 0x3FB9A752EF316149 // 66
907data8 0x3FB9FEFAE7611EDF // 67
908data8 0x3FBA56E8325F5C86 // 68
909data8 0x3FBAAF1B3E297BB3 // 69
910data8 0x3FBB079479C372AC // 70
911data8 0x3FBB6054553B12F7 // 71
912data8 0x3FBBB95B41AB5CE5 // 72
913data8 0x3FBC12A9B13FE079 // 73
914data8 0x3FBC6C4017382BEA // 74
915data8 0x3FBCB41FBA42686C // 75
916data8 0x3FBD0E38CE73393E // 76
917data8 0x3FBD689B2193F132 // 77
918data8 0x3FBDC3472B1D285F // 78
919data8 0x3FBE0C06300D528B // 79
920data8 0x3FBE6738190E394B // 80
921data8 0x3FBEC2B50D208D9A // 81
922data8 0x3FBF0C1C2B936827 // 82
923data8 0x3FBF68216C9CC726 // 83
924data8 0x3FBFB1F6381856F3 // 84
925data8 0x3FC00742AF4CE5F8 // 85
926data8 0x3FC02C64906512D2 // 86
927data8 0x3FC05AF1E63E03B4 // 87
928data8 0x3FC0804BEA723AA8 // 88
929data8 0x3FC0AF1FD6711526 // 89
930data8 0x3FC0D4B2A88059FF // 90
931data8 0x3FC0FA5EF136A06C // 91
932data8 0x3FC1299A4FB3E305 // 92
933data8 0x3FC14F806253C3EC // 93
934data8 0x3FC175805D1587C1 // 94
935data8 0x3FC19B9A637CA294 // 95
936data8 0x3FC1CB5FC26EDE16 // 96
937data8 0x3FC1F1B4E65F2590 // 97
938data8 0x3FC218248B5DC3E5 // 98
939data8 0x3FC23EAED62ADC76 // 99
940data8 0x3FC26553EBD337BC // 100
941data8 0x3FC28C13F1B118FF // 101
942data8 0x3FC2BCAA14381385 // 102
943data8 0x3FC2E3A740B7800E // 103
944data8 0x3FC30ABFD8F333B6 // 104
945data8 0x3FC331F403985096 // 105
946data8 0x3FC35943E7A6068F // 106
947data8 0x3FC380AFAC6E7C07 // 107
948data8 0x3FC3A8377997B9E5 // 108
949data8 0x3FC3CFDB771C9ADB // 109
950data8 0x3FC3EDA90D39A5DE // 110
951data8 0x3FC4157EC09505CC // 111
952data8 0x3FC43D7113FB04C0 // 112
953data8 0x3FC4658030AD1CCE // 113
954data8 0x3FC48DAC404638F5 // 114
955data8 0x3FC4B5F56CBBB869 // 115
956data8 0x3FC4DE5BE05E7582 // 116
957data8 0x3FC4FCBC0776FD85 // 117
958data8 0x3FC525561E9256EE // 118
959data8 0x3FC54E0DF3198865 // 119
960data8 0x3FC56CAB7112BDE2 // 120
961data8 0x3FC59597BA735B15 // 121
962data8 0x3FC5BEA23A506FD9 // 122
963data8 0x3FC5DD7E08DE382E // 123
964data8 0x3FC606BDD3F92355 // 124
965data8 0x3FC6301C518A501E // 125
966data8 0x3FC64F3770618915 // 126
967data8 0x3FC678CC14C1E2D7 // 127
968data8 0x3FC6981005ED2947 // 128
969data8 0x3FC6C1DB5F9BB335 // 129
970data8 0x3FC6E1488ECD2880 // 130
971data8 0x3FC70B4B2E7E41B8 // 131
972data8 0x3FC72AE209146BF8 // 132
973data8 0x3FC7551C81BD8DCF // 133
974data8 0x3FC774DD76CC43BD // 134
975data8 0x3FC79F505DB00E88 // 135
976data8 0x3FC7BF3BDE099F30 // 136
977data8 0x3FC7E9E7CAC437F8 // 137
978data8 0x3FC809FE4902D00D // 138
979data8 0x3FC82A2757995CBD // 139
980data8 0x3FC85525C625E098 // 140
981data8 0x3FC8757A79831887 // 141
982data8 0x3FC895E2058D8E02 // 142
983data8 0x3FC8C13437695531 // 143
984data8 0x3FC8E1C812EF32BE // 144
985data8 0x3FC9026F112197E8 // 145
986data8 0x3FC923294888880A // 146
987data8 0x3FC94EEA4B8334F2 // 147
988data8 0x3FC96FD1B639FC09 // 148
989data8 0x3FC990CCA66229AB // 149
990data8 0x3FC9B1DB33334842 // 150
991data8 0x3FC9D2FD740E6606 // 151
992data8 0x3FC9FF49EEDCB553 // 152
993data8 0x3FCA209A84FBCFF7 // 153
994data8 0x3FCA41FF1E43F02B // 154
995data8 0x3FCA6377D2CE9377 // 155
996data8 0x3FCA8504BAE0D9F5 // 156
997data8 0x3FCAA6A5EEEBEFE2 // 157
998data8 0x3FCAC85B878D7878 // 158
999data8 0x3FCAEA259D8FFA0B // 159
1000data8 0x3FCB0C0449EB4B6A // 160
1001data8 0x3FCB2DF7A5C50299 // 161
1002data8 0x3FCB4FFFCA70E4D1 // 162
1003data8 0x3FCB721CD17157E2 // 163
1004data8 0x3FCB944ED477D4EC // 164
1005data8 0x3FCBB695ED655C7C // 165
1006data8 0x3FCBD8F2364AEC0F // 166
1007data8 0x3FCBFB63C969F4FF // 167
1008data8 0x3FCC1DEAC134D4E9 // 168
1009data8 0x3FCC4087384F4F80 // 169
1010data8 0x3FCC6339498F09E1 // 170
1011data8 0x3FCC86010FFC076B // 171
1012data8 0x3FCC9D3D065C5B41 // 172
1013data8 0x3FCCC029375BA079 // 173
1014data8 0x3FCCE32B66978BA4 // 174
1015data8 0x3FCD0643AFD51404 // 175
1016data8 0x3FCD29722F0DEA45 // 176
1017data8 0x3FCD4CB70070FE43 // 177
1018data8 0x3FCD6446AB3F8C95 // 178
1019data8 0x3FCD87B0EF71DB44 // 179
1020data8 0x3FCDAB31D1FE99A6 // 180
1021data8 0x3FCDCEC96FDC888E // 181
1022data8 0x3FCDE69088763579 // 182
1023data8 0x3FCE0A4E4A25C1FF // 183
1024data8 0x3FCE2E2315755E32 // 184
1025data8 0x3FCE461322D1648A // 185
1026data8 0x3FCE6A0E95C7787B // 186
1027data8 0x3FCE8E216243DD60 // 187
1028data8 0x3FCEA63AF26E007C // 188
1029data8 0x3FCECA74ED15E0B7 // 189
1030data8 0x3FCEEEC692CCD259 // 190
1031data8 0x3FCF070A36B8D9C0 // 191
1032data8 0x3FCF2B8393E34A2D // 192
1033data8 0x3FCF5014EF538A5A // 193
1034data8 0x3FCF68833AF1B17F // 194
1035data8 0x3FCF8D3CD9F3F04E // 195
1036data8 0x3FCFA5C61ADD93E9 // 196
1037data8 0x3FCFCAA8567EBA79 // 197
1038data8 0x3FCFE34CC8743DD8 // 198
1039data8 0x3FD0042BFD74F519 // 199
1040data8 0x3FD016BDF6A18017 // 200
1041data8 0x3FD023262F907322 // 201
1042data8 0x3FD035CCED8D32A1 // 202
1043data8 0x3FD042430E869FFB // 203
1044data8 0x3FD04EBEC842B2DF // 204
1045data8 0x3FD06182E84FD4AB // 205
1046data8 0x3FD06E0CB609D383 // 206
1047data8 0x3FD080E60BEC8F12 // 207
1048data8 0x3FD08D7E0D894735 // 208
1049data8 0x3FD0A06CC96A2055 // 209
1050data8 0x3FD0AD131F3B3C55 // 210
1051data8 0x3FD0C01771E775FB // 211
1052data8 0x3FD0CCCC3CAD6F4B // 212
1053data8 0x3FD0D986D91A34A8 // 213
1054data8 0x3FD0ECA9B8861A2D // 214
1055data8 0x3FD0F972F87FF3D5 // 215
1056data8 0x3FD106421CF0E5F7 // 216
1057data8 0x3FD11983EBE28A9C // 217
1058data8 0x3FD12661E35B7859 // 218
1059data8 0x3FD13345D2779D3B // 219
1060data8 0x3FD146A6F597283A // 220
1061data8 0x3FD15399E81EA83D // 221
1062data8 0x3FD16092E5D3A9A6 // 222
1063data8 0x3FD17413C3B7AB5D // 223
1064data8 0x3FD1811BF629D6FA // 224
1065data8 0x3FD18E2A47B46685 // 225
1066data8 0x3FD19B3EBE1A4418 // 226
1067data8 0x3FD1AEE9017CB450 // 227
1068data8 0x3FD1BC0CED7134E1 // 228
1069data8 0x3FD1C93712ABC7FF // 229
1070data8 0x3FD1D66777147D3E // 230
1071data8 0x3FD1EA3BD1286E1C // 231
1072data8 0x3FD1F77BED932C4C // 232
1073data8 0x3FD204C25E1B031F // 233
1074data8 0x3FD2120F28CE69B1 // 234
1075data8 0x3FD21F6253C48D00 // 235
1076data8 0x3FD22CBBE51D60A9 // 236
1077data8 0x3FD240CE4C975444 // 237
1078data8 0x3FD24E37F8ECDAE7 // 238
1079data8 0x3FD25BA8215AF7FC // 239
1080data8 0x3FD2691ECC29F042 // 240
1081data8 0x3FD2769BFFAB2DFF // 241
1082data8 0x3FD2841FC23952C9 // 242
1083data8 0x3FD291AA1A384978 // 243
1084data8 0x3FD29F3B0E15584A // 244
1085data8 0x3FD2B3A0EE479DF7 // 245
1086data8 0x3FD2C142842C09E5 // 246
1087data8 0x3FD2CEEACCB7BD6C // 247
1088data8 0x3FD2DC99CE82FF20 // 248
1089data8 0x3FD2EA4F902FD7D9 // 249
1090data8 0x3FD2F80C186A25FC // 250
1091data8 0x3FD305CF6DE7B0F6 // 251
1092data8 0x3FD3139997683CE7 // 252
1093data8 0x3FD3216A9BB59E7C // 253
1094data8 0x3FD32F4281A3CEFE // 254
1095data8 0x3FD33D2150110091 // 255
1096//
1097// Lo parts of ln(1/frcpa(1+i/256))/ln(10), i=0...255
1098data4 0x1FB0EB5A // 0
1099data4 0x206E5EE3 // 1
1100data4 0x208F3609 // 2
1101data4 0x2070EB03 // 3
1102data4 0x1F314BAE // 4
1103data4 0x217A889D // 5
1104data4 0x21E63650 // 6
1105data4 0x21C2F4A3 // 7
1106data4 0x2192A10C // 8
1107data4 0x1F84B73E // 9
1108data4 0x2243FBCA // 10
1109data4 0x21BD9C51 // 11
1110data4 0x213C542B // 12
1111data4 0x21047386 // 13
1112data4 0x21217D8F // 14
1113data4 0x226791B7 // 15
1114data4 0x204CCE66 // 16
1115data4 0x2234CE9F // 17
1116data4 0x220675E2 // 18
1117data4 0x22B8E5BA // 19
1118data4 0x22C12D14 // 20
1119data4 0x211D41F0 // 21
1120data4 0x228507F3 // 22
1121data4 0x22F7274B // 23
1122data4 0x22A7FDD1 // 24
1123data4 0x2244A06E // 25
1124data4 0x215DCE69 // 26
1125data4 0x22F5C961 // 27
1126data4 0x22EBEF29 // 28
1127data4 0x222A2CB6 // 29
1128data4 0x22B9FE00 // 30
1129data4 0x22E79EB7 // 31
1130data4 0x222F9607 // 32
1131data4 0x2189D87F // 33
1132data4 0x2236DB45 // 34
1133data4 0x22ED77FB // 35
1134data4 0x21CB70F0 // 36
1135data4 0x21B8ACE8 // 37
1136data4 0x22EC58C1 // 38
1137data4 0x22CFCC1C // 39
1138data4 0x2343E77A // 40
1139data4 0x237FBC7F // 41
1140data4 0x230D472E // 42
1141data4 0x234686FB // 43
1142data4 0x23770425 // 44
1143data4 0x223977EC // 45
1144data4 0x2345800A // 46
1145data4 0x237BC351 // 47
1146data4 0x23191502 // 48
1147data4 0x232BAC12 // 49
1148data4 0x22692421 // 50
1149data4 0x234D409D // 51
1150data4 0x22EC3214 // 52
1151data4 0x2376C916 // 53
1152data4 0x22B00DD1 // 54
1153data4 0x2309D910 // 55
1154data4 0x22F925FD // 56
1155data4 0x22A63A7B // 57
1156data4 0x2106264A // 58
1157data4 0x234227F9 // 59
1158data4 0x1ECB1978 // 60
1159data4 0x23460A62 // 61
1160data4 0x232ED4B1 // 62
1161data4 0x226DDC38 // 63
1162data4 0x1F101A73 // 64
1163data4 0x21B1F82B // 65
1164data4 0x22752F19 // 66
1165data4 0x2320BC15 // 67
1166data4 0x236EEC5E // 68
1167data4 0x23404D3E // 69
1168data4 0x2304C517 // 70
1169data4 0x22F7441A // 71
1170data4 0x230D3D7A // 72
1171data4 0x2264A9DF // 73
1172data4 0x22410CC8 // 74
1173data4 0x2342CCCB // 75
1174data4 0x23560BD4 // 76
1175data4 0x237BBFFE // 77
1176data4 0x2373A206 // 78
1177data4 0x22C871B9 // 79
1178data4 0x2354B70C // 80
1179data4 0x232EDB33 // 81
1180data4 0x235DB680 // 82
1181data4 0x230EF422 // 83
1182data4 0x235316CA // 84
1183data4 0x22EEEE8B // 85
1184data4 0x2375C88C // 86
1185data4 0x235ABD21 // 87
1186data4 0x23A0D232 // 88
1187data4 0x23F5FFB5 // 89
1188data4 0x23D3CEC8 // 90
1189data4 0x22A92204 // 91
1190data4 0x238C64DF // 92
1191data4 0x23B82896 // 93
1192data4 0x22D633B8 // 94
1193data4 0x23861E93 // 95
1194data4 0x23CB594B // 96
1195data4 0x2330387E // 97
1196data4 0x21CD4702 // 98
1197data4 0x2284C505 // 99
1198data4 0x23D6995C // 100
1199data4 0x23F6C807 // 101
1200data4 0x239CEF5C // 102
1201data4 0x239442B0 // 103
1202data4 0x22B35EE5 // 104
1203data4 0x2391E9A4 // 105
1204data4 0x23A390F5 // 106
1205data4 0x2349AC9C // 107
1206data4 0x23FA5535 // 108
1207data4 0x21E3A46A // 109
1208data4 0x23B44ABA // 110
1209data4 0x23CEA8E0 // 111
1210data4 0x23F647DC // 112
1211data4 0x2390D1A8 // 113
1212data4 0x23D0CFA2 // 114
1213data4 0x236E0872 // 115
1214data4 0x23B88B91 // 116
1215data4 0x2283C359 // 117
1216data4 0x232F647F // 118
1217data4 0x23122CD7 // 119
1218data4 0x232CF564 // 120
1219data4 0x232630FD // 121
1220data4 0x23BEE1C8 // 122
1221data4 0x23B2BD30 // 123
1222data4 0x2301F1C0 // 124
1223data4 0x23CE4D67 // 125
1224data4 0x23A353C9 // 126
1225data4 0x238086E8 // 127
1226data4 0x22D0D29E // 128
1227data4 0x23A3B3C8 // 129
1228data4 0x23F69F4B // 130
1229data4 0x23EA3C21 // 131
1230data4 0x23951C88 // 132
1231data4 0x2372AFFC // 133
1232data4 0x23A6D1A8 // 134
1233data4 0x22BBBAF4 // 135
1234data4 0x227FA3DD // 136
1235data4 0x23804D9B // 137
1236data4 0x232D771F // 138
1237data4 0x239CB57B // 139
1238data4 0x2303CF34 // 140
1239data4 0x22218C2A // 141
1240data4 0x23991BEE // 142
1241data4 0x23EB3596 // 143
1242data4 0x230487FA // 144
1243data4 0x2135DF4C // 145
1244data4 0x2380FD2D // 146
1245data4 0x23EB75E9 // 147
1246data4 0x211C62C8 // 148
1247data4 0x23F518F1 // 149
1248data4 0x23FEF882 // 150
1249data4 0x239097C7 // 151
1250data4 0x223E2BDA // 152
1251data4 0x23988F89 // 153
1252data4 0x22E4A4AD // 154
1253data4 0x23F03D9C // 155
1254data4 0x23F5018F // 156
1255data4 0x23E1E250 // 157
1256data4 0x23FD3D90 // 158
1257data4 0x22DEE2FF // 159
1258data4 0x238342AB // 160
1259data4 0x22E6736F // 161
1260data4 0x233AFC28 // 162
1261data4 0x2395F661 // 163
1262data4 0x23D8B991 // 164
1263data4 0x23CD58D5 // 165
1264data4 0x21941FD6 // 166
1265data4 0x23352915 // 167
1266data4 0x235D09EE // 168
1267data4 0x22DC7EF9 // 169
1268data4 0x238BC9F3 // 170
1269data4 0x2397DF8F // 171
1270data4 0x2380A7BB // 172
1271data4 0x23EFF48C // 173
1272data4 0x21E67408 // 174
1273data4 0x236420F7 // 175
1274data4 0x22C8DFB5 // 176
1275data4 0x239B5D35 // 177
1276data4 0x23BDC09D // 178
1277data4 0x239E822C // 179
1278data4 0x23984F0A // 180
1279data4 0x23EF2119 // 181
1280data4 0x23F738B8 // 182
1281data4 0x23B66187 // 183
1282data4 0x23B06AD7 // 184
1283data4 0x2369140F // 185
1284data4 0x218DACE6 // 186
1285data4 0x21DF23F1 // 187
1286data4 0x235D8B34 // 188
1287data4 0x23460333 // 189
1288data4 0x23F11D62 // 190
1289data4 0x23C37147 // 191
1290data4 0x22B2AE2A // 192
1291data4 0x23949211 // 193
1292data4 0x23B69799 // 194
1293data4 0x23DBEC75 // 195
1294data4 0x229A6FB3 // 196
1295data4 0x23FC6C60 // 197
1296data4 0x22D01FFC // 198
1297data4 0x235985F0 // 199
1298data4 0x23F7ECA5 // 200
1299data4 0x23F924D3 // 201
1300data4 0x2381B92F // 202
1301data4 0x243A0FBE // 203
1302data4 0x24712D72 // 204
1303data4 0x24594E2F // 205
1304data4 0x220CD12A // 206
1305data4 0x23D87FB0 // 207
1306data4 0x2338288A // 208
1307data4 0x242BB2CC // 209
1308data4 0x220F6265 // 210
1309data4 0x23BB7FE3 // 211
1310data4 0x2301C0A2 // 212
1311data4 0x246709AB // 213
1312data4 0x23A619E2 // 214
1313data4 0x24030E3B // 215
1314data4 0x233C36CC // 216
1315data4 0x241AAB77 // 217
1316data4 0x243D41A3 // 218
1317data4 0x23834A60 // 219
1318data4 0x236AC7BF // 220
1319data4 0x23B6D597 // 221
1320data4 0x210E9474 // 222
1321data4 0x242156E6 // 223
1322data4 0x243A1D68 // 224
1323data4 0x2472187C // 225
1324data4 0x23834E86 // 226
1325data4 0x23CA0807 // 227
1326data4 0x24745887 // 228
1327data4 0x23E2B0E1 // 229
1328data4 0x2421EB67 // 230
1329data4 0x23DCC64E // 231
1330data4 0x22DF71D1 // 232
1331data4 0x238D5ECA // 233
1332data4 0x23CDE86F // 234
1333data4 0x24131F45 // 235
1334data4 0x240FE4E2 // 236
1335data4 0x2317731A // 237
1336data4 0x24015C76 // 238
1337data4 0x2301A4E8 // 239
1338data4 0x23E52A6D // 240
1339data4 0x247D8A0D // 241
1340data4 0x23DFEEBA // 242
1341data4 0x22139FEC // 243
1342data4 0x2454A112 // 244
1343data4 0x23C21E28 // 245
1344data4 0x2460D813 // 246
1345data4 0x24258924 // 247
1346data4 0x2425680F // 248
1347data4 0x24194D1E // 249
1348data4 0x24242C2F // 250
1349data4 0x243DDE5E // 251
1350data4 0x23DEB388 // 252
1351data4 0x23E0E6EB // 253
1352data4 0x24393E74 // 254
1353data4 0x241B1863 // 255
1354LOCAL_OBJECT_END(log10_data)
1355
1356
1357
1358// Code
1359//==============================================================
1360
1361// log   has p13 true, p14 false
1362// log10 has p14 true, p13 false
1363
1364.section .text
1365GLOBAL_IEEE754_ENTRY(log10)
1366{ .mfi
1367      getf.exp      GR_Exp = f8 // if x is unorm then must recompute
1368      frcpa.s1      FR_RcpX,p0 = f1,f8
1369      mov           GR_05 = 0xFFFE // biased exponent of A2=0.5
1370}
1371{ .mlx
1372      addl          GR_ad_1 = @ltoff(log10_data),gp
1373      movl          GR_A3 = 0x3fd5555555555557 // double precision memory
1374                                               // representation of A3
1375};;
1376
1377{ .mfi
1378      getf.sig      GR_Sig = f8 // get significand to calculate index
1379      fclass.m      p8,p0 = f8,9 // is x positive unorm?
1380      mov           GR_xorg = 0x3fefe // double precision memory msb of 255/256
1381}
1382{ .mib
1383      ld8           GR_ad_1 = [GR_ad_1]
1384      cmp.eq        p14,p13 = r0,r0 // set p14 to 1 for log10
1385      br.cond.sptk  log_log10_common
1386};;
1387GLOBAL_IEEE754_END(log10)
1388libm_alias_double_other (__log10, log10)
1389
1390
1391GLOBAL_IEEE754_ENTRY(log)
1392{ .mfi
1393      getf.exp      GR_Exp = f8 // if x is unorm then must recompute
1394      frcpa.s1      FR_RcpX,p0 = f1,f8
1395      mov           GR_05 = 0xfffe
1396}
1397{ .mlx
1398      addl          GR_ad_1 = @ltoff(log_data),gp
1399      movl          GR_A3 = 0x3fd5555555555557 // double precision memory
1400                                               // representation of A3
1401};;
1402
1403{ .mfi
1404      getf.sig      GR_Sig = f8 // get significand to calculate index
1405      fclass.m      p8,p0 = f8,9 // is x positive unorm?
1406      mov           GR_xorg = 0x3fefe // double precision memory msb of 255/256
1407}
1408{ .mfi
1409      ld8           GR_ad_1 = [GR_ad_1]
1410      nop.f         0
1411      cmp.eq        p13,p14 = r0,r0 // set p13 to 1 for log
1412};;
1413
1414log_log10_common:
1415{ .mfi
1416      getf.d        GR_x = f8 // double precision memory representation of x
1417      fclass.m      p9,p0 = f8,0x1E1 // is x NaN, NaT or +Inf?
1418      dep.z         GR_dx = 3, 44, 2 // Create 0x0000300000000000
1419                                     // Difference between double precision
1420                                     // memory representations of 257/256 and
1421                                     // 255/256
1422}
1423{ .mfi
1424      setf.exp      FR_A2 = GR_05 // create A2
1425      fnorm.s1      FR_NormX = f8
1426      mov           GR_bias = 0xffff
1427};;
1428
1429{ .mfi
1430      setf.d        FR_A3 = GR_A3 // create A3
1431      fcmp.eq.s1    p12,p0 = f1,f8 // is x equal to 1.0?
1432      dep.z         GR_xorg = GR_xorg, 44, 19 // 0x3fefe00000000000
1433                                              // double precision memory
1434                                              // representation of 255/256
1435}
1436{ .mib
1437      add           GR_ad_2 = 0x30,GR_ad_1 // address of A5,A4
1438      add           GR_ad_3 = 0x840,GR_ad_1 // address of ln(1/frcpa) lo parts
1439(p8)  br.cond.spnt  log_positive_unorms
1440};;
1441
1442log_core:
1443{ .mfi
1444      ldfpd         FR_A7,FR_A6 = [GR_ad_1],16
1445      fclass.m      p10,p0 = f8,0x3A // is x < 0?
1446      sub           GR_Nm1 = GR_Exp,GR_05 // unbiased_exponent_of_x - 1
1447}
1448{ .mfi
1449      ldfpd         FR_A5,FR_A4 = [GR_ad_2],16
1450(p9)  fma.d.s0      f8 = f8,f1,f0 // set V-flag
1451      sub           GR_N = GR_Exp,GR_bias // unbiased_exponent_of_x
1452};;
1453
1454{ .mfi
1455      setf.sig      FR_N = GR_N // copy unbiased exponent of x to significand
1456      fms.s1        FR_r = FR_RcpX,f8,f1 // range reduction for |x-1|>=1/256
1457      extr.u        GR_Ind = GR_Sig,55,8 // get bits from 55 to 62 as index
1458}
1459{ .mib
1460      sub           GR_x = GR_x, GR_xorg // get diff between x and 255/256
1461      cmp.gtu       p6, p7 = 2, GR_Nm1 // p6 true if 0.5 <= x < 2
1462(p9)  br.ret.spnt   b0 // exit for NaN, NaT and +Inf
1463};;
1464
1465{ .mfi
1466      ldfpd         FR_Ln2hi,FR_Ln2lo = [GR_ad_1],16
1467      fclass.m      p11,p0 = f8,0x07 // is x = 0?
1468      shladd        GR_ad_3 = GR_Ind,2,GR_ad_3 // address of Tlo
1469}
1470{ .mib
1471      shladd        GR_ad_2 = GR_Ind,3,GR_ad_2 // address of Thi
1472(p6)  cmp.leu       p6, p7 = GR_x, GR_dx       // 255/256 <= x <= 257/256
1473(p10) br.cond.spnt  log_negatives // jump if x is negative
1474};;
1475
1476// p6 is true if |x-1| < 1/256
1477// p7 is true if |x-1| >= 1/256
1478{ .mfi
1479      ldfd          FR_Thi = [GR_ad_2]
1480(p6)  fms.s1        FR_r = f8,f1,f1 // range reduction for |x-1|<1/256
1481      nop.i         0
1482};;
1483
1484{ .mmi
1485(p7)  ldfs          FR_Tlo = [GR_ad_3]
1486      nop.m         0
1487      nop.i         0
1488}
1489{ .mfb
1490      nop.m         0
1491(p12) fma.d.s0      f8 = f0,f0,f0
1492(p12) br.ret.spnt   b0 // exit for +1.0
1493};;
1494
1495.pred.rel "mutex",p6,p7
1496{ .mfi
1497(p6)  mov           GR_NearOne = 1
1498      fms.s1        FR_A32 = FR_A3,FR_r,FR_A2 // A3*r-A2
1499(p7)  mov           GR_NearOne = 0
1500}
1501{ .mfb
1502      ldfe          FR_InvLn10 = [GR_ad_1],16
1503      fma.s1        FR_r2 = FR_r,FR_r,f0 // r^2
1504(p11) br.cond.spnt  log_zeroes // jump if x is zero
1505};;
1506
1507{ .mfi
1508      nop.m         0
1509      fma.s1        FR_A6 = FR_A7,FR_r,FR_A6 // A7*r+A6
1510      nop.i         0
1511}
1512{ .mfi
1513(p7)  cmp.eq.unc    p9,p0 = r0,r0  // set p9 if |x-1| > 1/256
1514      fma.s1        FR_A4 = FR_A5,FR_r,FR_A4 // A5*r+A4
1515(p14) cmp.eq.unc    p8,p0 = 1,GR_NearOne // set p8 to 1 if it's log10
1516                                         // and argument near 1.0
1517};;
1518
1519{ .mfi
1520(p6)  getf.exp      GR_rexp = FR_r  // Get signexp of x-1
1521(p7)  fcvt.xf       FR_N = FR_N
1522(p8)  cmp.eq        p9,p6 = r0,r0        // Also set p9 and clear p6 if log10
1523                                         // and arg near 1
1524};;
1525
1526{ .mfi
1527      nop.m         0
1528      fma.s1        FR_r4 = FR_r2,FR_r2,f0 // r^4
1529      nop.i         0
1530}
1531{ .mfi
1532      nop.m         0
1533(p8)  fma.s1        FR_NxLn2pT = f0,f0,f0  // Clear NxLn2pT if log10 near 1
1534      nop.i         0
1535};;
1536
1537{ .mfi
1538      nop.m         0
1539      // (A3*r+A2)*r^2+r
1540      fma.s1        FR_A321 = FR_A32,FR_r2,FR_r
1541      mov           GR_mask = 0x1ffff
1542}
1543{ .mfi
1544      nop.m         0
1545      // (A7*r+A6)*r^2+(A5*r+A4)
1546      fma.s1        FR_A4 = FR_A6,FR_r2,FR_A4
1547      nop.i         0
1548};;
1549
1550{ .mfi
1551(p6)  and           GR_rexp = GR_rexp, GR_mask
1552      // N*Ln2hi+Thi
1553(p7)  fma.s1        FR_NxLn2hipThi = FR_N,FR_Ln2hi,FR_Thi
1554      nop.i         0
1555}
1556{ .mfi
1557      nop.m         0
1558      // N*Ln2lo+Tlo
1559(p7)  fma.s1        FR_NxLn2lopTlo = FR_N,FR_Ln2lo,FR_Tlo
1560      nop.i         0
1561};;
1562
1563{ .mfi
1564(p6)  sub           GR_rexp = GR_rexp, GR_bias // unbiased exponent of x-1
1565(p9)  fma.s1        f8 = FR_A4,FR_r4,FR_A321 // P(r) if |x-1| >= 1/256 or
1566                                             // log10 and |x-1| < 1/256
1567      nop.i         0
1568}
1569{ .mfi
1570      nop.m         0
1571      // (N*Ln2hi+Thi) + (N*Ln2lo+Tlo)
1572(p7)  fma.s1        FR_NxLn2pT = FR_NxLn2hipThi,f1,FR_NxLn2lopTlo
1573      nop.i         0
1574};;
1575
1576{ .mfi
1577(p6)  cmp.gt.unc    p10, p6 = -40, GR_rexp // Test |x-1| < 2^-40
1578      nop.f         0
1579      nop.i         0
1580};;
1581
1582{ .mfi
1583      nop.m         0
1584(p10) fma.d.s0      f8 = FR_A32,FR_r2,FR_r // log(x) if |x-1| < 2^-40
1585      nop.i         0
1586};;
1587
1588.pred.rel "mutex",p6,p9
1589{ .mfi
1590      nop.m         0
1591(p6)  fma.d.s0      f8 = FR_A4,FR_r4,FR_A321 // log(x) if 2^-40 <= |x-1| < 1/256
1592      nop.i         0
1593}
1594{ .mfb
1595      nop.m         0
1596(p9)  fma.d.s0      f8 = f8,FR_InvLn10,FR_NxLn2pT // result if |x-1| >= 1/256
1597                                                  // or log10 and |x-1| < 1/256
1598      br.ret.sptk   b0
1599};;
1600
1601.align 32
1602log_positive_unorms:
1603{ .mmf
1604      getf.exp      GR_Exp = FR_NormX // recompute biased exponent
1605      getf.d        GR_x = FR_NormX   // recompute double precision x
1606      fcmp.eq.s1    p12,p0 = f1,FR_NormX // is x equal to 1.0?
1607};;
1608
1609{ .mfb
1610      getf.sig      GR_Sig = FR_NormX // recompute significand
1611      fcmp.eq.s0    p15, p0 = f8, f0  // set denormal flag
1612      br.cond.sptk  log_core
1613};;
1614
1615.align 32
1616log_zeroes:
1617{ .mfi
1618      nop.m         0
1619      fmerge.s      FR_X = f8,f8 // keep input argument for subsequent
1620                                 // call of __libm_error_support#
1621      nop.i         0
1622}
1623{ .mfi
1624      nop.m         0
1625      fms.s1        FR_tmp = f0,f0,f1 // -1.0
1626      nop.i         0
1627};;
1628
1629.pred.rel "mutex",p13,p14
1630{ .mfi
1631(p13) mov           GR_TAG = 2 // set libm error in case of log
1632      frcpa.s0      f8,p0 = FR_tmp,f0 // log(+/-0) should be equal to -INF.
1633                                      // We can get it using frcpa because it
1634                                      // sets result to the IEEE-754 mandated
1635                                      // quotient of FR_tmp/f0.
1636                                      // As far as FR_tmp is -1 it'll be -INF
1637      nop.i         0
1638}
1639{ .mib
1640(p14) mov           GR_TAG = 8 // set libm error in case of log10
1641      nop.i         0
1642      br.cond.sptk  log_libm_err
1643};;
1644
1645.align 32
1646log_negatives:
1647{ .mfi
1648      nop.m         0
1649      fmerge.s      FR_X = f8,f8
1650      nop.i         0
1651};;
1652
1653.pred.rel "mutex",p13,p14
1654{ .mfi
1655(p13) mov           GR_TAG = 3 // set libm error in case of log
1656      frcpa.s0      f8,p0 = f0,f0 // log(negatives) should be equal to NaN.
1657                                  // We can get it using frcpa because it
1658                                  // sets result to the IEEE-754 mandated
1659                                  // quotient of f0/f0 i.e. NaN.
1660(p14) mov           GR_TAG = 9 // set libm error in case of log10
1661};;
1662
1663.align 32
1664log_libm_err:
1665{ .mmi
1666      alloc         r32 = ar.pfs,1,4,4,0
1667      mov           GR_Parameter_TAG = GR_TAG
1668      nop.i         0
1669};;
1670GLOBAL_IEEE754_END(log)
1671libm_alias_double_other (__log, log)
1672#ifdef SHARED
1673.symver log,log@@GLIBC_2.29
1674.weak __log_compat
1675.set __log_compat,__log
1676.symver __log_compat,log@GLIBC_2.2
1677#endif
1678
1679
1680LOCAL_LIBM_ENTRY(__libm_error_region)
1681.prologue
1682{ .mfi
1683        add   GR_Parameter_Y = -32,sp         // Parameter 2 value
1684        nop.f 0
1685.save   ar.pfs,GR_SAVE_PFS
1686        mov  GR_SAVE_PFS = ar.pfs             // Save ar.pfs
1687}
1688{ .mfi
1689.fframe 64
1690        add sp = -64,sp                       // Create new stack
1691        nop.f 0
1692        mov GR_SAVE_GP = gp                   // Save gp
1693};;
1694
1695{ .mmi
1696        stfd [GR_Parameter_Y] = FR_Y,16       // STORE Parameter 2 on stack
1697        add GR_Parameter_X = 16,sp            // Parameter 1 address
1698.save   b0, GR_SAVE_B0
1699        mov GR_SAVE_B0 = b0                   // Save b0
1700};;
1701
1702.body
1703{ .mib
1704        stfd [GR_Parameter_X] = FR_X          // STORE Parameter 1 on stack
1705        add   GR_Parameter_RESULT = 0,GR_Parameter_Y // Parameter 3 address
1706        nop.b 0
1707}
1708{ .mib
1709        stfd [GR_Parameter_Y] = FR_RESULT     // STORE Parameter 3 on stack
1710        add   GR_Parameter_Y = -16,GR_Parameter_Y
1711        br.call.sptk b0=__libm_error_support# // Call error handling function
1712};;
1713
1714{ .mmi
1715        add   GR_Parameter_RESULT = 48,sp
1716        nop.m 0
1717        nop.i 0
1718};;
1719
1720{ .mmi
1721        ldfd  f8 = [GR_Parameter_RESULT]      // Get return result off stack
1722.restore sp
1723        add   sp = 64,sp                      // Restore stack pointer
1724        mov   b0 = GR_SAVE_B0                 // Restore return address
1725};;
1726
1727{ .mib
1728        mov   gp = GR_SAVE_GP                 // Restore gp
1729        mov   ar.pfs = GR_SAVE_PFS            // Restore ar.pfs
1730        br.ret.sptk     b0                    // Return
1731};;
1732LOCAL_LIBM_END(__libm_error_region)
1733
1734.type   __libm_error_support#,@function
1735.global __libm_error_support#
1736