Back to index

glibc  2.9
Defines | Functions
sfp-machine.h File Reference
#include <fpu_control.h>
#include <fenv.h>
#include <stdlib.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define _FP_W_TYPE_SIZE   64
#define _FP_W_TYPE   unsigned long
#define _FP_WS_TYPE   signed long
#define _FP_I_TYPE   long
#define _FP_MUL_MEAT_SET_FE_TZ
#define _FP_MUL_MEAT_RESET_FE   _FPU_SETCW(_fcw)
#define _FP_MUL_MEAT_S(R, X, Y)   _FP_MUL_MEAT_1_imm(_FP_WFRACBITS_S,R,X,Y)
#define _FP_MUL_MEAT_D(R, X, Y)   _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
#define _FP_MUL_MEAT_Q(R, X, Y)
#define _FP_DIV_MEAT_S(R, X, Y)   _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
#define _FP_DIV_MEAT_D(R, X, Y)   _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y)
#define _FP_DIV_MEAT_Q(R, X, Y)   _FP_DIV_MEAT_2_udiv(Q,R,X,Y)
#define _FP_NANFRAC_S   ((_FP_QNANBIT_S << 1) - 1)
#define _FP_NANFRAC_D   ((_FP_QNANBIT_D << 1) - 1)
#define _FP_NANFRAC_Q   ((_FP_QNANBIT_Q << 1) - 1), -1
#define _FP_NANSIGN_S   0
#define _FP_NANSIGN_D   0
#define _FP_NANSIGN_Q   0
#define _FP_KEEPNANFRACP   1
#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)
#define FP_ROUNDMODE   ((_fcw >> 30) & 0x3)
#define FP_EX_INVALID   (1 << 4)
#define FP_EX_OVERFLOW   (1 << 3)
#define FP_EX_UNDERFLOW   (1 << 2)
#define FP_EX_DIVZERO   (1 << 1)
#define FP_EX_INEXACT   (1 << 0)
#define _FP_DECL_EX   fpu_control_t _fcw
#define FP_INIT_ROUNDMODE
#define FP_INHIBIT_RESULTS   ((_fcw >> 23) & _fex)
#define FP_HANDLE_EXCEPTIONS
#define QP_HANDLE_EXCEPTIONS(_a)
#define QP_NO_EXCEPTIONS
#define QP_CLOBBER   "memory", "f52", "f54", "f56", "f58", "f60", "f62"
#define QP_CLOBBER_CC   QP_CLOBBER , "cc"

Functions

double __Qp_handle_exceptions (int exc)

Define Documentation

#define _FP_CHOOSENAN (   fs,
  wc,
  R,
  X,
  Y,
  OP 
)
Value:
do {                                                    \
    if ((_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)         \
       && !(_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs))     \
      {                                                        \
       R##_s = X##_s;                                          \
       _FP_FRAC_COPY_##wc(R,X);                         \
      }                                                        \
    else                                                \
      {                                                        \
       R##_s = Y##_s;                                          \
       _FP_FRAC_COPY_##wc(R,Y);                         \
      }                                                        \
    R##_c = FP_CLS_NAN;                                        \
  } while (0)

Definition at line 68 of file sfp-machine.h.

#define _FP_DECL_EX   fpu_control_t _fcw

Definition at line 96 of file sfp-machine.h.

#define _FP_DIV_MEAT_D (   R,
  X,
  Y 
)    _FP_DIV_MEAT_1_udiv_norm(D,R,X,Y)

Definition at line 53 of file sfp-machine.h.

#define _FP_DIV_MEAT_Q (   R,
  X,
  Y 
)    _FP_DIV_MEAT_2_udiv(Q,R,X,Y)

Definition at line 54 of file sfp-machine.h.

#define _FP_DIV_MEAT_S (   R,
  X,
  Y 
)    _FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)

Definition at line 52 of file sfp-machine.h.

#define _FP_I_TYPE   long

Definition at line 31 of file sfp-machine.h.

#define _FP_KEEPNANFRACP   1

Definition at line 63 of file sfp-machine.h.

#define _FP_MUL_MEAT_D (   R,
  X,
  Y 
)    _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)

Definition at line 45 of file sfp-machine.h.

#define _FP_MUL_MEAT_Q (   R,
  X,
  Y 
)
#define _FP_MUL_MEAT_RESET_FE   _FPU_SETCW(_fcw)

Definition at line 40 of file sfp-machine.h.

#define _FP_MUL_MEAT_S (   R,
  X,
  Y 
)    _FP_MUL_MEAT_1_imm(_FP_WFRACBITS_S,R,X,Y)

Definition at line 43 of file sfp-machine.h.

Value:
do {                                                    \
  static fpu_control_t _fetz = _FPU_RC_DOWN;                   \
  _FPU_SETCW(_fetz);                                    \
} while (0)

Definition at line 34 of file sfp-machine.h.

#define _FP_NANFRAC_D   ((_FP_QNANBIT_D << 1) - 1)

Definition at line 57 of file sfp-machine.h.

#define _FP_NANFRAC_Q   ((_FP_QNANBIT_Q << 1) - 1), -1

Definition at line 58 of file sfp-machine.h.

#define _FP_NANFRAC_S   ((_FP_QNANBIT_S << 1) - 1)

Definition at line 56 of file sfp-machine.h.

#define _FP_NANSIGN_D   0

Definition at line 60 of file sfp-machine.h.

#define _FP_NANSIGN_Q   0

Definition at line 61 of file sfp-machine.h.

#define _FP_NANSIGN_S   0

Definition at line 59 of file sfp-machine.h.

#define _FP_W_TYPE   unsigned long

Definition at line 29 of file sfp-machine.h.

#define _FP_W_TYPE_SIZE   64

Definition at line 28 of file sfp-machine.h.

#define _FP_WS_TYPE   signed long

Definition at line 30 of file sfp-machine.h.

#define FP_EX_DIVZERO   (1 << 1)

Definition at line 93 of file sfp-machine.h.

#define FP_EX_INEXACT   (1 << 0)

Definition at line 94 of file sfp-machine.h.

#define FP_EX_INVALID   (1 << 4)

Definition at line 90 of file sfp-machine.h.

#define FP_EX_OVERFLOW   (1 << 3)

Definition at line 91 of file sfp-machine.h.

#define FP_EX_UNDERFLOW   (1 << 2)

Definition at line 92 of file sfp-machine.h.

Value:
do {                                                    \
  if (!_fex)                                            \
    {                                                   \
      /* This is the common case, so we do it inline.          \
       * We need to clear cexc bits if any.                    \
       */                                               \
      __asm__ __volatile__("\n"                                \
"             fzero %%f62\n"                                          \
"             faddd %%f62, %%f62, %%f62\n"                            \
"             " : : : "f62");                                         \
    }                                                   \
  else                                                  \
    {                                                   \
      __Qp_handle_exceptions (_fex);                           \
    }                                                   \
} while (0)

Definition at line 108 of file sfp-machine.h.

#define FP_INHIBIT_RESULTS   ((_fcw >> 23) & _fex)

Definition at line 103 of file sfp-machine.h.

Value:
do {                                                    \
  _FPU_GETCW(_fcw);                                     \
} while (0)

Definition at line 98 of file sfp-machine.h.

#define FP_ROUNDMODE   ((_fcw >> 30) & 0x3)

Definition at line 86 of file sfp-machine.h.

#define QP_CLOBBER   "memory", "f52", "f54", "f56", "f58", "f60", "f62"

Definition at line 141 of file sfp-machine.h.

#define QP_CLOBBER_CC   QP_CLOBBER , "cc"

Definition at line 142 of file sfp-machine.h.

#define QP_HANDLE_EXCEPTIONS (   _a)
Value:
do {                                                    \
  if ((_fcw >> 23) & _fex)                              \
    {                                                   \
      _a;                                               \
    }                                                   \
  else                                                  \
    {                                                   \
      _fcw = (_fcw & ~0x1fL) | (_fex << 5) | _fex;             \
      _FPU_SETCW(_fcw);                                        \
    }                                                   \
} while (0)

Definition at line 124 of file sfp-machine.h.

Value:
__asm ("fzero %%f62\n"                                  \
"        faddd %%f62, %%f62, %%f62" : : : "f62")

Definition at line 137 of file sfp-machine.h.


Function Documentation

double __Qp_handle_exceptions ( int  exc)

Definition at line 32 of file qp_util.c.

{
  double d, *p = (double *)numbers;
  if (exceptions & FP_EX_INVALID)
    d = p[3]/p[3];
  if (exceptions & FP_EX_OVERFLOW)
    {
      d = p[0] + p[0];
      exceptions &= ~FP_EX_INEXACT;
    }
  if (exceptions & FP_EX_UNDERFLOW)
    {
      if (exceptions & FP_EX_INEXACT)
        {
         d = p[2] * p[2];
         exceptions &= ~FP_EX_INEXACT;
       }
      else
       d = p[1] - p[2];
    }
  if (exceptions & FP_EX_DIVZERO)
    d = 1.0/p[3];
  if (exceptions & FP_EX_INEXACT)
    d = p[0] - p[2];
  return d;
}