Print this page
5632 libm's use of _sse_hw is wrong and unnecessary (in that order)

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/common/m9x/__fex_i386.c
          +++ new/usr/src/lib/libm/common/m9x/__fex_i386.c
↓ open down ↓ 42 lines elided ↑ open up ↑
  43   43  #include "fex_handler.h"
  44   44  #include "fenv_inlines.h"
  45   45  
  46   46  #if defined(__amd64)
  47   47  #define test_sse_hw     1
  48   48  #else
  49   49  /*
  50   50   * The following variable lives in libc on Solaris 10, where it
  51   51   * gets set to a nonzero value at startup time on systems with SSE.
  52   52   */
  53      -int _sse_hw = 0;
  54      -#pragma weak _sse_hw
  55      -#define test_sse_hw     &_sse_hw && _sse_hw
       53 +extern int _sse_hw;
       54 +#define test_sse_hw     _sse_hw
  56   55  #endif
  57   56  
  58   57  static int accrued = 0;
  59   58  static thread_key_t accrued_key;
  60   59  static mutex_t accrued_key_lock = DEFAULTMUTEX;
  61   60  
  62   61  int *
  63   62  __fex_accrued()
  64   63  {
  65   64          int             *p;
↓ open down ↓ 143 lines elided ↑ open up ↑
 209  208  }
 210  209  
 211  210  static enum fp_class_type
 212  211  my_fp_classl(long double *x)
 213  212  {
 214  213          int             i = *(2+(int*)x) & 0x7fff;
 215  214  
 216  215          if (i < 0x7fff) {
 217  216                  if (i < 1) {
 218  217                          if (*(1+(int*)x) < 0) return fp_normal; /* pseudo-denormal */
 219      -                        return (((*(1+(int*)x) | *(int*)x) == 0)?       
      218 +                        return (((*(1+(int*)x) | *(int*)x) == 0)?
 220  219                                  fp_zero : fp_subnormal);
 221  220                  }
 222  221                  return ((*(1+(int*)x) < 0)? fp_normal :
 223  222                          (enum fp_class_type) -1); /* unsupported format */
 224  223          }
 225  224          else if (*(1+(int*)x) == 0x80000000 && *(int*)x == 0)
 226  225                  return fp_infinity;
 227  226          else if (*(1+(unsigned*)x) >= 0xc0000000)
 228  227                  return fp_quiet;
 229  228          else if (*(1+(int*)x) < 0)
↓ open down ↓ 1463 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX