View | Details | Raw Unified | Return to bug 10163 | Differences between
and this patch

Collapse All | Expand All

(-)a/sysdeps/ia64/fpu/e_fmod.S (-4 / +4 lines)
 Lines 75-82    Link Here 
75
//
75
//
76
// Special cases
76
// Special cases
77
//====================================================================
77
//====================================================================
78
// b=+/-0: return NaN, call libm_error_support
78
// a=+/-Inf or b=+/-0: return NaN, call libm_error_support
79
// a=+/-Inf, a=NaN or b=NaN: return NaN
79
// a=NaN or b=NaN: return NaN
80
//
80
//
81
// Registers used
81
// Registers used
82
//====================================================================
82
//====================================================================
 Lines 407-419   FMOD_X_NAN_INF: Link Here 
407
      nop.m 999
407
      nop.m 999
408
    // also set Denormal flag if necessary
408
    // also set Denormal flag if necessary
409
(p8)  fma.s0 f9=f9,f1,f0
409
(p8)  fma.s0 f9=f9,f1,f0
410
      nop.i 999 ;;
410
(p8)  mov GR_Parameter_TAG=274 ;;
411
}
411
}
412
412
413
{ .mfb
413
{ .mfb
414
      nop.m 999
414
      nop.m 999
415
(p8)  fma.d.s0 f8=f8,f1,f0
415
(p8)  fma.d.s0 f8=f8,f1,f0
416
      nop.b 999 ;;
416
(p8)  br.spnt __libm_error_region;;
417
}
417
}
418
418
419
{ .mfb
419
{ .mfb
(-)a/sysdeps/ia64/fpu/e_fmodf.S (-4 / +4 lines)
 Lines 75-82    Link Here 
75
75
76
// Special cases
76
// Special cases
77
//====================================================================
77
//====================================================================
78
// b=+/-0: return NaN, call libm_error_support
78
// a=+/-Inf or b=+/-0: return NaN, call libm_error_support
79
// a=+/-Inf, a=NaN or b=NaN: return NaN
79
// a=NaN or b=NaN: return NaN
80
80
81
// Registers used
81
// Registers used
82
//====================================================================
82
//====================================================================
 Lines 413-425   FMOD_X_NAN_INF: Link Here 
413
      nop.m 999
413
      nop.m 999
414
    // also set Denormal flag if necessary
414
    // also set Denormal flag if necessary
415
(p8)  fma.s0 f9=f9,f1,f0
415
(p8)  fma.s0 f9=f9,f1,f0
416
      nop.i 999 ;;
416
(p8)  mov GR_Parameter_TAG=275 ;;
417
}
417
}
418
418
419
{ .mfb
419
{ .mfb
420
      nop.m 999
420
      nop.m 999
421
(p8)  fma.s.s0 f8=f8,f1,f0
421
(p8)  fma.s.s0 f8=f8,f1,f0
422
      nop.b 999 ;;
422
(p8)  br.spnt __libm_error_region;;
423
}
423
}
424
424
425
{ .mfb
425
{ .mfb
(-)a/sysdeps/ia64/fpu/e_fmodl.S (-1 / +11 lines)
 Lines 484-489   FMOD_A_NAN_INF: Link Here 
484
 (p8)  cmp.ne p7, p0 = GR_SIG_B, r0
484
 (p8)  cmp.ne p7, p0 = GR_SIG_B, r0
485
       nop.i 0
485
       nop.i 0
486
}
486
}
487
{ .mfi
488
       nop.m 0
489
       fmerge.s FR_X = f8, f8
490
       nop.i 0
491
}
487
;;
492
;;
488
493
489
{ .mfi
494
{ .mfi
 Lines 509-515   FMOD_A_NAN_INF: Link Here 
509
{ .mfb
514
{ .mfb
510
       nop.m 0
515
       nop.m 0
511
 (p9)  frcpa.s0 f8, p7 = f8, f9
516
 (p9)  frcpa.s0 f8, p7 = f8, f9
512
       br.ret.sptk b0
517
 (p9)  br.ret.sptk b0
518
}
519
{ .mmb
520
       alloc GR_ARPFS = ar.pfs, 1, 4, 4, 0
521
       mov GR_Parameter_TAG = 273
522
       br.sptk __libm_error_region
513
}
523
}
514
;;
524
;;
515
525
(-)a/sysdeps/ia64/fpu/libm_error.c (-6 / +69 lines)
 Lines 708-722   switch(input_tag) Link Here 
708
  case gammal_negative:
708
  case gammal_negative:
709
  case gamma_negative:
709
  case gamma_negative:
710
  case gammaf_negative:
710
  case gammaf_negative:
711
  case lgammal_negative:
712
  case lgamma_negative:
713
  case lgammaf_negative:
714
  case tgammal_negative:
711
  case tgammal_negative:
715
  case tgamma_negative:
712
  case tgamma_negative:
716
  case tgammaf_negative:
713
  case tgammaf_negative:
717
  {
714
  {
718
       ERRNO_DOMAIN; break;
715
       ERRNO_DOMAIN; break;
719
  }
716
  }
717
  case lgammal_negative:
718
  case lgamma_negative:
719
  case lgammaf_negative:
720
  {
721
       ERRNO_RANGE; break;
722
  }
720
  case ldexpl_overflow:
723
  case ldexpl_overflow:
721
  case ldexpl_underflow:
724
  case ldexpl_underflow:
722
  case ldexp_overflow:
725
  case ldexp_overflow:
 Lines 1081-1097   switch(input_tag) Link Here 
1081
  case powl_zero_to_negative:
1084
  case powl_zero_to_negative:
1082
    /* 0**neg */
1085
    /* 0**neg */
1083
    {
1086
    {
1084
       ERRNO_DOMAIN; break;
1087
       ERRNO_RANGE; break;
1085
    }
1088
    }
1086
  case pow_zero_to_negative:
1089
  case pow_zero_to_negative:
1087
    /* 0**neg */
1090
    /* 0**neg */
1088
    {
1091
    {
1089
       ERRNO_DOMAIN; break;
1092
       ERRNO_RANGE; break;
1090
    }
1093
    }
1091
  case  powf_zero_to_negative:
1094
  case  powf_zero_to_negative:
1092
    /* 0**neg */
1095
    /* 0**neg */
1093
    {
1096
    {
1094
       ERRNO_DOMAIN; break;
1097
       ERRNO_RANGE; break;
1095
    }
1098
    }
1096
  case powl_neg_to_non_integer:
1099
  case powl_neg_to_non_integer:
1097
    /* neg**non_integral */
1100
    /* neg**non_integral */
 Lines 1307-1312   switch(input_tag) Link Here 
1307
    {
1310
    {
1308
       ERRNO_DOMAIN; break;
1311
       ERRNO_DOMAIN; break;
1309
    }
1312
    }
1313
  case fmodl_infinity:
1314
    /* fmodl(inf,y) */
1315
    {
1316
       ERRNO_DOMAIN; break;
1317
    }
1318
  case fmod_infinity:
1319
    /* fmod(inf,y) */
1320
    {
1321
       ERRNO_DOMAIN; break;
1322
    }
1323
  case fmodf_infinity:
1324
    /* fmodf(inf,y) */
1325
    {
1326
       ERRNO_DOMAIN; break;
1327
    }
1310
  case coshl_overflow:
1328
  case coshl_overflow:
1311
    /* coshl overflows */
1329
    /* coshl overflows */
1312
    {
1330
    {
 Lines 1373-1378   switch(input_tag) Link Here 
1373
   {
1391
   {
1374
      ERRNO_RANGE; break;
1392
      ERRNO_RANGE; break;
1375
   }
1393
   }
1394
  case cosl_infinity:
1395
    /* cosl(inf) */
1396
    {
1397
       ERRNO_DOMAIN; break;
1398
    }
1399
  case cos_infinity:
1400
    /* cos(inf) */
1401
    {
1402
       ERRNO_DOMAIN; break;
1403
    }
1404
  case cosf_infinity:
1405
    /* cosf(inf) */
1406
    {
1407
       ERRNO_DOMAIN; break;
1408
    }
1409
  case sinl_infinity:
1410
    /* sinl(inf) */
1411
    {
1412
       ERRNO_DOMAIN; break;
1413
    }
1414
  case sin_infinity:
1415
    /* sin(inf) */
1416
    {
1417
       ERRNO_DOMAIN; break;
1418
    }
1419
  case sinf_infinity:
1420
    /* sinf(inf) */
1421
    {
1422
       ERRNO_DOMAIN; break;
1423
    }
1424
  case tanl_infinity:
1425
    /* tanl(inf) */
1426
    {
1427
       ERRNO_DOMAIN; break;
1428
    }
1429
  case tan_infinity:
1430
    /* tan(inf) */
1431
    {
1432
       ERRNO_DOMAIN; break;
1433
    }
1434
  case tanf_infinity:
1435
    /* tanf(inf) */
1436
    {
1437
       ERRNO_DOMAIN; break;
1438
    }
1376
  default:
1439
  default:
1377
    break;
1440
    break;
1378
}
1441
}
(-)a/sysdeps/ia64/fpu/libm_error_codes.h (-1 / +5 lines)
 Lines 195-201   typedef enum Link Here 
195
  nextafterl_underflow, nextafter_underflow, 
195
  nextafterl_underflow, nextafter_underflow, 
196
  nextafterf_underflow,                                /* 267, 268, 269 */
196
  nextafterf_underflow,                                /* 267, 268, 269 */
197
  nexttowardl_underflow, nexttoward_underflow, 
197
  nexttowardl_underflow, nexttoward_underflow, 
198
  nexttowardf_underflow                                /* 270, 271, 272 */
198
  nexttowardf_underflow,                               /* 270, 271, 272 */
199
  fmodl_infinity, fmod_infinity, fmodf_infinity,       /* 273, 274, 275 */
200
  cosl_infinity, cos_infinity, cosf_infinity,          /* 276, 277, 278 */
201
  sinl_infinity, sin_infinity, sinf_infinity,          /* 279, 280, 281 */
202
  tanl_infinity, tan_infinity, tanf_infinity,          /* 282, 283, 284 */
199
} error_types;
203
} error_types;
200
204
201
#define LIBM_ERROR __libm_error_support
205
#define LIBM_ERROR __libm_error_support
(-)a/sysdeps/ia64/fpu/s_cos.S (-4 / +78 lines)
 Lines 174-180    Link Here 
174
//==============================================================
174
//==============================================================
175
// general input registers:
175
// general input registers:
176
// r14 -> r26
176
// r14 -> r26
177
// r32 -> r35
177
// r32 -> r36
178
178
179
// predicate registers used:
179
// predicate registers used:
180
// p6 -> p11
180
// p6 -> p11
 Lines 260-265   GR_SAVE_B0 = r34 Link Here 
260
GR_SAVE_GP                     = r35
260
GR_SAVE_GP                     = r35
261
GR_SAVE_r_sincos               = r36
261
GR_SAVE_r_sincos               = r36
262
262
263
GR_Parameter_X                 = r37
264
GR_Parameter_Y                 = r38
265
GR_Parameter_RESULT            = r39
266
GR_Parameter_TAG               = r40
263
267
264
RODATA
268
RODATA
265
269
 Lines 474-480   _SINCOS_COMMON: Link Here 
474
// 0x1001a is register_bias + 27.
478
// 0x1001a is register_bias + 27.
475
// So if f8 >= 2^27, go to large argument routines
479
// So if f8 >= 2^27, go to large argument routines
476
{ .mfi
480
{ .mfi
477
      alloc         r32                 = ar.pfs, 1, 4, 0, 0
481
      alloc         r32                 = ar.pfs, 1, 4, 4, 0
478
      fclass.m      p11,p0              = f8, 0x0b // Test for x=unorm
482
      fclass.m      p11,p0              = f8, 0x0b // Test for x=unorm
479
      mov           sincos_GR_all_ones  = -1 // For "inexect" constant create
483
      mov           sincos_GR_all_ones  = -1 // For "inexect" constant create
480
}
484
}
 Lines 681-700   _SINCOS_COMMON2: Link Here 
681
////////// x = 0/Inf/NaN path //////////////////
685
////////// x = 0/Inf/NaN path //////////////////
682
_SINCOS_SPECIAL_ARGS:
686
_SINCOS_SPECIAL_ARGS:
683
.pred.rel "mutex",p8,p9
687
.pred.rel "mutex",p8,p9
688
689
{ .mfi
690
      nop.m         999
691
      fclass.m.unc  p7,p0               = f8, 0x23 // is x +/- inf?
692
      nop.i         999;;
693
}
694
695
{ .mfi
696
      nop.m         999
697
(p7)  fmerge.s      f9 = f8,f8
698
      nop.i         999
699
}
700
684
// sin(+/-0) = +/-0
701
// sin(+/-0) = +/-0
685
// sin(Inf)  = NaN
702
// sin(Inf)  = NaN
686
// sin(NaN)  = NaN
703
// sin(NaN)  = NaN
687
{ .mfi
704
{ .mfi
688
      nop.m         999
705
      nop.m         999
689
(p8)  fma.d.s0      f8                  = f8, f0, f0 // sin(+/-0,NaN,Inf)
706
(p8)  fma.d.s0      f8                  = f8, f0, f0 // sin(+/-0,NaN,Inf)
690
      nop.i         999
707
(p8)  mov           GR_Parameter_TAG    = 280
691
}
708
}
692
// cos(+/-0) = 1.0
709
// cos(+/-0) = 1.0
693
// cos(Inf)  = NaN
710
// cos(Inf)  = NaN
694
// cos(NaN)  = NaN
711
// cos(NaN)  = NaN
695
{ .mfb
712
{ .mfi
696
      nop.m         999
713
      nop.m         999
697
(p9)  fma.d.s0      f8                  = f8, f0, f1 // cos(+/-0,NaN,Inf)
714
(p9)  fma.d.s0      f8                  = f8, f0, f1 // cos(+/-0,NaN,Inf)
715
(p9)  mov           GR_Parameter_TAG    = 277
716
}
717
718
{ .mbb
719
      nop.m         999
720
(p7)  br.cond.spnt  __libm_error_region
698
      br.ret.sptk   b0 // Exit for x = 0/Inf/NaN path
721
      br.ret.sptk   b0 // Exit for x = 0/Inf/NaN path
699
};;
722
};;
700
723
 Lines 766-768   LOCAL_LIBM_END(__libm_callout_sincos) Link Here 
766
.type    __libm_cos_large#,@function
789
.type    __libm_cos_large#,@function
767
.global  __libm_cos_large#
790
.global  __libm_cos_large#
768
791
792
LOCAL_LIBM_ENTRY(__libm_error_region)
793
.prologue
794
{ .mfi
795
        add   GR_Parameter_Y=-32,sp             // Parameter 2 value
796
        nop.f 0
797
.save   ar.pfs,GR_SAVE_PFS
798
        mov  GR_SAVE_PFS=ar.pfs                 // Save ar.pfs
799
}
800
{ .mfi
801
.fframe 64
802
        add sp=-64,sp                           // Create new stack
803
        nop.f 0
804
        mov GR_SAVE_GP=gp                       // Save gp
805
};;
806
{ .mmi
807
        stfd [GR_Parameter_Y] = f1,16           // STORE Parameter 2 on stack
808
        add GR_Parameter_X = 16,sp              // Parameter 1 address
809
.save   b0, GR_SAVE_B0
810
        mov GR_SAVE_B0=b0                       // Save b0
811
};;
812
.body
813
{ .mib
814
        stfd [GR_Parameter_X] = f9              // STORE Parameter 1 on stack
815
        add   GR_Parameter_RESULT = 0,GR_Parameter_Y  // Parameter 3 address
816
        nop.b 0
817
}
818
{ .mib
819
        stfd [GR_Parameter_Y] = f8              // STORE Parameter 3 on stack
820
        add   GR_Parameter_Y = -16,GR_Parameter_Y
821
        br.call.sptk b0=__libm_error_support#   // Call error handling function
822
};;
823
{ .mmi
824
        add   GR_Parameter_RESULT = 48,sp
825
        nop.m 0
826
        nop.i 0
827
};;
828
{ .mmi
829
        ldfd  f8 = [GR_Parameter_RESULT]       // Get return result off stack
830
.restore sp
831
        add   sp = 64,sp                       // Restore stack pointer
832
        mov   b0 = GR_SAVE_B0                  // Restore return address
833
};;
834
{ .mib
835
        mov   gp = GR_SAVE_GP                  // Restore gp
836
        mov   ar.pfs = GR_SAVE_PFS             // Restore ar.pfs
837
        br.ret.sptk     b0                     // Return
838
};;
839
840
LOCAL_LIBM_END(__libm_error_region)
841
.type   __libm_error_support#,@function
842
.global __libm_error_support#
(-)a/sysdeps/ia64/fpu/s_cosf.S (-5 / +80 lines)
 Lines 171-177    Link Here 
171
//==============================================================
171
//==============================================================
172
// general input registers:
172
// general input registers:
173
// r14 -> r19
173
// r14 -> r19
174
// r32 -> r45
174
// r32 -> r43
175
175
176
// predicate registers used:
176
// predicate registers used:
177
// p6 -> p14
177
// p6 -> p14
 Lines 260-265   GR_SAVE_PFS = r41 Link Here 
260
GR_SAVE_B0                      = r42
260
GR_SAVE_B0                      = r42
261
GR_SAVE_GP                      = r43
261
GR_SAVE_GP                      = r43
262
262
263
GR_Parameter_X                  = r44
264
GR_Parameter_Y                  = r45
265
GR_Parameter_RESULT             = r46
266
GR_Parameter_TAG                = r47
267
263
RODATA
268
RODATA
264
.align 16
269
.align 16
265
270
 Lines 389-395   LOCAL_OBJECT_END(double_sin_cos_beta_k4) Link Here 
389
GLOBAL_IEEE754_ENTRY(sinf)
394
GLOBAL_IEEE754_ENTRY(sinf)
390
395
391
{ .mlx
396
{ .mlx
392
      alloc         r32                 = ar.pfs,1,13,0,0
397
      alloc         r32                 = ar.pfs,1,11,4,0
393
      movl  sincosf_GR_sig_inv_pi_by_16 = 0xA2F9836E4E44152A //signd of 16/pi
398
      movl  sincosf_GR_sig_inv_pi_by_16 = 0xA2F9836E4E44152A //signd of 16/pi
394
}
399
}
395
{ .mlx
400
{ .mlx
 Lines 413-419   GLOBAL_IEEE754_END(sinf) Link Here 
413
GLOBAL_IEEE754_ENTRY(cosf)
418
GLOBAL_IEEE754_ENTRY(cosf)
414
419
415
{ .mlx
420
{ .mlx
416
      alloc         r32                 = ar.pfs,1,13,0,0
421
      alloc         r32                 = ar.pfs,1,11,4,0
417
      movl  sincosf_GR_sig_inv_pi_by_16 = 0xA2F9836E4E44152A //signd of 16/pi
422
      movl  sincosf_GR_sig_inv_pi_by_16 = 0xA2F9836E4E44152A //signd of 16/pi
418
}
423
}
419
{ .mlx
424
{ .mlx
 Lines 641-660   _SINCOSF_COMMON: Link Here 
641
////////// x = 0/Inf/NaN path //////////////////
646
////////// x = 0/Inf/NaN path //////////////////
642
_SINCOSF_SPECIAL_ARGS:
647
_SINCOSF_SPECIAL_ARGS:
643
.pred.rel "mutex",p8,p9
648
.pred.rel "mutex",p8,p9
649
650
{ .mfi
651
      nop.m         999
652
      fclass.m.unc  p7,p0               = f8, 0x23 // is x +/- inf?
653
      nop.i         999;;
654
}
655
656
{ .mfi
657
      nop.m         999
658
(p7)  fmerge.s      f9 = f8,f8
659
      nop.i         999
660
}
661
644
// sinf(+/-0) = +/-0
662
// sinf(+/-0) = +/-0
645
// sinf(Inf)  = NaN
663
// sinf(Inf)  = NaN
646
// sinf(NaN)  = NaN
664
// sinf(NaN)  = NaN
647
{ .mfi
665
{ .mfi
648
      nop.m         999
666
      nop.m         999
649
(p8)  fma.s.s0      f8                  = f8, f0, f0 // sinf(+/-0,NaN,Inf)
667
(p8)  fma.s.s0      f8                  = f8, f0, f0 // sinf(+/-0,NaN,Inf)
650
      nop.i         999
668
(p8)  mov           GR_Parameter_TAG    = 281
651
}
669
}
652
// cosf(+/-0) = 1.0
670
// cosf(+/-0) = 1.0
653
// cosf(Inf)  = NaN
671
// cosf(Inf)  = NaN
654
// cosf(NaN)  = NaN
672
// cosf(NaN)  = NaN
655
{ .mfb
673
{ .mfi
656
      nop.m         999
674
      nop.m         999
657
(p9)  fma.s.s0      f8                  = f8, f0, f1 // cosf(+/-0,NaN,Inf)
675
(p9)  fma.s.s0      f8                  = f8, f0, f1 // cosf(+/-0,NaN,Inf)
676
(p9)  mov           GR_Parameter_TAG    = 278
677
};;
678
679
{ .mbb
680
      nop.m         999
681
(p7)  br.cond.spnt  __libm_error_region
658
      br.ret.sptk   b0 // Exit for x = 0/Inf/NaN path
682
      br.ret.sptk   b0 // Exit for x = 0/Inf/NaN path
659
};;
683
};;
660
684
 Lines 715-717   LOCAL_LIBM_END(__libm_callout_sincosf) Link Here 
715
.type    __libm_cos_large#, @function
739
.type    __libm_cos_large#, @function
716
.global  __libm_cos_large#
740
.global  __libm_cos_large#
717
741
742
LOCAL_LIBM_ENTRY(__libm_error_region)
743
.prologue
744
{ .mfi
745
        add   GR_Parameter_Y=-32,sp             // Parameter 2 value
746
        nop.f 0
747
.save   ar.pfs,GR_SAVE_PFS
748
        mov  GR_SAVE_PFS=ar.pfs                 // Save ar.pfs
749
}
750
{ .mfi
751
.fframe 64
752
        add sp=-64,sp                           // Create new stack
753
        nop.f 0
754
        mov GR_SAVE_GP=gp                       // Save gp
755
};;
756
{ .mmi
757
        stfd [GR_Parameter_Y] = f1,16           // STORE Parameter 2 on stack
758
        add GR_Parameter_X = 16,sp              // Parameter 1 address
759
.save   b0, GR_SAVE_B0
760
        mov GR_SAVE_B0=b0                       // Save b0
761
};;
762
.body
763
{ .mib
764
        stfd [GR_Parameter_X] = f9              // STORE Parameter 1 on stack
765
        add   GR_Parameter_RESULT = 0,GR_Parameter_Y  // Parameter 3 address
766
        nop.b 0
767
}
768
{ .mib
769
        stfd [GR_Parameter_Y] = f8              // STORE Parameter 3 on stack
770
        add   GR_Parameter_Y = -16,GR_Parameter_Y
771
        br.call.sptk b0=__libm_error_support#   // Call error handling function
772
};;
773
{ .mmi
774
        add   GR_Parameter_RESULT = 48,sp
775
        nop.m 0
776
        nop.i 0
777
};;
778
{ .mmi
779
        ldfd  f8 = [GR_Parameter_RESULT]       // Get return result off stack
780
.restore sp
781
        add   sp = 64,sp                       // Restore stack pointer
782
        mov   b0 = GR_SAVE_B0                  // Restore return address
783
};;
784
{ .mib
785
        mov   gp = GR_SAVE_GP                  // Restore gp
786
        mov   ar.pfs = GR_SAVE_PFS             // Restore ar.pfs
787
        br.ret.sptk     b0                     // Return
788
};;
789
790
LOCAL_LIBM_END(__libm_error_region)
791
.type   __libm_error_support#,@function
792
.global __libm_error_support#
(-)a/sysdeps/ia64/fpu/s_cosl.S (-3 / +77 lines)
 Lines 747-758   GR_SAVE_B0 = r39 Link Here 
747
GR_SAVE_GP     = r40
747
GR_SAVE_GP     = r40
748
GR_SAVE_PFS    = r41
748
GR_SAVE_PFS    = r41
749
749
750
GR_Parameter_X = r59
751
GR_Parameter_Y = r60
752
GR_Parameter_RESULT = r61
753
GR_Parameter_TAG = r62
750
754
751
.section .text
755
.section .text
752
756
753
GLOBAL_IEEE754_ENTRY(sinl)
757
GLOBAL_IEEE754_ENTRY(sinl)
754
{ .mlx
758
{ .mlx
755
      alloc r32 = ar.pfs,0,27,2,0
759
      alloc r32 = ar.pfs,1,26,4,0
756
      movl GR_sig_inv_pi = 0xa2f9836e4e44152a // significand of 1/pi
760
      movl GR_sig_inv_pi = 0xa2f9836e4e44152a // significand of 1/pi
757
}
761
}
758
{ .mlx
762
{ .mlx
 Lines 777-783   GLOBAL_IEEE754_END(sinl) Link Here 
777
781
778
GLOBAL_IEEE754_ENTRY(cosl)
782
GLOBAL_IEEE754_ENTRY(cosl)
779
{ .mlx
783
{ .mlx
780
      alloc r32 = ar.pfs,0,27,2,0
784
      alloc r32 = ar.pfs,1,26,4,0
781
      movl GR_sig_inv_pi = 0xa2f9836e4e44152a // significand of 1/pi
785
      movl GR_sig_inv_pi = 0xa2f9836e4e44152a // significand of 1/pi
782
}
786
}
783
{ .mlx
787
{ .mlx
 Lines 2278-2290   SINCOSL_DENORMAL: Link Here 
2278
SINCOSL_SPECIAL:
2282
SINCOSL_SPECIAL:
2279
{ .mfb
2283
{ .mfb
2280
        nop.m 999
2284
        nop.m 999
2285
        fclass.m.unc p6,p0 = f8, 0x23 // is x +/- inf?
2286
        nop.b 999;;
2287
}
2288
2289
{ .mfi
2290
        nop.m 999
2291
(p6)    fmerge.s f9 = f8,f8
2292
(p6)    cmp.eq.unc p7, p8 = 0x1, GR_Sin_or_Cos;;
2293
}
2294
2295
{ .mmf
2296
(p7)    mov GR_Parameter_TAG = 276        // (cosl)
2297
(p8)    mov GR_Parameter_TAG = 279        // (sinl)
2281
//
2298
//
2282
//      Path for Arg = +/- QNaN, SNaN, Inf
2299
//      Path for Arg = +/- QNaN, SNaN, Inf
2283
//      Invalid can be raised. SNaNs
2300
//      Invalid can be raised. SNaNs
2284
//      become QNaNs
2301
//      become QNaNs
2285
//
2302
//
2286
        fmpy.s0 FR_Result = FR_Input_X, f0
2303
        fmpy.s0 FR_Result = FR_Input_X, f0
2287
        br.ret.sptk   b0 ;;
2304
}
2305
2306
{ .mbb
2307
        nop.m 999
2308
(p6)    br.cond.spnt __libm_error_region
2309
        br.ret.sptk b0 ;;
2288
}
2310
}
2289
2311
2290
GLOBAL_IEEE754_END(cosl)
2312
GLOBAL_IEEE754_END(cosl)
 Lines 2363-2365   SINCOSL_ARG_TOO_LARGE: Link Here 
2363
LOCAL_LIBM_END(__libm_callout)
2385
LOCAL_LIBM_END(__libm_callout)
2364
.type   __libm_pi_by_2_reduce#,@function
2386
.type   __libm_pi_by_2_reduce#,@function
2365
.global __libm_pi_by_2_reduce#
2387
.global __libm_pi_by_2_reduce#
2388
2389
LOCAL_LIBM_ENTRY(__libm_error_region)
2390
.prologue
2391
{ .mfi
2392
        add   GR_Parameter_Y=-32,sp             // Parameter 2 value
2393
        nop.f 0
2394
.save   ar.pfs,GR_SAVE_PFS
2395
        mov  GR_SAVE_PFS=ar.pfs                 // Save ar.pfs
2396
}
2397
{ .mfi
2398
.fframe 64
2399
        add sp=-64,sp                           // Create new stack
2400
        nop.f 0
2401
        mov GR_SAVE_GP=gp                       // Save gp
2402
};;
2403
{ .mmi
2404
        stfd [GR_Parameter_Y] = f1,16           // STORE Parameter 2 on stack
2405
        add GR_Parameter_X = 16,sp              // Parameter 1 address
2406
.save   b0, GR_SAVE_B0
2407
        mov GR_SAVE_B0=b0                       // Save b0
2408
};;
2409
.body
2410
{ .mib
2411
        stfd [GR_Parameter_X] = f9              // STORE Parameter 1 on stack
2412
        add   GR_Parameter_RESULT = 0,GR_Parameter_Y  // Parameter 3 address
2413
        nop.b 0
2414
}
2415
{ .mib
2416
        stfd [GR_Parameter_Y] = f8              // STORE Parameter 3 on stack
2417
        add   GR_Parameter_Y = -16,GR_Parameter_Y
2418
        br.call.sptk b0=__libm_error_support#   // Call error handling function
2419
};;
2420
{ .mmi
2421
        add   GR_Parameter_RESULT = 48,sp
2422
        nop.m 0
2423
        nop.i 0
2424
};;
2425
{ .mmi
2426
        ldfd  f8 = [GR_Parameter_RESULT]       // Get return result off stack
2427
.restore sp
2428
        add   sp = 64,sp                       // Restore stack pointer
2429
        mov   b0 = GR_SAVE_B0                  // Restore return address
2430
};;
2431
{ .mib
2432
        mov   gp = GR_SAVE_GP                  // Restore gp
2433
        mov   ar.pfs = GR_SAVE_PFS             // Restore ar.pfs
2434
        br.ret.sptk     b0                     // Return
2435
};;
2436
2437
LOCAL_LIBM_END(__libm_error_region)
2438
.type   __libm_error_support#,@function
2439
.global __libm_error_support#
(-)a/sysdeps/ia64/fpu/s_tan.S (-7 / +8 lines)
 Lines 348-362   COMMON_PATH: Link Here 
348
(p6)  br.ret.spnt    b0    ;;         // Exit for x=0 (tan only)
348
(p6)  br.ret.spnt    b0    ;;         // Exit for x=0 (tan only)
349
}
349
}
350
350
351
{ .mfi
351
{ .mmi
352
      ldfpd     tan_P14,tan_P15 = [tan_AD],16
352
      ldfpd     tan_P14,tan_P15 = [tan_AD],16
353
(p7)  frcpa.s0  f8,p9=f0,f0           // Set qnan indef if x=inf
354
      mov       tan_GR_10009 = 0x10009
355
}
356
{ .mib
357
      ldfpd      tan_Q8,tan_Q9  = [tan_ADQ],16
353
      ldfpd      tan_Q8,tan_Q9  = [tan_ADQ],16
358
      nop.i 999
354
      mov       tan_GR_10009 = 0x10009;;
359
(p7)  br.ret.spnt    b0    ;;         // Exit for x=inf
360
}
355
}
361
356
362
{ .mfi
357
{ .mfi
 Lines 384-389   COMMON_PATH: Link Here 
384
      fma.s1 TAN_W_2TO64_RSH = tan_NORM_f8,TAN_INV_PI_BY_2_2TO64,TAN_RSHF_2TO64
379
      fma.s1 TAN_W_2TO64_RSH = tan_NORM_f8,TAN_INV_PI_BY_2_2TO64,TAN_RSHF_2TO64
385
};;
380
};;
386
381
382
{ .mfb
383
(p7)  mov GR_Parameter_Tag = 283          // (tan)
384
(p7)  frcpa.s0  f8,p9=f0,f0               // Set qnan indef if x=inf
385
(p7)  br.cond.spnt __libm_error_region ;; // call error support if tan(+-inf)
386
}
387
387
{ .mmf
388
{ .mmf
388
      ldfpd      tan_P10,tan_P11 = [tan_AD],16
389
      ldfpd      tan_P10,tan_P11 = [tan_AD],16
389
      and       tan_exp = tan_GR_17_ones, tan_signexp
390
      and       tan_exp = tan_GR_17_ones, tan_signexp
(-)a/sysdeps/ia64/fpu/s_tanf.S (-3 / +3 lines)
 Lines 301-311   Common_Path: Link Here 
301
{ .mfi
301
{ .mfi
302
      cmp.ge    p6, p0      = rSignMask, rExpCut    // p6 = (E => 0x10009)
302
      cmp.ge    p6, p0      = rSignMask, rExpCut    // p6 = (E => 0x10009)
303
(p8)  frcpa.s0  f8, p0      = f0, f0                // Set qnan indef if x=inf
303
(p8)  frcpa.s0  f8, p0      = f0, f0                // Set qnan indef if x=inf
304
      mov GR_Parameter_Tag  = 227                   // (cotf)
304
      mov GR_Parameter_Tag  = 284                   // (tanf)
305
}
305
}
306
{ .mbb
306
{ .mbb
307
      ldfe      fPiby2      = [rCoeffB], 16
307
      ldfe      fPiby2      = [rCoeffB], 16
308
(p8)  br.ret.spnt b0                                // Exit for x=inf
308
(p8)  br.cond.spnt __libm_error_region              // call error support if tanf(+-0)
309
(p6)  br.cond.spnt Huge_Argument                    // Branch if |x|>=2^10
309
(p6)  br.cond.spnt Huge_Argument                    // Branch if |x|>=2^10
310
}
310
}
311
;;
311
;;
 Lines 313-319   Common_Path: Link Here 
313
{ .mfi
313
{ .mfi
314
      nop.m     0
314
      nop.m     0
315
(p11) fclass.m.unc p6, p0   = f8, 0x07              // Test for x=0 (for cotf)
315
(p11) fclass.m.unc p6, p0   = f8, 0x07              // Test for x=0 (for cotf)
316
      nop.i     0
316
      mov GR_Parameter_Tag  = 227                   // (cotf)
317
}
317
}
318
{ .mfb
318
{ .mfb
319
      nop.m     0
319
      nop.m     0
(-)a/sysdeps/ia64/fpu/s_tanl.S (-5 / +16 lines)
 Lines 3072-3092   TANL_UNSUPPORTED: Link Here 
3072
3072
3073
{ .mfi
3073
{ .mfi
3074
      nop.m 999
3074
      nop.m 999
3075
(p6)  fclass.m p6, p7 = f8, 0x7         // Test for zero (cotl only)
3075
(p6)  fclass.m.unc p6, p0 = f8, 0x7     // Test for zero (cotl only)
3076
      nop.i 999
3077
}
3078
;;
3079
{ .mfi
3080
      nop.m 999
3081
(p7)  fclass.m.unc p7, p0 = f8, 0x23    // Test for inf (tanl only)
3076
      nop.i 999
3082
      nop.i 999
3077
}
3083
}
3078
;;
3084
;;
3079
3085
3080
.pred.rel "mutex", p6, p7
3086
.pred.rel "mutex", p6, p7
3081
{ .mfi
3087
{ .mfb
3082
(p6)  mov GR_Parameter_Tag = 225        // (cotl)
3088
(p6)  mov GR_Parameter_Tag = 225        // (cotl)
3083
(p6)  frcpa.s0  f8, p0 = f1, f8         // cotl(+-0) = +-Inf
3089
(p6)  frcpa.s0  f8, p0 = f1, f8         // cotl(+-0) = +-Inf
3084
      nop.i 999
3090
(p6)  br.cond.spnt __libm_error_region;;
3091
}
3092
{ .mfb
3093
(p7)  mov GR_Parameter_Tag = 282        // (tanl)
3094
      fmpy.s0 f8 = f8, f0
3095
(p7)  br.cond.spnt __libm_error_region;;
3085
}
3096
}
3086
{ .mfb
3097
{ .mfb
3087
      nop.m 999
3098
      nop.m 999
3088
(p7)  fmpy.s0 f8 = f8, f0
3099
      nop.f 999
3089
(p7)  br.ret.sptk b0
3100
      br.ret.sptk b0
3090
}
3101
}
3091
;;
3102
;;
3092
3103

Return to bug 10163