~ubuntu-branches/ubuntu/utopic/eglibc/utopic

« back to all changes in this revision

Viewing changes to sysdeps/ia64/fpu/e_remainderl.S

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2012-10-26 05:14:58 UTC
  • mfrom: (1.5.1) (4.4.22 experimental)
  • Revision ID: package-import@ubuntu.com-20121026051458-oryotr4i03ob5pab
Tags: 2.16-0ubuntu1
* Merge with unreleased 2.16 in Debian experimental, remaining changes:
  - Drop the Breaks line from libc6, which refers to a Debian transition
  - Remove the libc6 recommends on libc6-i686, which we don't build
  - Enable libc6{,-dev}-armel on armhf and libc6{-dev}-armhf on armel
  - Ship update-locale and validlocale in /usr/sbin in libc-bin
  - Don't build locales or locales-all in Ubuntu, we rely on langpacks
  - Heavily mangle the way we do service restarting on major upgrades
  - Use different MIN_KERNEL_SUPPORTED versions than Debian, due to
    buildd needs.  This should be universally bumped to 3.2.0 once all
    our buildds (including the PPA guests) are running precise kernels
  - Build i386 variants as -march=i686, build amd64 with -O3, and build
    ppc64 variants (both 64-bit and 32-bit) with -O3 -fno-tree-vectorize
  - Re-enable unsubmitted-ldconfig-cache-abi.diff and rebuild the cache
    on upgrades from previous versions that used a different constant
  - debian/patches/any/local-CVE-2012-3406.diff: switch to malloc when
    array grows too large to handle via alloca extension (CVE-2012-3406)
  - Build generic i386/i686 flavour with -mno-tls-direct-seg-refs
* Changes added/dropped with this merge while reducing our delta:
  - Stop building glibc docs from the eglibc source, and instead make
    the glibc-docs stub have a hard dependency on glibc-doc-reference
  - Remove outdated conflicts against ancient versions of ia32-libs
  - Drop the tzdata dependency from libc6, it's in required and minimal
  - Use gcc-4.7/g++-4.7 by default on all our supported architectures
  - Save our historical changelog as changelog.ubuntu in the source
  - Drop nscd's libaudit build-dep for now, as libaudit is in universe
  - Drop the unnecessary Breaks from libc6 to locales and locales-all
  - Ship xen's ld.so.conf.d snippet as /etc/ld.so.conf.d/libc6-xen.conf
* Disable hard failures on the test suite for the first upload to raring

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.file "remainderl.s"
2
 
 
3
 
 
4
 
// Copyright (c) 2000 - 2003, 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
 
// 03/02/00 New algorithm 
44
 
// 04/04/00 Unwind support added
45
 
// 07/21/00 Fixed quotient=2^{24*m+23}*1.q1...q23 1 bug
46
 
// 08/15/00 Bundle added after call to __libm_error_support to properly
47
 
//          set [the previously overwritten] GR_Parameter_RESULT.
48
 
// 11/29/00 Set FR_Y to f9
49
 
// 05/20/02 Cleaned up namespace and sf0 syntax
50
 
// 02/10/03 Reordered header: .section, .global, .proc, .align
51
 
//
52
 
// API
53
 
//====================================================================
54
 
// long double remainderl(long double,long double);   
55
 
//
56
 
// Overview of operation
57
 
//====================================================================
58
 
//  remainder(a,b)=a-i*b,
59
 
//  where i is an integer such that, if b!=0 and a is finite, 
60
 
//  |a/b-i|<=1/2. If |a/b-i|=1/2, i is even.
61
 
//
62
 
// Algorithm
63
 
//====================================================================
64
 
// a). eliminate special cases
65
 
// b). if |a/b|<0.25 (first quotient estimate), return a
66
 
// c). use single precision divide algorithm to get quotient q
67
 
//     rounded to 24 bits of precision 
68
 
// d). calculate partial remainders (using both q and q-ulp); 
69
 
//     select one and RZ(a/b) based on the sign of |a|-|b|*q   
70
 
// e). if the exponent difference (exponent(a)-exponent(b))
71
 
//     is less than 24 (quotient estimate<2^{24}-2), use RZ(a/b) 
72
 
//     and sticky bits to round to integer; exit loop and
73
 
//     calculate final remainder
74
 
// f). if exponent(a)-exponent(b)>=24, select new value of a as
75
 
//     the partial remainder calculated using RZ(a/b); 
76
 
//     repeat from c). 
77
 
//
78
 
// Special cases
79
 
//====================================================================
80
 
// a=+/- Inf, or b=+/-0: return NaN, call libm_error_support
81
 
// a=NaN or b=NaN: return NaN
82
 
//
83
 
// Registers used
84
 
//====================================================================
85
 
// Predicate registers: p6-p14
86
 
// General registers:   r2,r3,r28,r29,r32 (ar.pfs), r33-r39
87
 
// Floating point registers: f6-f15,f32
88
 
//
89
 
 
90
 
GR_SAVE_B0                    = r33
91
 
GR_SAVE_PFS                   = r34
92
 
GR_SAVE_GP                    = r35 
93
 
GR_SAVE_SP                    = r36
94
 
 
95
 
GR_Parameter_X                = r37
96
 
GR_Parameter_Y                = r38
97
 
GR_Parameter_RESULT           = r39
98
 
GR_Parameter_TAG              = r40
99
 
 
100
 
FR_X             = f10
101
 
FR_Y             = f9
102
 
FR_RESULT        = f8
103
 
 
104
 
 
105
 
.section .text
106
 
GLOBAL_IEEE754_ENTRY(remainderl)
107
 
 
108
 
// inputs in f8, f9
109
 
// result in f8
110
 
 
111
 
{ .mfi
112
 
  alloc r32=ar.pfs,1,4,4,0
113
 
  // f13=|a|
114
 
  fmerge.s f13=f0,f8
115
 
  nop.i 0
116
 
}
117
 
  {.mfi
118
 
  getf.sig r29=f9
119
 
  // f14=|b|
120
 
  fmerge.s f14=f0,f9
121
 
  nop.i 0;;
122
 
}
123
 
 {.mlx
124
 
  mov r28=0x2ffdd
125
 
  // r2=2^{23}
126
 
  movl r3=0x4b000000;;
127
 
}
128
 
 
129
 
 
130
 
{.mmi
131
 
setf.exp f32=r28
132
 
nop.m 0
133
 
// y pseudo-zero ?
134
 
cmp.eq p11,p10=r29,r0;;
135
 
}
136
 
 
137
 
// Y +-NAN, +-inf, +-0?     p11
138
 
{ .mfi
139
 
      nop.m 999
140
 
(p10)  fclass.m  p11,p10 = f9, 0xe7           
141
 
      nop.i 999
142
 
}
143
 
// qnan snan inf norm     unorm 0 -+
144
 
// 1    1    1   0        0     0 11
145
 
// e                      3
146
 
// X +-NAN, +-inf, ?        p9
147
 
{ .mfi
148
 
      nop.m 999
149
 
      fclass.m.unc  p9,p8 = f8, 0xe3           
150
 
      nop.i 999;; 
151
 
}
152
 
 
153
 
{.mfi
154
 
  nop.m 0
155
 
  mov f12=f0
156
 
  nop.i 0
157
 
}
158
 
{ .mfi
159
 
  // set p7=1
160
 
  cmp.eq.unc p7,p0=r0,r0
161
 
  // Step (1)
162
 
  // y0 = 1 / b in f10
163
 
  frcpa.s1 f10,p6=f13,f14
164
 
  nop.i 0;;
165
 
166
 
// Y +-NAN, +-inf, +-0?     p11
167
 
{ .mfi
168
 
      nop.m 999
169
 
          // pseudo-NaN ?
170
 
(p10)  fclass.nm  p11,p0 = f9, 0xff           
171
 
      nop.i 999
172
 
}
173
 
 
174
 
// qnan snan inf norm     unorm 0 -+
175
 
// 1    1    1   0        0     0 11
176
 
// e                      3
177
 
// X +-NAN, +-inf, ?        p9
178
 
 
179
 
{ .mfi
180
 
      nop.m 999
181
 
(p8)  fclass.nm  p9,p0 = f8, 0xff          
182
 
      nop.i 999;;
183
 
}
184
 
 
185
 
{.bbb
186
 
  (p9) br.cond.spnt FREM_X_NAN_INF
187
 
  (p11) br.cond.spnt FREM_Y_NAN_INF_ZERO
188
 
  nop.b 0
189
 
}  {.mfi
190
 
   nop.m 0
191
 
   // set D flag if a (f8) is denormal
192
 
   fnma.s0 f6=f8,f1,f8
193
 
   nop.i 0;;
194
 
195
 
 
196
 
remloop24: 
197
 
  { .mfi
198
 
  nop.m 0
199
 
  // Step (2)
200
 
  // q0 = a * y0 in f15
201
 
  (p6) fma.s1 f12=f13,f10,f0
202
 
  nop.i 0
203
 
} { .mfi
204
 
  nop.m 0
205
 
  // Step (3)
206
 
  // e0 = 1 - b * y0 in f7
207
 
  (p6) fnma.s1 f7=f14,f10,f1
208
 
  nop.i 0;;
209
 
}  {.mlx
210
 
  nop.m 0
211
 
  // r2=1.25*2^{-24}
212
 
  movl r2=0x33a00000;;
213
 
214
 
 
215
 
{.mfi
216
 
  nop.m 0
217
 
  // q1=q0*(1+e0)
218
 
  (p6) fma.s1 f15=f12,f7,f12
219
 
  nop.i 0
220
 
}
221
 
{ .mfi
222
 
  nop.m 0
223
 
  // Step (4)
224
 
  // e1 = e0 * e0 + E in f7
225
 
  (p6) fma.s1 f7=f7,f7,f32
226
 
  nop.i 0;;
227
 
}
228
 
 {.mii
229
 
  (p7) getf.exp r29=f12
230
 
  (p7) mov r28=0xfffd
231
 
  nop.i 0;;
232
 
}
233
 
 
234
 
 { .mfi
235
 
  // f12=2^{23}
236
 
  setf.s f12=r3
237
 
  // Step (5)
238
 
  // q2 = q1 + e1 * q1 in f11
239
 
  (p6) fma.s.s1 f11=f7,f15,f15
240
 
  nop.i 0
241
 
} { .mfi
242
 
   nop.m 0
243
 
  // Step (6)
244
 
  // q2 = q1 + e1 * q1 in f6
245
 
  (p6) fma.s1 f6=f7,f15,f15
246
 
  nop.i 0;;
247
 
248
 
 
249
 
 {.mmi
250
 
  // f15=1.25*2^{-24}
251
 
  setf.s f15=r2
252
 
  // q<1/4 ? (i.e. expon< -2) 
253
 
  (p7) cmp.gt p7,p0=r28,r29
254
 
  nop.i 0;;
255
 
}
256
 
 
257
 
{.mfb
258
 
  // r29= -32+bias
259
 
  mov r29=0xffdf
260
 
 // if |a/b|<1/4, set D flag before returning 
261
 
 (p7) fma.s0 f9=f9,f0,f8
262
 
  nop.b 0;;
263
 
}
264
 
 {.mfb
265
 
 nop.m 0
266
 
 // can be combined with bundle above if sign of 0 or
267
 
 // FTZ enabled are not important
268
 
 (p7) fmerge.s f8=f8,f9
269
 
 // return if |a|<4*|b| (estimated quotient < 1/4)
270
 
 (p7) br.ret.spnt b0;;
271
 
}
272
 
  {.mfi
273
 
  // f7=2^{-32}
274
 
  setf.exp f7=r29
275
 
  // set f8 to current a value | sign
276
 
  fmerge.s f8=f8,f13
277
 
  nop.i 0;;
278
 
279
 
  {.mfi
280
 
  getf.exp r28=f6
281
 
  // last step ? (q<2^{23})
282
 
  fcmp.lt.unc.s1 p0,p12=f6,f12
283
 
  nop.i 0;;
284
 
}
285
 
  {.mfi
286
 
  nop.m 0
287
 
  // r=a-b*q
288
 
  fnma.s1 f6=f14,f11,f13
289
 
  nop.i 0
290
 
} {.mfi
291
 
  // r2=23+bias
292
 
  mov r2=0xffff+23
293
 
  // q'=q-q*(1.25*2^{-24})   (q'=q-ulp)
294
 
  fnma.s.s1 f15=f11,f15,f11
295
 
  nop.i 0;;
296
 
}
297
 
  {.mmi
298
 
  nop.m 0
299
 
  cmp.eq p11,p14=r2,r28
300
 
  nop.i 0;;
301
 
302
 
 
303
 
.pred.rel "mutex",p11,p14
304
 
  {.mfi
305
 
  nop.m 0
306
 
  // if exp_q=2^23, then r=a-b*2^{23}
307
 
  (p11) fnma.s1 f13=f12,f14,f13
308
 
  nop.i 0
309
 
310
 
{.mfi
311
 
  nop.m 0
312
 
  // r2=a-b*q'
313
 
  (p14) fnma.s1 f13=f14,f15,f13
314
 
  nop.i 0;;
315
 
}
316
 
  {.mfi
317
 
  nop.m 0
318
 
  // r>0 iff q=RZ(a/b) and inexact
319
 
  fcmp.gt.unc.s1 p8,p0=f6,f0
320
 
  nop.i 0
321
 
} {.mfi
322
 
  nop.m 0
323
 
  // r<0 iff q'=RZ(a/b) and inexact
324
 
  (p14) fcmp.lt.unc.s1 p9,p10=f6,f0
325
 
  nop.i 0;;
326
 
}
327
 
 
328
 
.pred.rel "mutex",p8,p9
329
 
  {.mfi
330
 
   nop.m 0 
331
 
  // (p8) Q=q+(last iteration ? sticky bits:0)
332
 
  // i.e. Q=q+q*x  (x=2^{-32} or 0)
333
 
  (p8) fma.s1 f11=f11,f7,f11
334
 
  nop.i 0
335
 
} {.mfi
336
 
  nop.m 0
337
 
  // (p9) Q=q'+(last iteration ? sticky bits:0)
338
 
  // i.e. Q=q'+q'*x  (x=2^{-32} or 0)
339
 
  (p9) fma.s1 f11=f15,f7,f15
340
 
  nop.i 0;;
341
 
}
342
 
 
343
 
  {.mfb
344
 
  nop.m 0
345
 
  //  (p9) set r=r2 (new a, if not last iteration)
346
 
  // (p10) new a =r
347
 
  (p10) mov f13=f6
348
 
  (p12) br.cond.sptk remloop24;;
349
 
350
 
 
351
 
// last iteration
352
 
  {.mfi
353
 
  nop.m 0
354
 
  // set f9=|b|*sgn(a)
355
 
  fmerge.s f9=f8,f9
356
 
  nop.i 0
357
 
}
358
 
  {.mfi
359
 
  nop.m 0
360
 
  // round to integer
361
 
  fcvt.fx.s1 f11=f11
362
 
  nop.i 0;;
363
 
}
364
 
  {.mfi
365
 
  nop.m 0
366
 
  // save sign of a
367
 
  fmerge.s f7=f8,f8
368
 
  nop.i 0
369
 
} {.mfi 
370
 
  nop.m 0
371
 
  // normalize
372
 
  fcvt.xf f11=f11
373
 
  nop.i 0;;
374
 
375
 
  {.mfi
376
 
  nop.m 0
377
 
  // This can be removed if sign of 0 is not important 
378
 
  // get remainder using sf1
379
 
  fnma.s1 f12=f9,f11,f8
380
 
  nop.i 0
381
 
}
382
 
  {.mfi
383
 
  nop.m 0
384
 
  // get remainder
385
 
  fnma.s0 f8=f9,f11,f8
386
 
  nop.i 0;;
387
 
}
388
 
  {.mfi
389
 
  nop.m 0
390
 
  // f12=0?
391
 
  // This can be removed if sign of 0 is not important 
392
 
  fcmp.eq.unc.s1 p8,p0=f12,f0
393
 
  nop.i 0;;
394
 
}
395
 
  {.mfb
396
 
  nop.m 0
397
 
  // if f8=0, set sign correctly
398
 
  // This can be removed if sign of 0 is not important 
399
 
  (p8) fmerge.s f8=f7,f8
400
 
  // return
401
 
  br.ret.sptk b0;;
402
 
}
403
 
 
404
 
 
405
 
 
406
 
FREM_X_NAN_INF: 
407
 
 
408
 
// Y zero ?
409
 
{.mfi 
410
 
  nop.m 0
411
 
  fma.s1 f10=f9,f1,f0
412
 
  nop.i 0;;
413
 
}
414
 
{.mfi
415
 
 nop.m 0
416
 
 fcmp.eq.unc.s1 p11,p0=f10,f0
417
 
 nop.i 0;;
418
 
}
419
 
{.mib
420
 
  nop.m 0
421
 
  nop.i 0
422
 
  // if Y zero
423
 
  (p11) br.cond.spnt FREM_Y_ZERO;;                        
424
 
}
425
 
 
426
 
// X infinity? Return QNAN indefinite
427
 
{ .mfi
428
 
      nop.m 999
429
 
      fclass.m.unc  p8,p0 = f8, 0x23 
430
 
      nop.i 999
431
 
}
432
 
// X infinity? Return QNAN indefinite
433
 
{ .mfi
434
 
      nop.m 999
435
 
      fclass.m.unc  p11,p0 = f8, 0x23 
436
 
      nop.i 999;; 
437
 
}
438
 
// Y NaN ?
439
 
{.mfi
440
 
         nop.m 999
441
 
(p8) fclass.m.unc p0,p8=f9,0xc3
442
 
         nop.i 0;;
443
 
}
444
 
{.mfi
445
 
        nop.m 999
446
 
        // also set Denormal flag if necessary
447
 
(p8) fnma.s0 f9=f9,f1,f9
448
 
    nop.i 0
449
 
450
 
{ .mfi
451
 
      nop.m 999
452
 
(p8)  frcpa.s0 f8,p7 = f8,f8           
453
 
      nop.i 999 ;;
454
 
}
455
 
 
456
 
{.mfi
457
 
      nop.m 999
458
 
(p11) mov f10=f8
459
 
          nop.i 0
460
 
}
461
 
{ .mfi
462
 
     nop.m 999
463
 
(p8) fma.s0 f8=f8,f1,f0                     
464
 
         nop.i 0 ;;                        
465
 
}
466
 
 
467
 
{ .mfb
468
 
      nop.m 999
469
 
      frcpa.s0 f8,p7=f8,f9                     
470
 
          (p11) br.cond.spnt EXP_ERROR_RETURN;;                        
471
 
}
472
 
{ .mib
473
 
        nop.m 0
474
 
        nop.i 0
475
 
        br.ret.spnt    b0 ;;                        
476
 
}
477
 
 
478
 
 
479
 
FREM_Y_NAN_INF_ZERO: 
480
 
// Y INF
481
 
{ .mfi
482
 
      nop.m 999
483
 
      fclass.m.unc  p7,p0 = f9, 0x23           
484
 
      nop.i 999 ;;
485
 
}
486
 
 
487
 
{ .mfb
488
 
      nop.m 999
489
 
(p7)  fma.s0 f8=f8,f1,f0                     
490
 
(p7)  br.ret.spnt    b0 ;;                        
491
 
}
492
 
 
493
 
// Y NAN?
494
 
{ .mfi
495
 
      nop.m 999
496
 
      fclass.m.unc  p9,p10 = f9, 0xc3           
497
 
      nop.i 999 ;;
498
 
}
499
 
{ .mfi
500
 
      nop.m 999
501
 
(p10)  fclass.nm  p9,p0 = f9, 0xff           
502
 
      nop.i 999 ;;
503
 
}
504
 
 
505
 
{ .mfb
506
 
      nop.m 999
507
 
(p9)  fma.s0 f8=f9,f1,f0                     
508
 
(p9)  br.ret.spnt    b0 ;;                        
509
 
}
510
 
 
511
 
FREM_Y_ZERO:
512
 
// Y zero? Must be zero at this point
513
 
// because it is the only choice left.
514
 
// Return QNAN indefinite
515
 
 
516
 
// X NAN?
517
 
{ .mfi
518
 
      nop.m 999
519
 
      fclass.m.unc  p9,p10 = f8, 0xc3           
520
 
      nop.i 999 ;;
521
 
}
522
 
{ .mfi
523
 
      nop.m 999
524
 
(p10)  fclass.nm  p9,p10 = f8, 0xff           
525
 
      nop.i 999 ;;
526
 
}
527
 
 
528
 
{.mfi
529
 
 nop.m 999
530
 
 (p9) frcpa.s0 f11,p7=f8,f0
531
 
 nop.i 0;;
532
 
}
533
 
{ .mfi
534
 
      nop.m 999
535
 
(p10)  frcpa.s0   f11,p7 = f0,f0           
536
 
          nop.i 999;;
537
 
}
538
 
 
539
 
{ .mfi
540
 
      nop.m 999
541
 
      fmerge.s      f10 = f8, f8             
542
 
      nop.i 999
543
 
}
544
 
 
545
 
{ .mfi
546
 
      nop.m 999
547
 
      fma.s0 f8=f11,f1,f0                     
548
 
      nop.i 999;;
549
 
}
550
 
 
551
 
EXP_ERROR_RETURN: 
552
 
 
553
 
{ .mib
554
 
      mov   GR_Parameter_TAG = 123                                 
555
 
          nop.i 999
556
 
      br.sptk __libm_error_region;; 
557
 
}
558
 
 
559
 
GLOBAL_IEEE754_END(remainderl)
560
 
 
561
 
LOCAL_LIBM_ENTRY(__libm_error_region)
562
 
.prologue
563
 
{ .mfi
564
 
        add   GR_Parameter_Y=-32,sp             // Parameter 2 value
565
 
        nop.f 0
566
 
.save   ar.pfs,GR_SAVE_PFS
567
 
        mov  GR_SAVE_PFS=ar.pfs                 // Save ar.pfs 
568
 
}
569
 
{ .mfi
570
 
.fframe 64 
571
 
        add sp=-64,sp                           // Create new stack
572
 
        nop.f 0
573
 
        mov GR_SAVE_GP=gp                       // Save gp
574
 
};;
575
 
{ .mmi
576
 
        stfe [GR_Parameter_Y] = FR_Y,16         // Save Parameter 2 on stack
577
 
        add GR_Parameter_X = 16,sp              // Parameter 1 address
578
 
.save   b0, GR_SAVE_B0                      
579
 
        mov GR_SAVE_B0=b0                       // Save b0 
580
 
};;
581
 
.body
582
 
{ .mib
583
 
        stfe [GR_Parameter_X] = FR_X            // Store Parameter 1 on stack 
584
 
        add   GR_Parameter_RESULT = 0,GR_Parameter_Y  
585
 
        nop.b 0                                 // Parameter 3 address
586
 
}
587
 
{ .mib
588
 
        stfe [GR_Parameter_Y] = FR_RESULT      // Store Parameter 3 on stack
589
 
        add   GR_Parameter_Y = -16,GR_Parameter_Y  
590
 
        br.call.sptk b0=__libm_error_support#  // Call error handling function
591
 
};;
592
 
{ .mmi
593
 
        nop.m 0
594
 
        nop.m 0
595
 
        add   GR_Parameter_RESULT = 48,sp
596
 
};;
597
 
{ .mmi
598
 
        ldfe  f8 = [GR_Parameter_RESULT]       // Get return result off stack
599
 
.restore sp
600
 
        add   sp = 64,sp                       // Restore stack pointer
601
 
        mov   b0 = GR_SAVE_B0                  // Restore return address
602
 
};;
603
 
{ .mib
604
 
        mov   gp = GR_SAVE_GP                  // Restore gp 
605
 
        mov   ar.pfs = GR_SAVE_PFS             // Restore ar.pfs
606
 
        br.ret.sptk     b0                     // Return
607
 
};; 
608
 
 
609
 
LOCAL_LIBM_END(__libm_error_region)
610
 
 
611
 
 
612
 
.type   __libm_error_support#,@function
613
 
.global __libm_error_support#
614
 
 
615
 
 
616
 
 
617