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

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/C/libm.h
          +++ new/usr/src/lib/libm/common/C/libm.h
↓ open down ↓ 19 lines elided ↑ open up ↑
  20   20   */
  21   21  /*
  22   22   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  23   23   */
  24   24  /*
  25   25   * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  26   26   * Use is subject to license terms.
  27   27   */
  28   28  
  29   29  #ifndef _LIBM_H
  30      -#define _LIBM_H
       30 +#define         _LIBM_H
  31   31  
  32   32  #include <sys/isa_defs.h>
  33   33  
  34   34  #ifdef _ASM
  35   35  /* BEGIN CSTYLED */
  36   36  
  37   37  /*
  38   38   * Disable amd64 assembly code profiling for now.
  39   39   */
  40   40  #if defined(__amd64)
  41   41  #undef PROF
  42   42  #endif
  43   43  
  44   44  #include <sys/asm_linkage.h>
  45   45  
  46      -#define NAME(x) x
  47      -#define TEXT    .section        ".text"
  48      -#define DATA    .section        ".data"
  49      -#define RO_DATA .section        ".rodata"
  50      -#define IDENT(x)        .ident  x
       46 +#define         NAME(x) x
       47 +#define         TEXT    .section        ".text"
       48 +#define         DATA    .section        ".data"
       49 +#define         RO_DATA .section        ".rodata"
       50 +#define         IDENT(x)        .ident  x
  51   51  
  52   52  #if defined(__sparc)
  53      -
  54      -#define LIBM_ANSI_PRAGMA_WEAK(sym,stype) \
       53 +#define         LIBM_ANSI_PRAGMA_WEAK(sym,stype) \
  55   54          .weak __/**/sym;                 \
  56   55          .type __/**/sym,#stype;          \
  57   56  __/**/sym       = sym
  58   57  
  59   58  #ifndef SET_FILE
  60      -#define SET_FILE(x) \
       59 +#define         SET_FILE(x) \
  61   60          .file   x
  62   61  #endif  /* !defined(SET_FILE) */
  63   62  
  64   63  #ifdef PIC
  65   64  /*
  66   65   * One should *never* pass o7 to PIC_SETUP.
  67   66   */
  68      -#define PIC_SETUP(via) \
       67 +#define         PIC_SETUP(via) \
  69   68  9:      call    8f; \
  70   69          sethi   %hi(NAME(_GLOBAL_OFFSET_TABLE_)-(9b-.)),%via; \
  71   70  8:      or      %via,%lo(NAME(_GLOBAL_OFFSET_TABLE_)-(9b-.)),%via; \
  72   71          add     %via,%o7,%via
  73   72  /*
  74   73   * Must save/restore %o7 in leaf routines; may *not* use jmpl!
  75   74   */
  76      -#define PIC_LEAF_SETUP(via) \
       75 +#define         PIC_LEAF_SETUP(via) \
  77   76          or      %g0,%o7,%g1; \
  78   77  9:      call    8f; \
  79   78          sethi   %hi(NAME(_GLOBAL_OFFSET_TABLE_)-(9b-.)),%via; \
  80   79  8:      or      %via,%lo(NAME(_GLOBAL_OFFSET_TABLE_)-(9b-.)),%via; \
  81   80          add     %via,%o7,%via; \
  82   81          or      %g0,%g1,%o7
  83   82  #ifdef __sparcv9
  84      -#define PIC_SET(via,sym,dst)    ldx     [%via+sym],%dst
       83 +#define         PIC_SET(via,sym,dst)    ldx     [%via+sym],%dst
  85   84  #else   /* defined(__sparcv9) */
  86      -#define PIC_SET(via,sym,dst)    ld      [%via+sym],%dst
       85 +#define         PIC_SET(via,sym,dst)    ld      [%via+sym],%dst
  87   86  #endif  /* defined(__sparcv9) */
  88   87  #else   /* defined(PIC) */
  89      -#define PIC_SETUP(via)
  90      -#define PIC_LEAF_SETUP(via)
       88 +#define         PIC_SETUP(via)
       89 +#define         PIC_LEAF_SETUP(via)
  91   90  #ifdef __sparcv9
  92   91  /*
  93   92   * g1 is used as scratch register in V9 mode
  94   93   */
  95      -#define PIC_SET(via,sym,dst)    setx    sym,%g1,%dst
       94 +#define         PIC_SET(via,sym,dst)    setx    sym,%g1,%dst
  96   95  #else   /* defined(__sparcv9) */
  97      -#define PIC_SET(via,sym,dst)    set     sym,%dst
       96 +#define         PIC_SET(via,sym,dst)    set     sym,%dst
  98   97  #endif  /* defined(__sparcv9) */
  99   98  #endif  /* defined(PIC) */
 100   99  
 101  100  /*
 102  101   * Workaround for 4337025: MCOUNT in asm_linkage.h does not support __sparcv9
 103  102   */
 104  103  #if defined(PROF) && defined(__sparcv9)
 105      -
 106  104  #undef MCOUNT_SIZE
 107  105  #undef MCOUNT
 108  106  
 109  107  #if !defined(PIC)
 110      -#define MCOUNT_SIZE     (9*4)   /* 9 instructions */
 111      -#define MCOUNT(x) \
      108 +#define         MCOUNT_SIZE     (9*4)   /* 9 instructions */
      109 +#define         MCOUNT(x) \
 112  110          save    %sp, -SA(MINFRAME), %sp; \
 113  111          sethi   %hh(.L_/**/x/**/1), %o0; \
 114  112          sethi   %lm(.L_/**/x/**/1), %o1; \
 115  113          or      %o0, %hm(.L_/**/x/**/1), %o0; \
 116  114          or      %o1, %lo(.L_/**/x/**/1), %o1; \
 117  115          sllx    %o0, 32, %o0; \
 118  116          call    _mcount; \
 119  117          or      %o0, %o1, %o0; \
 120  118          restore; \
 121  119          .common .L_/**/x/**/1, 8, 8
 122  120  #elif defined(PIC32)
 123      -#define MCOUNT_SIZE     (10*4)  /* 10 instructions */
 124      -#define MCOUNT(x) \
      121 +#define         MCOUNT_SIZE     (10*4)  /* 10 instructions */
      122 +#define         MCOUNT(x) \
 125  123          save    %sp,-SA(MINFRAME),%sp; \
 126  124  1:      call    .+8; \
 127  125          sethi   %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)),%o0; \
 128  126          sethi   %hi(.L_/**/x/**/1),%o1; \
 129  127          add     %o0,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%o0; \
 130  128          add     %o1,%lo(.L_/**/x/**/1),%o1; \
 131  129          add     %o0,%o7,%o0; \
 132  130          call    _mcount; \
 133  131          ldx     [%o0+%o1],%o0; \
 134  132          restore; \
 135  133          .common .L_/**/x/**/1,8,8
 136  134  #else   /* PIC13 */
 137      -#define MCOUNT_SIZE     (8*4)   /* 8 instructions */
 138      -#define MCOUNT(x) \
      135 +#define         MCOUNT_SIZE     (8*4)   /* 8 instructions */
      136 +#define         MCOUNT(x) \
 139  137          save    %sp,-SA(MINFRAME),%sp; \
 140  138  1:      call    .+8; \
 141  139          sethi   %hi(_GLOBAL_OFFSET_TABLE_-(1b-.)),%o0; \
 142  140          add     %o0,%lo(_GLOBAL_OFFSET_TABLE_-(1b-.)),%o0; \
 143  141          add     %o0,%o7,%o0; \
 144  142          call    _mcount; \
 145  143          ldx     [%o0+%lo(.L_/**/x/**/1)],%o0; \
 146  144          restore; \
 147  145          .common .L_/**/x/**/1,8,8
 148  146  #endif  /* !defined(PIC) */
 149  147  #endif /* defined(PROF) && defined(__sparcv9) */
 150      -
 151  148  #elif defined(__x86)
 152      -
 153      -#define LIBM_ANSI_PRAGMA_WEAK(sym,stype) \
      149 +#define         LIBM_ANSI_PRAGMA_WEAK(sym,stype) \
 154  150          .weak __/**/sym;                 \
 155  151          .type __/**/sym,@stype;          \
 156  152  __/**/sym       = sym
 157  153  
 158  154  #ifdef PIC
 159  155  #if defined(__amd64)
 160      -#define PIC_SETUP(x)
 161      -#define PIC_WRAPUP
 162      -#define PIC_F(x)        x@PLT
 163      -#define PIC_G(x)        x@GOTPCREL(%rip)
 164      -#define PIC_L(x)        x(%rip)
 165      -#define PIC_G_LOAD(insn,sym,dst) \
      156 +#define         PIC_SETUP(x)
      157 +#define         PIC_WRAPUP
      158 +#define         PIC_F(x)        x@PLT
      159 +#define         PIC_G(x)        x@GOTPCREL(%rip)
      160 +#define         PIC_L(x)        x(%rip)
      161 +#define         PIC_G_LOAD(insn,sym,dst) \
 166  162          movq    PIC_G(sym),%dst; \
 167  163          insn    (%dst),%dst
 168  164  #else
 169      -#define PIC_SETUP(label) \
      165 +#define         PIC_SETUP(label) \
 170  166          pushl   %ebx; \
 171  167          call    .label; \
 172  168  .label: popl    %ebx; \
 173  169          addl    $_GLOBAL_OFFSET_TABLE_+[.-.label],%ebx
 174      -#define PIC_WRAPUP      popl    %ebx
 175      -#define PIC_F(x)        x@PLT
 176      -#define PIC_G(x)        x@GOT(%ebx)
 177      -#define PIC_L(x)        x@GOTOFF(%ebx)
 178      -#define PIC_G_LOAD(insn,sym,dst) \
      170 +#define         PIC_WRAPUP      popl    %ebx
      171 +#define         PIC_F(x)        x@PLT
      172 +#define         PIC_G(x)        x@GOT(%ebx)
      173 +#define         PIC_L(x)        x@GOTOFF(%ebx)
      174 +#define         PIC_G_LOAD(insn,sym,dst) \
 179  175          mov     PIC_G(sym),%dst; \
 180  176          insn    (%dst),%dst
 181  177  #endif
 182  178  #else   /* defined(PIC) */
 183      -#define PIC_SETUP(x)
 184      -#define PIC_WRAPUP
 185      -#define PIC_F(x)        x
 186      -#define PIC_G(x)        x
 187      -#define PIC_L(x)        x
 188      -#define PIC_G_LOAD(insn,sym,dst)        insn    sym,%dst
      179 +#define         PIC_SETUP(x)
      180 +#define         PIC_WRAPUP
      181 +#define         PIC_F(x)        x
      182 +#define         PIC_G(x)        x
      183 +#define         PIC_L(x)        x
      184 +#define         PIC_G_LOAD(insn,sym,dst)        insn    sym,%dst
 189  185  #endif  /* defined(PIC) */
 190      -
 191  186  #else
 192  187  #error Unknown architecture
 193  188  #endif
 194  189  
 195  190  /* END CSTYLED */
 196  191  #else   /* defined(_ASM) */
 197      -
 198  192  #include "libm_macros.h"
 199  193  #include "libm_protos.h"
 200  194  #include "libm_inlines.h"
 201  195  #include <math.h>
 202  196  #if defined(__SUNPRO_C)
 203  197  #include <sunmath.h>
 204  198  #endif
 205      -
 206  199  #endif  /* defined(_ASM) */
 207      -
 208  200  #endif  /* _LIBM_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX