4 // Copyright (c) 2002 - 2005, Intel Corporation
5 // All rights reserved.
7 // Contributed 2002 by the Intel Numerics Group, Intel Corporation
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions are
13 // * Redistributions of source code must retain the above copyright
14 // notice, this list of conditions and the following disclaimer.
16 // * Redistributions in binary form must reproduce the above copyright
17 // notice, this list of conditions and the following disclaimer in the
18 // documentation and/or other materials provided with the distribution.
20 // * The name of Intel Corporation may not be used to endorse or promote
21 // products derived from this software without specific prior written
24 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS
28 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
32 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING
33 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 // Intel Corporation is the author of this code, and requests that all
37 // problem reports or change requests be submitted to it directly at
38 // http://www.intel.com/software/products/opensource/libraries/num.htm.
41 //==============================================================
42 // 02/01/02 Initial version
43 // 02/18/02 Large arguments processing routine is excluded.
44 // External interface entry points are added
45 // 03/13/02 Corrected restore of predicate registers
46 // 03/19/02 Added stack unwind around call to __libm_cis_large
47 // 09/05/02 Work range is widened by reduction strengthen (3 parts of Pi/16)
48 // 02/10/03 Reordered header: .section, .global, .proc, .align
49 // 08/08/03 Improved performance
50 // 02/11/04 cis is moved to the separate file.
51 // 03/31/05 Reformatted delimiters between data tables
54 //==============================================================
55 // 1) void sincos(double, double*s, double*c)
56 // 2) __libm_sincos - internal LIBM function, that accepts
57 // argument in f8 and returns cosine through f8, sine through f9
59 // Overview of operation
60 //==============================================================
64 // Reduce x to region -1/2*pi/2^k ===== 0 ===== +1/2*pi/2^k where k=4
65 // divide x by pi/2^k.
66 // Multiply by 2^k/pi.
67 // nfloat = Round result to integer (round-to-nearest)
69 // r = x - nfloat * pi/2^k
70 // Do this as ((((x - nfloat * HIGH(pi/2^k))) -
71 // nfloat * LOW(pi/2^k)) -
72 // nfloat * LOWEST(pi/2^k) for increased accuracy.
73 // pi/2^k is stored as two numbers that when added make pi/2^k.
74 // pi/2^k = HIGH(pi/2^k) + LOW(pi/2^k)
75 // HIGH and LOW parts are rounded to zero values,
76 // and LOWEST is rounded to nearest one.
78 // x = (nfloat * pi/2^k) + r
79 // r is small enough that we can use a polynomial approximation
80 // and is referred to as the reduced argument.
84 // Take the unreduced part and remove the multiples of 2pi.
85 // So nfloat = nfloat (with lower k+1 bits cleared) + lower k+1 bits
87 // nfloat (with lower k+1 bits cleared) is a multiple of 2^(k+1)
89 // nfloat * pi/2^k = N * 2^(k+1) * pi/2^k + (lower k+1 bits) * pi/2^k
90 // nfloat * pi/2^k = N * 2 * pi + (lower k+1 bits) * pi/2^k
91 // nfloat * pi/2^k = N2pi + M * pi/2^k
94 // Sin(x) = Sin((nfloat * pi/2^k) + r)
95 // = Sin(nfloat * pi/2^k) * Cos(r) + Cos(nfloat * pi/2^k) * Sin(r)
97 // Sin(nfloat * pi/2^k) = Sin(N2pi + Mpi/2^k)
98 // = Sin(N2pi)Cos(Mpi/2^k) + Cos(N2pi)Sin(Mpi/2^k)
101 // Cos(nfloat * pi/2^k) = Cos(N2pi + Mpi/2^k)
102 // = Cos(N2pi)Cos(Mpi/2^k) + Sin(N2pi)Sin(Mpi/2^k)
105 // Sin(x) = Sin(Mpi/2^k) Cos(r) + Cos(Mpi/2^k) Sin(r)
111 // There are 2^(k+1) Sin entries in a table.
112 // There are 2^(k+1) Cos entries in a table.
114 // Get Sin(Mpi/2^k) and Cos(Mpi/2^k) by table lookup.
119 // Calculate Cos(r) and Sin(r) by polynomial approximation.
121 // Cos(r) = 1 + r^2 q1 + r^4 q2 + r^6 q3 + ... = Series for Cos
122 // Sin(r) = r + r^3 p1 + r^5 p2 + r^7 p3 + ... = Series for Sin
124 // and the coefficients q1, q2, ... and p1, p2, ... are stored in a table
128 // Sin(x) = Sin(Mpi/2^k) Cos(r) + Cos(Mpi/2^k) Sin(r)
132 // S[m] = Sin(Mpi/2^k) and C[m] = Cos(Mpi/2^k)
136 // P = p1 + r^2p2 + r^4p3 + r^6p4
137 // Q = q1 + r^2q2 + r^4q3 + r^6q4
140 // Sin(r) = r + rcub * P
141 // = r + r^3p1 + r^5p2 + r^7p3 + r^9p4 + ... = Sin(r)
143 // The coefficients are not exactly these values, but almost.
147 // p3 = -1/5040 = -1/7!
148 // p4 = 1/362889 = 1/9!
152 // Answer = S[m] Cos(r) + C[m] P
154 // Cos(r) = 1 + rsq Q
155 // Cos(r) = 1 + r^2 Q
156 // Cos(r) = 1 + r^2 (q1 + r^2q2 + r^4q3 + r^6q4)
157 // Cos(r) = 1 + r^2q1 + r^4q2 + r^6q3 + r^8q4 + ...
159 // S[m] Cos(r) = S[m](1 + rsq Q)
160 // S[m] Cos(r) = S[m] + S[m] rsq Q
161 // S[m] Cos(r) = S[m] + s_rsq Q
162 // Q = S[m] + s_rsq Q
166 // Answer = Q + C[m] P
169 //==============================================================
170 // general input registers:
173 // predicate registers used:
176 // floating-point registers used
181 //==============================================================
197 cis_Inv_Pi_by_16 = f33
198 cis_Pi_by_16_hi = f34
199 cis_Pi_by_16_lo = f35
201 cis_Inv_Pi_by_64 = f36
202 cis_Pi_by_16_lowest = f37
223 cis_SIG_INV_PI_BY_16_2TO61 = f52
228 cis_W_2TO61_RSH = f57
245 /////////////////////////////////////////////////////////////
250 cis_GR_sig_inv_pi_by_16 = r14
251 cis_GR_rshf_2to61 = r15
253 cis_GR_exp_2tom61 = r17
281 LOCAL_OBJECT_START(double_cis_pi)
282 data8 0xC90FDAA22168C234, 0x00003FFC // pi/16 1st part
283 data8 0xC4C6628B80DC1CD1, 0x00003FBC // pi/16 2nd part
284 data8 0xA4093822299F31D0, 0x00003F7A // pi/16 3rd part
285 LOCAL_OBJECT_END(double_cis_pi)
287 // Coefficients for polynomials
288 LOCAL_OBJECT_START(double_cis_pq_k4)
289 data8 0x3EC71C963717C63A // P4
290 data8 0x3EF9FFBA8F191AE6 // Q4
291 data8 0xBF2A01A00F4E11A8 // P3
292 data8 0xBF56C16C05AC77BF // Q3
293 data8 0x3F8111111110F167 // P2
294 data8 0x3FA555555554DD45 // Q2
295 data8 0xBFC5555555555555 // P1
296 data8 0xBFDFFFFFFFFFFFFC // Q1
297 LOCAL_OBJECT_END(double_cis_pq_k4)
299 // Sincos table (S[m], C[m])
300 LOCAL_OBJECT_START(double_sin_cos_beta_k4)
301 data8 0x0000000000000000 , 0x00000000 // sin( 0 pi/16) S0
302 data8 0x8000000000000000 , 0x00003fff // cos( 0 pi/16) C0
304 data8 0xc7c5c1e34d3055b3 , 0x00003ffc // sin( 1 pi/16) S1
305 data8 0xfb14be7fbae58157 , 0x00003ffe // cos( 1 pi/16) C1
307 data8 0xc3ef1535754b168e , 0x00003ffd // sin( 2 pi/16) S2
308 data8 0xec835e79946a3146 , 0x00003ffe // cos( 2 pi/16) C2
310 data8 0x8e39d9cd73464364 , 0x00003ffe // sin( 3 pi/16) S3
311 data8 0xd4db3148750d181a , 0x00003ffe // cos( 3 pi/16) C3
313 data8 0xb504f333f9de6484 , 0x00003ffe // sin( 4 pi/16) S4
314 data8 0xb504f333f9de6484 , 0x00003ffe // cos( 4 pi/16) C4
316 data8 0xd4db3148750d181a , 0x00003ffe // sin( 5 pi/16) C3
317 data8 0x8e39d9cd73464364 , 0x00003ffe // cos( 5 pi/16) S3
319 data8 0xec835e79946a3146 , 0x00003ffe // sin( 6 pi/16) C2
320 data8 0xc3ef1535754b168e , 0x00003ffd // cos( 6 pi/16) S2
322 data8 0xfb14be7fbae58157 , 0x00003ffe // sin( 7 pi/16) C1
323 data8 0xc7c5c1e34d3055b3 , 0x00003ffc // cos( 7 pi/16) S1
325 data8 0x8000000000000000 , 0x00003fff // sin( 8 pi/16) C0
326 data8 0x0000000000000000 , 0x00000000 // cos( 8 pi/16) S0
328 data8 0xfb14be7fbae58157 , 0x00003ffe // sin( 9 pi/16) C1
329 data8 0xc7c5c1e34d3055b3 , 0x0000bffc // cos( 9 pi/16) -S1
331 data8 0xec835e79946a3146 , 0x00003ffe // sin(10 pi/16) C2
332 data8 0xc3ef1535754b168e , 0x0000bffd // cos(10 pi/16) -S2
334 data8 0xd4db3148750d181a , 0x00003ffe // sin(11 pi/16) C3
335 data8 0x8e39d9cd73464364 , 0x0000bffe // cos(11 pi/16) -S3
337 data8 0xb504f333f9de6484 , 0x00003ffe // sin(12 pi/16) S4
338 data8 0xb504f333f9de6484 , 0x0000bffe // cos(12 pi/16) -S4
340 data8 0x8e39d9cd73464364 , 0x00003ffe // sin(13 pi/16) S3
341 data8 0xd4db3148750d181a , 0x0000bffe // cos(13 pi/16) -C3
343 data8 0xc3ef1535754b168e , 0x00003ffd // sin(14 pi/16) S2
344 data8 0xec835e79946a3146 , 0x0000bffe // cos(14 pi/16) -C2
346 data8 0xc7c5c1e34d3055b3 , 0x00003ffc // sin(15 pi/16) S1
347 data8 0xfb14be7fbae58157 , 0x0000bffe // cos(15 pi/16) -C1
349 data8 0x0000000000000000 , 0x00000000 // sin(16 pi/16) S0
350 data8 0x8000000000000000 , 0x0000bfff // cos(16 pi/16) -C0
352 data8 0xc7c5c1e34d3055b3 , 0x0000bffc // sin(17 pi/16) -S1
353 data8 0xfb14be7fbae58157 , 0x0000bffe // cos(17 pi/16) -C1
355 data8 0xc3ef1535754b168e , 0x0000bffd // sin(18 pi/16) -S2
356 data8 0xec835e79946a3146 , 0x0000bffe // cos(18 pi/16) -C2
358 data8 0x8e39d9cd73464364 , 0x0000bffe // sin(19 pi/16) -S3
359 data8 0xd4db3148750d181a , 0x0000bffe // cos(19 pi/16) -C3
361 data8 0xb504f333f9de6484 , 0x0000bffe // sin(20 pi/16) -S4
362 data8 0xb504f333f9de6484 , 0x0000bffe // cos(20 pi/16) -S4
364 data8 0xd4db3148750d181a , 0x0000bffe // sin(21 pi/16) -C3
365 data8 0x8e39d9cd73464364 , 0x0000bffe // cos(21 pi/16) -S3
367 data8 0xec835e79946a3146 , 0x0000bffe // sin(22 pi/16) -C2
368 data8 0xc3ef1535754b168e , 0x0000bffd // cos(22 pi/16) -S2
370 data8 0xfb14be7fbae58157 , 0x0000bffe // sin(23 pi/16) -C1
371 data8 0xc7c5c1e34d3055b3 , 0x0000bffc // cos(23 pi/16) -S1
373 data8 0x8000000000000000 , 0x0000bfff // sin(24 pi/16) -C0
374 data8 0x0000000000000000 , 0x00000000 // cos(24 pi/16) S0
376 data8 0xfb14be7fbae58157 , 0x0000bffe // sin(25 pi/16) -C1
377 data8 0xc7c5c1e34d3055b3 , 0x00003ffc // cos(25 pi/16) S1
379 data8 0xec835e79946a3146 , 0x0000bffe // sin(26 pi/16) -C2
380 data8 0xc3ef1535754b168e , 0x00003ffd // cos(26 pi/16) S2
382 data8 0xd4db3148750d181a , 0x0000bffe // sin(27 pi/16) -C3
383 data8 0x8e39d9cd73464364 , 0x00003ffe // cos(27 pi/16) S3
385 data8 0xb504f333f9de6484 , 0x0000bffe // sin(28 pi/16) -S4
386 data8 0xb504f333f9de6484 , 0x00003ffe // cos(28 pi/16) S4
388 data8 0x8e39d9cd73464364 , 0x0000bffe // sin(29 pi/16) -S3
389 data8 0xd4db3148750d181a , 0x00003ffe // cos(29 pi/16) C3
391 data8 0xc3ef1535754b168e , 0x0000bffd // sin(30 pi/16) -S2
392 data8 0xec835e79946a3146 , 0x00003ffe // cos(30 pi/16) C2
394 data8 0xc7c5c1e34d3055b3 , 0x0000bffc // sin(31 pi/16) -S1
395 data8 0xfb14be7fbae58157 , 0x00003ffe // cos(31 pi/16) C1
397 data8 0x0000000000000000 , 0x00000000 // sin(32 pi/16) S0
398 data8 0x8000000000000000 , 0x00003fff // cos(32 pi/16) C0
399 LOCAL_OBJECT_END(double_sin_cos_beta_k4)
403 GLOBAL_IEEE754_ENTRY(sincos)
404 // cis_GR_sig_inv_pi_by_16 = significand of 16/pi
406 getf.exp cis_r_signexp = cis_Arg
407 movl cis_GR_sig_inv_pi_by_16 = 0xA2F9836E4E44152A
410 // cis_GR_rshf_2to61 = 1.1000 2^(63+63-2)
412 addl cis_AD_1 = @ltoff(double_cis_pi), gp
413 movl cis_GR_rshf_2to61 = 0x47b8000000000000
417 ld8 cis_AD_1 = [cis_AD_1]
418 fnorm.s1 cis_NORM_f8 = cis_Arg
419 cmp.eq p13, p14 = r0, r0 // p13 set for sincos
421 // cis_GR_exp_2tom61 = exponent of scaling factor 2^-61
423 mov cis_GR_exp_2tom61 = 0xffff-61
425 br.cond.sptk _CIS_COMMON
427 GLOBAL_IEEE754_END(sincos)
429 GLOBAL_LIBM_ENTRY(__libm_sincos)
430 // cis_GR_sig_inv_pi_by_16 = significand of 16/pi
432 getf.exp cis_r_signexp = cis_Arg
433 movl cis_GR_sig_inv_pi_by_16 = 0xA2F9836E4E44152A
435 // cis_GR_rshf_2to61 = 1.1000 2^(63+63-2)
437 addl cis_AD_1 = @ltoff(double_cis_pi), gp
438 movl cis_GR_rshf_2to61 = 0x47b8000000000000
441 // p14 set for __libm_sincos and cis
443 ld8 cis_AD_1 = [cis_AD_1]
444 fnorm.s1 cis_NORM_f8 = cis_Arg
445 cmp.eq p14, p13 = r0, r0
447 // cis_GR_exp_2tom61 = exponent of scaling factor 2^-61
449 mov cis_GR_exp_2tom61 = 0xffff-61
455 // Form two constants we need
456 // 16/pi * 2^-2 * 2^63, scaled by 2^61 since we just loaded the significand
457 // 1.1000...000 * 2^(63+63-2) to right shift int(W) into the low significand
458 // fcmp used to set denormal, and invalid on snans
460 setf.sig cis_SIG_INV_PI_BY_16_2TO61 = cis_GR_sig_inv_pi_by_16
461 fclass.m p6,p0 = cis_Arg, 0xe7 // if x=0,inf,nan
462 addl cis_gr_tmp = -1, r0
464 // 1.1000 2^63 for right shift
466 setf.d cis_RSHF_2TO61 = cis_GR_rshf_2to61
467 movl cis_GR_rshf = 0x43e8000000000000
470 // Form another constant
471 // 2^-61 for scaling Nfloat
472 // 0x1001a is register_bias + 27.
473 // So if f8 >= 2^27, go to large arguments routine
475 alloc GR_SAVE_PFS = ar.pfs, 3, 5, 0, 0
476 fclass.m p11,p0 = cis_Arg, 0x0b // Test for x=unorm
477 mov cis_exp_limit = 0x1001a
480 setf.exp cis_2TOM61 = cis_GR_exp_2tom61
482 (p6) br.cond.spnt _CIS_SPECIAL_ARGS
485 // Load the two pieces of pi/16
486 // Form another constant
487 // 1.1000...000 * 2^63, the right shift constant
489 ldfe cis_Pi_by_16_hi = [cis_AD_1],16
490 setf.d cis_RSHF = cis_GR_rshf
491 (p11) br.cond.spnt _CIS_UNORM // Branch if x=unorm
495 // Return here if x=unorm
496 // Create constant inexact set
498 ldfe cis_Pi_by_16_lo = [cis_AD_1],16
499 setf.sig cis_tmp = cis_gr_tmp
503 // Select exponent (17 lsb)
505 ldfe cis_Pi_by_16_lowest = [cis_AD_1],16
507 dep.z cis_r_exp = cis_r_signexp, 0, 17
510 // Start loading P, Q coefficients
511 // p10 is true if we must call routines to handle larger arguments
512 // p10 is true if f8 exp is > 0x1001a
514 ldfpd cis_P4,cis_Q4 = [cis_AD_1],16
515 cmp.ge p10, p0 = cis_r_exp, cis_exp_limit
516 (p10) br.cond.spnt _CIS_LARGE_ARGS // go to |x| >= 2^27 path
519 // cis_W = x * cis_Inv_Pi_by_16
520 // Multiply x by scaled 16/pi and add large const to shift integer part of W to
521 // rightmost bits of significand
523 ldfpd cis_P3,cis_Q3 = [cis_AD_1],16
524 fma.s1 cis_W_2TO61_RSH = cis_NORM_f8,cis_SIG_INV_PI_BY_16_2TO61,cis_RSHF_2TO61
528 // get N = (int)cis_int_Nfloat
529 // cis_NFLOAT = Round_Int_Nearest(cis_W)
531 getf.sig cis_GR_n = cis_W_2TO61_RSH
532 ldfpd cis_P2,cis_Q2 = [cis_AD_1],16
533 fms.s1 cis_NFLOAT = cis_W_2TO61_RSH,cis_2TOM61,cis_RSHF
536 // cis_r = -cis_Nfloat * cis_Pi_by_16_hi + x
538 ldfpd cis_P1,cis_Q1 = [cis_AD_1], 16
539 fnma.s1 cis_r = cis_NFLOAT,cis_Pi_by_16_hi,cis_NORM_f8
543 // Add 2^(k-1) (which is in cis_r_sincos) to N
545 add cis_GR_n_cos = 0x8, cis_GR_n
547 //Get M (least k+1 bits of N)
548 and cis_GR_m_sin = 0x1f,cis_GR_n
549 and cis_GR_m_cos = 0x1f,cis_GR_n_cos
555 shl cis_GR_32m_sin = cis_GR_m_sin,5
558 // Add 32*M to address of sin_cos_beta table
559 // cis_r = cis_r -cis_Nfloat * cis_Pi_by_16_lo
561 add cis_AD_2_sin = cis_GR_32m_sin, cis_AD_1
562 fnma.s1 cis_r = cis_NFLOAT, cis_Pi_by_16_lo, cis_r
563 shl cis_GR_32m_cos = cis_GR_m_cos,5
566 // Add 32*M to address of sin_cos_beta table
568 ldfe cis_Sm_sin = [cis_AD_2_sin],16
569 add cis_AD_2_cos = cis_GR_32m_cos, cis_AD_1
570 fclass.m.unc p10,p0 = cis_Arg,0x0b // den. input - uflow
574 ldfe cis_Sm_cos = [cis_AD_2_cos], 16
579 ldfe cis_Cm_sin = [cis_AD_2_sin]
580 fma.s1 cis_rsq = cis_r, cis_r, f0 // get r^2
583 // fmpy forces inexact flag
586 fmpy.s0 cis_tmp = cis_tmp,cis_tmp
592 fnma.s1 cis_r_exact = cis_NFLOAT, cis_Pi_by_16_lowest, cis_r
597 ldfe cis_Cm_cos = [cis_AD_2_cos]
598 fma.s1 cis_P_temp1 = cis_rsq, cis_P4, cis_P3
604 fma.s1 cis_Q_temp1 = cis_rsq, cis_Q4, cis_Q3
610 fmpy.s1 cis_srsq_sin = cis_Sm_sin, cis_rsq
615 fmpy.s1 cis_srsq_cos = cis_Sm_cos,cis_rsq
621 fma.s1 cis_Q_temp2 = cis_rsq, cis_Q_temp1, cis_Q2
626 fma.s1 cis_P_temp2 = cis_rsq, cis_P_temp1, cis_P2
632 fmpy.s1 cis_rcub = cis_r_exact, cis_rsq // get r^3
638 fma.s1 cis_Q = cis_rsq, cis_Q_temp2, cis_Q1
643 fma.s1 cis_P = cis_rsq, cis_P_temp2, cis_P1
649 fma.s1 cis_Q_sin = cis_srsq_sin,cis_Q, cis_Sm_sin
654 fma.s1 cis_Q_cos = cis_srsq_cos,cis_Q, cis_Sm_cos
660 fma.s1 cis_P = cis_rcub,cis_P, cis_r_exact // final P
664 // If den. arg, force underflow to be set
667 (p10) fmpy.d.s0 cis_tmp = cis_Arg,cis_Arg
673 fma.d.s0 cis_Sin_res = cis_Cm_sin,cis_P,cis_Q_sin//Final sin
678 fma.d.s0 cis_Cos_res = cis_Cm_cos,cis_P,cis_Q_cos//Final cos
679 (p14) br.ret.sptk b0 // common exit for __libm_sincos and cis main path
683 stfd [cis_pResSin] = cis_Sin_res
684 stfd [cis_pResCos] = cis_Cos_res
685 br.ret.sptk b0 // common exit for sincos main path
694 fma.d.s0 cis_Sin_res = cis_Arg, f0, f0 // sinf(+/-0,NaN,Inf)
702 fma.d.s0 cis_Cos_res = cis_Arg, f0, f1 // cosf(+/-0,NaN,Inf)
703 (p14) br.ret.sptk b0 //spec exit for __libm_sincos and cis main path
707 stfd [cis_pResSin] = cis_Sin_res
708 stfd [cis_pResCos] = cis_Cos_res
709 br.ret.sptk b0 // common exit for sincos main path
715 getf.exp cis_r_signexp = cis_NORM_f8 // Get signexp of x
716 fcmp.eq.s0 p11,p0 = cis_Arg, f0 // Dummy op to set denorm
717 br.cond.sptk _CIS_COMMON2 // Return to main path
720 GLOBAL_LIBM_END(__libm_sincos)
722 //// |x| > 2^27 path ///////
723 .proc _CIS_LARGE_ARGS
729 .save ar.pfs, GR_SAVE_PFS
730 mov GR_SAVE_PFS = ar.pfs
742 // Call of huge arguments sincos
746 br.call.sptk b0 = __libm_sincos_large
752 mov pr = GR_SAVE_PR, 0x1fffe
765 fma.d.s0 cis_Cos_res = cis_Cos_res, f1, f0
766 mov ar.pfs = GR_SAVE_PFS
770 fma.d.s0 cis_Sin_res = cis_Sin_res, f1, f0
771 (p14) br.ret.sptk b0 // exit for |x| > 2^27 path (__libm_sincos and cis)
775 stfd [cis_pResSin] = cis_Sin_res
776 stfd [cis_pResCos] = cis_Cos_res
777 br.ret.sptk b0 // exit for sincos |x| > 2^27 path
779 .endp _CIS_LARGE_ARGS
781 .type __libm_sincos_large#,@function
782 .global __libm_sincos_large#