Print this page
11210 libm should be cstyle(1ONBLD) clean

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/sparc/src/libm_inlines.h
          +++ new/usr/src/lib/libm/sparc/src/libm_inlines.h
↓ open down ↓ 26 lines elided ↑ open up ↑
  27   27  /*
  28   28   * Copyright 2011, Richard Lowe.
  29   29   */
  30   30  
  31   31  /* Functions in this file are duplicated in locallibm.il.  Keep them in sync */
  32   32  
  33   33  #ifndef _LIBM_INLINES_H
  34   34  #define _LIBM_INLINES_H
  35   35  
  36   36  #ifdef __GNUC__
  37      -
  38   37  #include <sys/types.h>
  39   38  #include <sys/ieeefp.h>
  40   39  
  41   40  #ifdef __cplusplus
  42   41  extern "C" {
  43   42  #endif
  44   43  
  45   44  extern __GNU_INLINE double
  46   45  __inline_sqrt(double d)
  47   46  {
↓ open down ↓ 65 lines elided ↑ open up ↑
 113  112  #define _HI_WORD(x)     ((uint32_t *)&x)[0]
 114  113  #define _LO_WORD(x)     ((uint32_t *)&x)[1]
 115  114  
 116  115  extern __GNU_INLINE enum fp_class_type
 117  116  fp_class(double d)
 118  117  {
 119  118          enum fp_class_type ret;
 120  119          uint32_t tmp;
 121  120  
 122  121          __asm__ __volatile__(
 123      -            "sethi %%hi(0x80000000),%1\n\t"     /* %1 gets 80000000 */
 124      -            "andn  %2,%1,%0\n\t"                /* %2-%0 gets abs(x) */
 125      -            "orcc  %0,%3,%%g0\n\t"              /* set cc as x is zero/nonzero */
 126      -            "bne   1f\n\t"                      /* branch if x is nonzero */
      122 +            "sethi %%hi(0x80000000),%1\n\t" /* %1 gets 80000000 */
      123 +            "andn  %2,%1,%0\n\t"            /* %2-%0 gets abs(x) */
      124 +            "orcc  %0,%3,%%g0\n\t"          /* set cc as x is zero/nonzero */
      125 +            "bne   1f\n\t"                  /* branch if x is nonzero */
 127  126              "nop\n\t"
 128  127              "mov   0,%0\n\t"
 129      -            "ba    2f\n\t"                      /* x is 0 */
      128 +            "ba    2f\n\t"      /* x is 0 */
 130  129              "nop\n\t"
 131  130              "1:\n\t"
 132      -            "sethi %%hi(0x7ff00000),%1\n\t"     /* %1 gets 7ff00000 */
 133      -            "andcc %0,%1,%%g0\n\t"              /* cc set by __exp field of x */
 134      -            "bne   1f\n\t"                      /* branch if normal or max __exp */
      131 +            "sethi %%hi(0x7ff00000),%1\n\t" /* %1 gets 7ff00000 */
      132 +            "andcc %0,%1,%%g0\n\t"          /* cc set by __exp field of x */
      133 +            "bne   1f\n\t"      /* branch if normal or max __exp */
 135  134              "nop\n\t"
 136  135              "mov   1,%0\n\t"
 137      -            "ba    2f\n\t"                      /* x is subnormal */
      136 +            "ba    2f\n\t"      /* x is subnormal */
 138  137              "nop\n\t"
 139  138              "1:\n\t"
 140  139              "cmp   %0,%1\n\t"
 141      -            "bge   1f\n\t"                      /* branch if x is max __exp */
      140 +            "bge   1f\n\t"      /* branch if x is max __exp */
 142  141              "nop\n\t"
 143  142              "mov   2,%0\n\t"
 144      -            "ba    2f\n\t"                      /* x is normal */
      143 +            "ba    2f\n\t"      /* x is normal */
 145  144              "nop\n\t"
 146  145              "1:\n\t"
 147      -            "andn  %0,%1,%0\n\t"                /* o0 gets msw __significand field */
 148      -            "orcc  %0,%3,%%g0\n\t"              /* set cc by OR __significand */
 149      -            "bne   1f\n\t"                      /* Branch if __nan */
      146 +            "andn  %0,%1,%0\n\t"   /* o0 gets msw __significand field */
      147 +            "orcc  %0,%3,%%g0\n\t" /* set cc by OR __significand */
      148 +            "bne   1f\n\t"         /* Branch if __nan */
 150  149              "nop\n\t"
 151  150              "mov   3,%0\n\t"
 152      -            "ba    2f\n\t"                      /* x is __infinity */
      151 +            "ba    2f\n\t"      /* x is __infinity */
 153  152              "nop\n\t"
 154  153              "1:\n\t"
 155  154              "sethi %%hi(0x00080000),%1\n\t"
 156      -            "andcc %0,%1,%%g0\n\t"              /* set cc by quiet/sig bit */
 157      -            "be    1f\n\t"                      /* Branch if signaling */
      155 +            "andcc %0,%1,%%g0\n\t" /* set cc by quiet/sig bit */
      156 +            "be    1f\n\t"         /* Branch if signaling */
 158  157              "nop\n\t"
 159      -            "mov   4,%0\n\t"                    /* x is quiet NaN */
      158 +            "mov   4,%0\n\t"    /* x is quiet NaN */
 160  159              "ba    2f\n\t"
 161  160              "nop\n\t"
 162  161              "1:\n\t"
 163      -            "mov   5,%0\n\t"                    /* x is signaling NaN */
      162 +            "mov   5,%0\n\t"    /* x is signaling NaN */
 164  163              "2:\n\t"
 165  164              : "=&r" (ret), "=&r" (tmp)
 166  165              : "r" (_HI_WORD(d)), "r" (_LO_WORD(d))
 167  166              : "cc");
 168  167  
 169  168          return (ret);
 170  169  }
 171  170  
 172  171  extern __GNU_INLINE int
 173  172  __swapEX(int i)
↓ open down ↓ 65 lines elided ↑ open up ↑
 239  238  __swapTE(int i)
 240  239  {
 241  240          int ret;
 242  241          uint32_t fsr, tmp1, tmp2;
 243  242  
 244  243          __asm__ __volatile__(
 245  244              "and  %4,0x1f,%0\n\t"
 246  245              "sll  %0,23,%2\n\t"         /* shift input to TEM bit location */
 247  246              ".volatile\n\t"
 248  247              "st   %%fsr,%1\n\t"
 249      -            "ld   %1,%0\n\t"            /* %0 = fsr */
 250      -            "set  0x0f800000,%3\n\t"    /* mask of TEM (Trap Enable Mode bits) */
      248 +            "ld   %1,%0\n\t"    /* %0 = fsr */
      249 +            "set  0x0f800000,%3\n\t" /* mask of TEM (Trap Enable Mode bits) */
 251  250              "andn %0,%3,%3\n\t"
 252  251              "or   %2,%3,%2\n\t"         /* %2 = new fsr */
 253  252              "st   %2,%1\n\t"
 254  253              "ld   %1,%%fsr\n\t"
 255  254              "srl  %0,23,%0\n\t"
 256  255              "and  %0,0x1f,%0\n\t"
 257  256              ".nonvolatile\n\t"
 258  257              : "=r" (ret), "=m" (fsr), "=r" (tmp1), "=r" (tmp2)
 259  258              : "r" (i)
 260  259              : "cc");
↓ open down ↓ 27 lines elided ↑ open up ↑
 288  287  {
 289  288          float ret;
 290  289  
 291  290          __asm__ __volatile__("fabss %1,%0\n\t" : "=f" (ret) : "f" (f));
 292  291          return (ret);
 293  292  }
 294  293  
 295  294  #ifdef __cplusplus
 296  295  }
 297  296  #endif
 298      -
 299  297  #endif  /* __GNUC */
 300      -
 301  298  #endif /* _LIBM_INLINES_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX