Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libmvec/common/__vsin.c
          +++ new/usr/src/lib/libmvec/common/__vsin.c
↓ open down ↓ 20 lines elided ↑ open up ↑
  21   21  
  22   22  /*
  23   23   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  24   24   */
  25   25  /*
  26   26   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  27   27   * Use is subject to license terms.
  28   28   */
  29   29  
  30   30  #include <sys/isa_defs.h>
       31 +#include <sys/ccompile.h>
  31   32  
  32   33  #ifdef _LITTLE_ENDIAN
  33   34  #define HI(x)   *(1+(int*)x)
  34   35  #define LO(x)   *(unsigned*)x
  35   36  #else
  36   37  #define HI(x)   *(int*)x
  37   38  #define LO(x)   *(1+(unsigned*)x)
  38   39  #endif
  39   40  
  40   41  #ifdef __RESTRICT
↓ open down ↓ 30 lines elided ↑ open up ↑
  71   72  /* Don't __ the following; acomp will handle it */
  72   73  extern double fabs( double );
  73   74  extern void __vlibm_vsin_big( int, double *, int, double *, int, int );
  74   75  
  75   76  void
  76   77  __vsin( int n, double * restrict x, int stridex, double * restrict y,
  77   78          int stridey )
  78   79  {
  79   80          double          x0_or_one[4], x1_or_one[4], x2_or_one[4];
  80   81          double          y0_or_zero[4], y1_or_zero[4], y2_or_zero[4];
  81      -        double          x0, x1, x2, *py0, *py1, *py2, *xsave, *ysave;
  82      -        unsigned        hx0, hx1, hx2, xsb0, xsb1, xsb2;
  83      -        int                     i, biguns, nsave, sxsave, sysave;
  84      -
       82 +        double          x0, x1, x2, *py0 = 0, *py1 = 0, *py2, *xsave, *ysave;
       83 +        unsigned        hx0, hx1, hx2, xsb0, xsb1 = 0, xsb2;
       84 +        int             i, biguns, nsave, sxsave, sysave;
  85   85          nsave = n;
  86   86          xsave = x;
  87   87          sxsave = stridex;
  88   88          ysave = y;
  89   89          sysave = stridey;
  90   90          biguns = 0;
  91   91  
  92   92          do
  93   93          {
  94   94  LOOP0:
  95   95                  xsb0 = HI(x);
  96   96                  hx0 = xsb0 & ~0x80000000;
  97   97                  if ( hx0 > 0x3fe921fb )
  98   98                  {
  99   99                          biguns = 1;
 100  100                          goto MEDIUM;
 101  101                  }
 102  102                  if ( hx0 < 0x3e400000 )
 103  103                  {
 104      -                        volatile int v = *x;
 105  104                          *y = *x;
 106  105                          x += stridex;
 107  106                          y += stridey;
 108  107                          i = 0;
 109  108                          if ( --n <= 0 )
 110  109                                  break;
 111  110                          goto LOOP0;
 112  111                  }
 113  112                  x0 = *x;
 114  113                  py0 = y;
↓ open down ↓ 6 lines elided ↑ open up ↑
 121  120  LOOP1:
 122  121                  xsb1 = HI(x);
 123  122                  hx1 = xsb1 & ~0x80000000;
 124  123                  if ( hx1 > 0x3fe921fb )
 125  124                  {
 126  125                          biguns = 2;
 127  126                          goto MEDIUM;
 128  127                  }
 129  128                  if ( hx1 < 0x3e400000 )
 130  129                  {
 131      -                        volatile int v = *x;
 132  130                          *y = *x;
 133  131                          x += stridex;
 134  132                          y += stridey;
 135  133                          i = 1;
 136  134                          if ( --n <= 0 )
 137  135                                  break;
 138  136                          goto LOOP1;
 139  137                  }
 140  138                  x1 = *x;
 141  139                  py1 = y;
↓ open down ↓ 6 lines elided ↑ open up ↑
 148  146  LOOP2:
 149  147                  xsb2 = HI(x);
 150  148                  hx2 = xsb2 & ~0x80000000;
 151  149                  if ( hx2 > 0x3fe921fb )
 152  150                  {
 153  151                          biguns = 3;
 154  152                          goto MEDIUM;
 155  153                  }
 156  154                  if ( hx2 < 0x3e400000 )
 157  155                  {
 158      -                        volatile int v = *x;
 159  156                          *y = *x;
 160  157                          x += stridex;
 161  158                          y += stridey;
 162  159                          i = 2;
 163  160                          if ( --n <= 0 )
 164  161                                  break;
 165  162                          goto LOOP2;
 166  163                  }
 167  164                  x2 = *x;
 168  165                  py2 = y;
↓ open down ↓ 334 lines elided ↑ open up ↑
 503  500                  xsb0 = xsb0 >> 31;
 504  501                  biguns = 0;
 505  502                  goto loop1;
 506  503          }
 507  504          biguns = 0;
 508  505  
 509  506          do
 510  507          {
 511  508                  double          fn0, fn1, fn2, a0, a1, a2, w0, w1, w2, y0, y1, y2;
 512  509                  unsigned        hx;
 513      -                int                     n0, n1, n2;
      510 +                int             n0, n1, n2;
 514  511  
 515  512  loop0:
 516  513                  hx = HI(x);
 517  514                  xsb0 = hx >> 31;
 518  515                  hx &= ~0x80000000;
 519  516                  if ( hx < 0x3e400000 )
 520  517                  {
 521      -                        volatile int v = *x;
 522  518                          *y = *x;
 523  519                          x += stridex;
 524  520                          y += stridey;
 525  521                          i = 0;
 526  522                          if ( --n <= 0 )
 527  523                                  break;
 528  524                          goto loop0;
 529  525                  }
 530  526                  if ( hx > 0x413921fb )
 531  527                  {
↓ open down ↓ 18 lines elided ↑ open up ↑
 550  546                  i = 1;
 551  547                  if ( --n <= 0 )
 552  548                          break;
 553  549  
 554  550  loop1:
 555  551                  hx = HI(x);
 556  552                  xsb1 = hx >> 31;
 557  553                  hx &= ~0x80000000;
 558  554                  if ( hx < 0x3e400000 )
 559  555                  {
 560      -                        volatile int v = *x;
 561  556                          *y = *x;
 562  557                          x += stridex;
 563  558                          y += stridey;
 564  559                          i = 1;
 565  560                          if ( --n <= 0 )
 566  561                                  break;
 567  562                          goto loop1;
 568  563                  }
 569  564                  if ( hx > 0x413921fb )
 570  565                  {
↓ open down ↓ 18 lines elided ↑ open up ↑
 589  584                  i = 2;
 590  585                  if ( --n <= 0 )
 591  586                          break;
 592  587  
 593  588  loop2:
 594  589                  hx = HI(x);
 595  590                  xsb2 = hx >> 31;
 596  591                  hx &= ~0x80000000;
 597  592                  if ( hx < 0x3e400000 )
 598  593                  {
 599      -                        volatile int v = *x;
 600  594                          *y = *x;
 601  595                          x += stridex;
 602  596                          y += stridey;
 603  597                          i = 2;
 604  598                          if ( --n <= 0 )
 605  599                                  break;
 606  600                          goto loop2;
 607  601                  }
 608  602                  if ( hx > 0x413921fb )
 609  603                  {
↓ open down ↓ 498 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX