Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/LD/sinl.c
          +++ new/usr/src/lib/libm/common/LD/sinl.c
↓ open down ↓ 64 lines elided ↑ open up ↑
  65   65  #include "libm.h"
  66   66  #include "libm_synonyms.h"
  67   67  #include "longdouble.h"
  68   68  
  69   69  #include <sys/isa_defs.h>
  70   70  
  71   71  long double
  72   72  sinl(long double x) {
  73   73          long double y[2], z = 0.0L;
  74   74          int n, ix;
  75      -#if defined(_LITTLE_ENDIAN)
       75 +#if defined(__i386) || defined(__amd64)
  76   76          int *px = (int *) &x;
  77   77  #endif
  78   78  
  79   79          /* sin(Inf or NaN) is NaN */
  80   80          if (!finitel(x))
  81   81                  return x - x;
  82   82  
  83   83          /* High word of x. */
  84      -#if defined(_BIG_ENDIAN)
  85      -        ix = *(int *) &x;
  86      -#else
       84 +#if defined(__i386) || defined(__amd64)
  87   85          XTOI(px, ix);
       86 +#else
       87 +        ix = *(int *) &x;
  88   88  #endif
  89   89          /* |x| ~< pi/4 */
  90   90          ix &= 0x7fffffff;
  91      -        if (ix <= 0x3ffe9220) {
       91 +        if (ix <= 0x3ffe9220)
  92   92                  return __k_sinl(x, z);
  93      -        }
  94   93  
  95   94          /* argument reduction needed */
  96   95          else {
  97   96                  n = __rem_pio2l(x, y);
  98   97                  switch (n & 3) {
  99   98                  case 0:
 100   99                          return __k_sinl(y[0], y[1]);
 101  100                  case 1:
 102  101                          return __k_cosl(y[0], y[1]);
 103  102                  case 2:
 104  103                          return -__k_sinl(y[0], y[1]);
 105  104                  case 3:
 106  105                          return -__k_cosl(y[0], y[1]);
 107  106                  /* NOTREACHED */
 108  107                  }
 109  108          }
 110      -    return 0.0L;
      109 +        return 0.0L;
 111  110  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX