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

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/m9x/fmaxf.c
          +++ new/usr/src/lib/libm/common/m9x/fmaxf.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  24   24   */
       25 +
  25   26  /*
  26   27   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  27   28   * Use is subject to license terms.
  28   29   */
  29   30  
  30   31  #pragma weak fmaxf = __fmaxf
  31   32  
  32   33  /*
  33   34   * fmax(x,y) returns the larger of x and y.  If just one of the
  34   35   * arguments is NaN, fmax returns the other argument.  If both
↓ open down ↓ 28 lines elided ↑ open up ↑
  63   64   * following (on SPARC):
  64   65   *
  65   66   * 1. fmax(x,y) returns the larger of x and y if neither x nor y
  66   67   *    is NaN and the non-NaN argument if just one of x or y is NaN.
  67   68   *    If both x and y are NaN, fmax(x,y) returns x unchanged.
  68   69   * 2. fmax(-0,+0) = fmax(+0,-0) = +0.
  69   70   * 3. If either argument is a signaling NaN, fmax raises the invalid
  70   71   *    operation exception.  Otherwise, it raises no exceptions.
  71   72   */
  72   73  
  73      -#include "libm.h"       /* for isgreaterequal macro */
       74 +#include "libm.h"                       /* for isgreaterequal macro */
  74   75  
  75   76  float
  76      -__fmaxf(float x, float y) {
       77 +__fmaxf(float x, float y)
       78 +{
  77   79          /*
  78   80           * On SPARC v8plus/v9, this could be implemented as follows
  79   81           * (assuming %f0 = x, %f1 = y, return value left in %f0):
  80   82           *
  81   83           * fcmps        %fcc0,%f1,%f1
  82   84           * fmovsu       %fcc0,%f0,%f1
  83   85           * fcmps        %fcc0,%f0,%f1
  84   86           * fmovsul      %fcc0,%f1,%f0
  85   87           * st           %f0,[x]
  86   88           * st           %f1,[y]
↓ open down ↓ 21 lines elided ↑ open up ↑
 108  110           * If VIS 3.0 instructions are available, use this:
 109  111           *
 110  112           * flcmps       %fcc0,%f0,%f1
 111  113           * fmovslg      %fcc0,%f1,%f0   ! move if %fcc0 is 1 or 2
 112  114           */
 113  115  
 114  116          union {
 115  117                  unsigned i;
 116  118                  float f;
 117  119          } xx, yy;
      120 +
 118  121          unsigned s;
 119  122  
 120  123          /* if y is nan, replace it by x */
 121  124          if (y != y)
 122  125                  y = x;
 123  126  
 124  127          /* if x is nan, replace it by y */
 125  128          if (x != x)
 126  129                  x = y;
 127  130  
↓ open down ↓ 14 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX