Updated to fedora-glibc-20050106T1443
[glibc.git] / sysdeps / ia64 / fpu / e_expf.S
blob8d620b6ffa7c41adccde7ba4ef105cab323b9dc4
1 .file "expf.s"
4 // Copyright (c) 2000 - 2002, 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:
13 // * Redistributions of source code must retain the above copyright
14 // notice, this list of conditions and the following disclaimer.
16 // * Redistributions in binary form must reproduce the above copyright
17 // notice, this list of conditions and the following disclaimer in the
18 // documentation and/or other materials provided with the distribution.
20 // * The name of Intel Corporation may not be used to endorse or promote
21 // products derived from this software without specific prior written
22 // permission.
24 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
28 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
32 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
33 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 // Intel Corporation is the author of this code, and requests that all
37 // problem reports or change requests be submitted to it directly at
38 // http://www.intel.com/software/products/opensource/libraries/num.htm.
40 // History
41 //*********************************************************************
42 // 02/02/00 Original version
43 // 04/04/00 Unwind support added
44 // 08/15/00 Bundle added after call to __libm_error_support to properly
45 //          set [the previously overwritten] GR_Parameter_RESULT.
46 // 08/21/00 Improvements to save 2 cycles on main path, and shorten x=0 case
47 // 12/07/00 Widen main path, shorten x=inf, nan paths
48 // 03/15/01 Fix monotonicity problem around x=0 for round to +inf
49 // 02/05/02 Corrected uninitialize predicate in POSSIBLE_UNDERFLOW path
50 // 05/20/02 Cleaned up namespace and sf0 syntax
51 // 07/26/02 Algorithm changed, accuracy improved
52 // 09/26/02 support of higher precision inputs added, underflow threshold
53 //          corrected
54 // 11/15/02 Improved performance on Itanium 2, added possible over/under paths
57 // API
58 //*********************************************************************
59 // float expf(float)
61 // Overview of operation
62 //*********************************************************************
63 // Take the input x. w is "how many log2/128 in x?"
64 //  w = x * 64/log2
65 //  NJ = int(w)
66 //  x = NJ*log2/64 + R
68 //  NJ = 64*n + j
69 //  x = n*log2 + (log2/64)*j + R
71 //  So, exp(x) = 2^n * 2^(j/64)* exp(R)
73 //  T =  2^n * 2^(j/64)
74 //       Construct 2^n
75 //       Get 2^(j/64) table
76 //           actually all the entries of 2^(j/64) table are stored in DP and
77 //           with exponent bits set to 0 -> multiplication on 2^n can be
78 //           performed by doing logical "or" operation with bits presenting 2^n
80 //  exp(R) = 1 + (exp(R) - 1)
81 //  P = exp(R) - 1 approximated by Taylor series of 3rd degree
82 //      P = A3*R^3 + A2*R^2 + R, A3 = 1/6, A2 = 1/2
85 //  The final result is reconstructed as follows
86 //  exp(x) = T + T*P
88 // Special values
89 //*********************************************************************
90 // expf(+0)    = 1.0
91 // expf(-0)    = 1.0
93 // expf(+qnan) = +qnan
94 // expf(-qnan) = -qnan
95 // expf(+snan) = +qnan
96 // expf(-snan) = -qnan
98 // expf(-inf)  = +0
99 // expf(+inf)  = +inf
101 // Overflow and Underflow
102 //*********************************************************************
103 // expf(x) = largest single normal when
104 //     x = 88.72283 = 0x42b17217
106 // expf(x) = smallest single normal when
107 //     x = -87.33654 = 0xc2aeac4f
109 // expf(x) = largest round-to-nearest single zero when
110 //     x = -103.97208 = 0xc2cff1b5
113 // Registers used
114 //*********************************************************************
115 // Floating Point registers used:
116 // f8, input
117 // f6,f7, f9 -> f15,  f32 -> f40
119 // General registers used:
120 // r3, r23 -> r38
122 // Predicate registers used:
123 // p10 -> p15
125 // Assembly macros
126 //*********************************************************************
127 // integer registers used
128 // scratch
129 rNJ                   = r3
131 rTmp                  = r23
132 rJ                    = r23
133 rN                    = r24
134 rTblAddr              = r25
135 rA3                   = r26
136 rExpHalf              = r27
137 rLn2Div64             = r28
138 r17ones_m1            = r29
139 rGt_ln                = r29
140 rRightShifter         = r30
141 r64DivLn2             = r31
142 // stacked
143 GR_SAVE_PFS           = r32
144 GR_SAVE_B0            = r33
145 GR_SAVE_GP            = r34
146 GR_Parameter_X        = r35
147 GR_Parameter_Y        = r36
148 GR_Parameter_RESULT   = r37
149 GR_Parameter_TAG      = r38
151 // floating point registers used
152 FR_X                  = f10
153 FR_Y                  = f1
154 FR_RESULT             = f8
155 // scratch
156 fRightShifter         = f6
157 f64DivLn2             = f7
158 fNormX                = f9
159 fNint                 = f10
160 fN                    = f11
161 fR                    = f12
162 fLn2Div64             = f13
163 fA2                   = f14
164 fA3                   = f15
165 // stacked
166 fP                    = f32
167 fT                    = f33
168 fMIN_SGL_OFLOW_ARG    = f34
169 fMAX_SGL_ZERO_ARG     = f35
170 fMAX_SGL_NORM_ARG     = f36
171 fMIN_SGL_NORM_ARG     = f37
172 fRSqr                 = f38
173 fTmp                  = f39
174 fGt_pln               = f39
175 fWre_urm_f8           = f40
176 fFtz_urm_f8           = f40
179 RODATA
180 .align 16
182 LOCAL_OBJECT_START(_expf_table)
183 data4 0x42b17218         // Smallest sgl arg to overflow sgl result, +88.7228
184 data4 0xc2cff1b5         // Largest sgl for rnd-to-nearest 0 result, -103.9720
185 data4 0x42b17217         // Largest sgl arg to give normal sgl result, +88.7228
186 data4 0xc2aeac4f         // Smallest sgl arg to give normal sgl result, -87.3365
188 // 2^(j/64) table, j goes from 0 to 63
189 data8 0x0000000000000000 // 2^(0/64)
190 data8 0x00002C9A3E778061 // 2^(1/64)
191 data8 0x000059B0D3158574 // 2^(2/64)
192 data8 0x0000874518759BC8 // 2^(3/64)
193 data8 0x0000B5586CF9890F // 2^(4/64)
194 data8 0x0000E3EC32D3D1A2 // 2^(5/64)
195 data8 0x00011301D0125B51 // 2^(6/64)
196 data8 0x0001429AAEA92DE0 // 2^(7/64)
197 data8 0x000172B83C7D517B // 2^(8/64)
198 data8 0x0001A35BEB6FCB75 // 2^(9/64)
199 data8 0x0001D4873168B9AA // 2^(10/64)
200 data8 0x0002063B88628CD6 // 2^(11/64)
201 data8 0x0002387A6E756238 // 2^(12/64)
202 data8 0x00026B4565E27CDD // 2^(13/64)
203 data8 0x00029E9DF51FDEE1 // 2^(14/64)
204 data8 0x0002D285A6E4030B // 2^(15/64)
205 data8 0x000306FE0A31B715 // 2^(16/64)
206 data8 0x00033C08B26416FF // 2^(17/64)
207 data8 0x000371A7373AA9CB // 2^(18/64)
208 data8 0x0003A7DB34E59FF7 // 2^(19/64)
209 data8 0x0003DEA64C123422 // 2^(20/64)
210 data8 0x0004160A21F72E2A // 2^(21/64)
211 data8 0x00044E086061892D // 2^(22/64)
212 data8 0x000486A2B5C13CD0 // 2^(23/64)
213 data8 0x0004BFDAD5362A27 // 2^(24/64)
214 data8 0x0004F9B2769D2CA7 // 2^(25/64)
215 data8 0x0005342B569D4F82 // 2^(26/64)
216 data8 0x00056F4736B527DA // 2^(27/64)
217 data8 0x0005AB07DD485429 // 2^(28/64)
218 data8 0x0005E76F15AD2148 // 2^(29/64)
219 data8 0x0006247EB03A5585 // 2^(30/64)
220 data8 0x0006623882552225 // 2^(31/64)
221 data8 0x0006A09E667F3BCD // 2^(32/64)
222 data8 0x0006DFB23C651A2F // 2^(33/64)
223 data8 0x00071F75E8EC5F74 // 2^(34/64)
224 data8 0x00075FEB564267C9 // 2^(35/64)
225 data8 0x0007A11473EB0187 // 2^(36/64)
226 data8 0x0007E2F336CF4E62 // 2^(37/64)
227 data8 0x00082589994CCE13 // 2^(38/64)
228 data8 0x000868D99B4492ED // 2^(39/64)
229 data8 0x0008ACE5422AA0DB // 2^(40/64)
230 data8 0x0008F1AE99157736 // 2^(41/64)
231 data8 0x00093737B0CDC5E5 // 2^(42/64)
232 data8 0x00097D829FDE4E50 // 2^(43/64)
233 data8 0x0009C49182A3F090 // 2^(44/64)
234 data8 0x000A0C667B5DE565 // 2^(45/64)
235 data8 0x000A5503B23E255D // 2^(46/64)
236 data8 0x000A9E6B5579FDBF // 2^(47/64)
237 data8 0x000AE89F995AD3AD // 2^(48/64)
238 data8 0x000B33A2B84F15FB // 2^(49/64)
239 data8 0x000B7F76F2FB5E47 // 2^(50/64)
240 data8 0x000BCC1E904BC1D2 // 2^(51/64)
241 data8 0x000C199BDD85529C // 2^(52/64)
242 data8 0x000C67F12E57D14B // 2^(53/64)
243 data8 0x000CB720DCEF9069 // 2^(54/64)
244 data8 0x000D072D4A07897C // 2^(55/64)
245 data8 0x000D5818DCFBA487 // 2^(56/64)
246 data8 0x000DA9E603DB3285 // 2^(57/64)
247 data8 0x000DFC97337B9B5F // 2^(58/64)
248 data8 0x000E502EE78B3FF6 // 2^(59/64)
249 data8 0x000EA4AFA2A490DA // 2^(60/64)
250 data8 0x000EFA1BEE615A27 // 2^(61/64)
251 data8 0x000F50765B6E4540 // 2^(62/64)
252 data8 0x000FA7C1819E90D8 // 2^(63/64)
253 LOCAL_OBJECT_END(_expf_table)
256 .section .text
257 GLOBAL_IEEE754_ENTRY(expf)
258       
259 { .mlx
260       addl            rTblAddr = @ltoff(_expf_table),gp
261       movl            r64DivLn2 = 0x40571547652B82FE // 64/ln(2)
263 { .mlx
264       addl            rA3 = 0x3E2AA, r0 // high bits of 1.0/6.0 rounded to SP
265       movl            rRightShifter = 0x43E8000000000000 // DP Right Shifter
269 { .mfi
270       // point to the beginning of the table
271       ld8             rTblAddr = [rTblAddr]
272       fclass.m        p14, p0 = f8, 0x22    // test for -INF
273       shl             rA3 = rA3, 12  // 0x3E2AA000, approx to 1.0/6.0 in SP
275 { .mfi
276       nop.m           0
277       fnorm.s1        fNormX = f8           // normalized x
278       addl            rExpHalf = 0xFFFE, r0 // exponent of 1/2
282 { .mfi
283       setf.d          f64DivLn2 = r64DivLn2 // load 64/ln(2) to FP reg
284       fclass.m        p15, p0 = f8, 0x1e1   // test for NaT,NaN,+Inf
285       nop.i           0
287 { .mlx
288       // load Right Shifter to FP reg
289       setf.d          fRightShifter = rRightShifter
290       movl            rLn2Div64 = 0x3F862E42FEFA39EF // DP ln(2)/64 in GR
294 { .mfi
295       nop.m           0
296       fcmp.eq.s1      p13, p0 = f0, f8      // test for x = 0.0
297       nop.i           0
299 { .mfb
300       setf.s          fA3 = rA3             // load A3 to FP reg
301 (p14) fma.s.s0        f8 = f0, f1, f0       // result if x = -inf
302 (p14) br.ret.spnt     b0                    // exit here if x = -inf
306 { .mfi
307       setf.exp        fA2 = rExpHalf        // load A2 to FP reg
308       fcmp.eq.s0      p6, p0 = f8, f0       // Dummy to flag denorm
309       nop.i           0
311 { .mfb
312       setf.d          fLn2Div64 = rLn2Div64 // load ln(2)/64 to FP reg
313 (p15) fma.s.s0        f8 = f8, f1, f0       // result if x = NaT,NaN,+Inf
314 (p15) br.ret.spnt     b0                    // exit here if x = NaT,NaN,+Inf
318 { .mfb
319       // overflow and underflow_zero threshold
320       ldfps           fMIN_SGL_OFLOW_ARG, fMAX_SGL_ZERO_ARG = [rTblAddr], 8
321 (p13) fma.s.s0        f8 = f1, f1, f0       // result if x = 0.0
322 (p13) br.ret.spnt     b0                    // exit here if x =0.0
326       // max normal and underflow_denorm threshold
327 { .mfi
328       ldfps           fMAX_SGL_NORM_ARG, fMIN_SGL_NORM_ARG = [rTblAddr], 8
329       nop.f           0
330       nop.i           0
334 { .mfi
335       nop.m           0
336       // x*(64/ln(2)) + Right Shifter
337       fma.s1          fNint = fNormX, f64DivLn2, fRightShifter
338       nop.i           0
342 // Divide arguments into the following categories:
343 //  Certain Underflow       p11 - -inf < x <= MAX_SGL_ZERO_ARG
344 //  Possible Underflow      p13 - MAX_SGL_ZERO_ARG < x < MIN_SGL_NORM_ARG
345 //  Certain Safe                - MIN_SGL_NORM_ARG <= x <= MAX_SGL_NORM_ARG
346 //  Possible Overflow       p14 - MAX_SGL_NORM_ARG < x < MIN_SGL_OFLOW_ARG
347 //  Certain Overflow        p15 - MIN_SGL_OFLOW_ARG <= x < +inf
349 // If the input is really a single arg, then there will never be
350 // "Possible Overflow" arguments.
353 { .mfi
354       nop.m           0
355       // check for overflow
356       fcmp.ge.s1      p15, p0 = fNormX, fMIN_SGL_OFLOW_ARG
357       nop.i           0
361 { .mfi
362       nop.m           0
363       // check for underflow and tiny (+0) result
364       fcmp.le.s1      p11, p0 = fNormX, fMAX_SGL_ZERO_ARG
365       nop.i           0
367 { .mfb
368       nop.m           0
369       fms.s1          fN = fNint, f1, fRightShifter // n in FP register
370       // branch out if overflow
371 (p15) br.cond.spnt    EXP_CERTAIN_OVERFLOW
375 { .mfb
376       getf.sig        rNJ = fNint           // bits of n, j
377       // check for underflow and deno result
378       fcmp.lt.s1      p13, p0 = fNormX, fMIN_SGL_NORM_ARG
379       // branch out if underflow and tiny (+0) result
380 (p11) br.cond.spnt    EXP_CERTAIN_UNDERFLOW
384 { .mfi
385       nop.m           0
386       // check for possible overflow
387       fcmp.gt.s1      p14, p0 = fNormX, fMAX_SGL_NORM_ARG
388       extr.u          rJ = rNJ, 0, 6        // bits of j
390 { .mfi
391       addl            rN = 0xFFFF - 63, rNJ // biased and shifted n
392       fnma.s1         fR = fLn2Div64, fN, fNormX // R = x - N*ln(2)/64
393       nop.i           0
397 { .mfi
398       shladd          rJ = rJ, 3, rTblAddr  // address in the 2^(j/64) table
399       nop.f           0
400       shr             rN = rN, 6            // biased n
404 { .mfi
405       ld8             rJ = [rJ]
406       nop.f           0
407       shl             rN = rN, 52           // 2^n bits in DP format
411 { .mfi
412       or              rN = rN, rJ // bits of 2^n * 2^(j/64) in DP format
413       nop.f           0
414       nop.i           0
418 { .mfi
419       setf.d          fT = rN               // 2^n * 2^(j/64)
420       fma.s1          fP = fA3, fR, fA2     // A3*R + A2
421       nop.i           0
423 { .mfi
424       nop.m           0
425       fma.s1          fRSqr = fR, fR, f0    // R^2
426       nop.i           0
430 { .mfi
431       nop.m           0
432       fma.s1          fP = fP, fRSqr, fR    // P = (A3*R + A2)*R^2 + R
433       nop.i           0
437 { .mbb
438       nop.m           0
439       // branch out if possible underflow
440 (p13) br.cond.spnt    EXP_POSSIBLE_UNDERFLOW
441       // branch out if possible overflow result
442 (p14) br.cond.spnt    EXP_POSSIBLE_OVERFLOW
446 { .mfb
447       nop.m           0
448       // final result in the absence of over- and underflow
449       fma.s.s0        f8 = fP, fT, fT
450       // exit here in the absence of over- and underflow
451       br.ret.sptk     b0
455 EXP_POSSIBLE_OVERFLOW:
457 // Here if fMAX_SGL_NORM_ARG < x < fMIN_SGL_OFLOW_ARG
458 // This cannot happen if input is a single, only if input higher precision.
459 // Overflow is a possibility, not a certainty.
461 // Recompute result using status field 2 with user's rounding mode,
462 // and wre set.  If result is larger than largest single, then we have
463 // overflow
465 { .mfi
466       mov             rGt_ln  = 0x1007f // Exponent for largest single + 1 ulp
467       fsetc.s2        0x7F,0x42         // Get user's round mode, set wre
468       nop.i           0
472 { .mfi
473       setf.exp        fGt_pln = rGt_ln  // Create largest single + 1 ulp
474       fma.s.s2        fWre_urm_f8 = fP, fT, fT    // Result with wre set
475       nop.i           0
479 { .mfi
480       nop.m           0
481       fsetc.s2        0x7F,0x40                   // Turn off wre in sf2
482       nop.i           0
486 { .mfi
487       nop.m           0
488       fcmp.ge.s1      p6, p0 =  fWre_urm_f8, fGt_pln // Test for overflow
489       nop.i           0
493 { .mfb
494       nop.m           0
495       nop.f           0
496 (p6)  br.cond.spnt    EXP_CERTAIN_OVERFLOW // Branch if overflow
500 { .mfb
501       nop.m           0
502       fma.s.s0        f8 = fP, fT, fT
503       br.ret.sptk     b0                     // Exit if really no overflow
507 // here if overflow
508 EXP_CERTAIN_OVERFLOW:
509 { .mmi
510       addl            r17ones_m1 = 0x1FFFE, r0
512       setf.exp        fTmp = r17ones_m1
513       nop.i           0
517 { .mfi
518       alloc           r32=ar.pfs,0,3,4,0
519       fmerge.s        FR_X = f8,f8
520       nop.i           0
522 { .mfb
523       mov             GR_Parameter_TAG = 16
524       fma.s.s0        FR_RESULT = fTmp, fTmp, f0 // Set I,O and +INF result
525       br.cond.sptk    __libm_error_region
529 EXP_POSSIBLE_UNDERFLOW:
531 // Here if fMAX_SGL_ZERO_ARG < x < fMIN_SGL_NORM_ARG
532 // Underflow is a possibility, not a certainty
534 // We define an underflow when the answer with
535 //    ftz set
536 // is zero (tiny numbers become zero)
538 // Notice (from below) that if we have an unlimited exponent range,
539 // then there is an extra machine number E between the largest denormal and
540 // the smallest normal.
542 // So if with unbounded exponent we round to E or below, then we are
543 // tiny and underflow has occurred.
545 // But notice that you can be in a situation where we are tiny, namely
546 // rounded to E, but when the exponent is bounded we round to smallest
547 // normal. So the answer can be the smallest normal with underflow.
549 //                           E
550 // -----+--------------------+--------------------+-----
551 //      |                    |                    |
552 //   1.1...10 2^-3fff    1.1...11 2^-3fff    1.0...00 2^-3ffe
553 //   0.1...11 2^-3ffe                                   (biased, 1)
554 //    largest dn                               smallest normal
556 { .mfi
557       nop.m           0
558       fsetc.s2        0x7F,0x41                // Get user's round mode, set ftz
559       nop.i           0
563 { .mfi
564       nop.m           0
565       fma.s.s2        fFtz_urm_f8 = fP, fT, fT // Result with ftz set
566       nop.i           0
570 { .mfi
571       nop.m           0
572       fsetc.s2        0x7F,0x40                // Turn off ftz in sf2
573       nop.i           0
577 { .mfi
578       nop.m           0
579       fcmp.eq.s1      p6, p7 = fFtz_urm_f8, f0 // Test for underflow
580       nop.i           0
582 { .mfi
583       nop.m           0
584       fma.s.s0        f8 = fP, fT, fT          // Compute result, set I, maybe U
585       nop.i           0
589 { .mbb
590       nop.m           0
591 (p6)  br.cond.spnt    EXP_UNDERFLOW_COMMON     // Branch if really underflow
592 (p7)  br.ret.sptk     b0                       // Exit if really no underflow
596 EXP_CERTAIN_UNDERFLOW:
597 // Here if  x < fMAX_SGL_ZERO_ARG
598 // Result will be zero (or smallest denorm if round to +inf) with I, U set
599 { .mmi
600       mov             rTmp = 1
602       setf.exp        fTmp = rTmp               // Form small normal
603       nop.i           0
607 { .mfb
608       nop.m           0
609       fma.s.s0        f8 = fTmp, fTmp, f0 // Set I,U, tiny (+0.0) result
610       br.cond.sptk    EXP_UNDERFLOW_COMMON
614 EXP_UNDERFLOW_COMMON:
615 // Determine if underflow result is zero or nonzero
616 { .mfi
617       alloc           r32=ar.pfs,0,3,4,0
618       fcmp.eq.s1      p6, p0 =  f8, f0
619       nop.i           0
623 { .mfb
624       nop.m           0
625       fmerge.s        FR_X = fNormX,fNormX
626 (p6)  br.cond.spnt    EXP_UNDERFLOW_ZERO
630 EXP_UNDERFLOW_NONZERO:
631 // Here if  x < fMIN_SGL_NORM_ARG and result nonzero;
632 // I, U are set
633 { .mfb
634       mov             GR_Parameter_TAG = 17
635       nop.f           0                         // FR_RESULT already set
636       br.cond.sptk    __libm_error_region
640 EXP_UNDERFLOW_ZERO:
641 // Here if x < fMIN_SGL_NORM_ARG and result zero;
642 // I, U are set
643 { .mfb
644       mov             GR_Parameter_TAG = 17
645       nop.f           0                         // FR_RESULT already set
646       br.cond.sptk    __libm_error_region
650 GLOBAL_IEEE754_END(expf)
652 LOCAL_LIBM_ENTRY(__libm_error_region)
653 .prologue
654 { .mfi
655       add   GR_Parameter_Y=-32,sp             // Parameter 2 value
656       nop.f 0
657 .save   ar.pfs,GR_SAVE_PFS
658       mov  GR_SAVE_PFS=ar.pfs                 // Save ar.pfs
660 { .mfi
661 .fframe 64
662       add sp=-64,sp                           // Create new stack
663       nop.f 0
664       mov GR_SAVE_GP=gp                       // Save gp
666 { .mmi
667       stfs [GR_Parameter_Y] = FR_Y,16         // Store Parameter 2 on stack
668       add GR_Parameter_X = 16,sp              // Parameter 1 address
669 .save   b0, GR_SAVE_B0
670       mov GR_SAVE_B0=b0                       // Save b0
672 .body
673 { .mfi
674       stfs [GR_Parameter_X] = FR_X            // Store Parameter 1 on stack
675       nop.f 0
676       add   GR_Parameter_RESULT = 0,GR_Parameter_Y // Parameter 3 address
678 { .mib
679       stfs [GR_Parameter_Y] = FR_RESULT       // Store Parameter 3 on stack
680       add   GR_Parameter_Y = -16,GR_Parameter_Y
681       br.call.sptk b0=__libm_error_support#   // Call error handling function
684 { .mmi
685       add   GR_Parameter_RESULT = 48,sp
686       nop.m 0
687       nop.i 0
690 { .mmi
691       ldfs  f8 = [GR_Parameter_RESULT]       // Get return result off stack
692 .restore sp
693       add   sp = 64,sp                       // Restore stack pointer
694       mov   b0 = GR_SAVE_B0                  // Restore return address
696 { .mib
697       mov   gp = GR_SAVE_GP                  // Restore gp
698       mov   ar.pfs = GR_SAVE_PFS             // Restore ar.pfs
699       br.ret.sptk     b0                     // Return
702 LOCAL_LIBM_END(__libm_error_region)
705 .type   __libm_error_support#,@function
706 .global __libm_error_support#