linux/include/math-emu/soft-fp.h
<<
>>
Prefs
   1/* Software floating-point emulation.
   2   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
   3   This file is part of the GNU C Library.
   4   Contributed by Richard Henderson (rth@cygnus.com),
   5                  Jakub Jelinek (jj@ultra.linux.cz),
   6                  David S. Miller (davem@redhat.com) and
   7                  Peter Maydell (pmaydell@chiark.greenend.org.uk).
   8
   9   The GNU C Library is free software; you can redistribute it and/or
  10   modify it under the terms of the GNU Library General Public License as
  11   published by the Free Software Foundation; either version 2 of the
  12   License, or (at your option) any later version.
  13
  14   The GNU C Library is distributed in the hope that it will be useful,
  15   but WITHOUT ANY WARRANTY; without even the implied warranty of
  16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  17   Library General Public License for more details.
  18
  19   You should have received a copy of the GNU Library General Public
  20   License along with the GNU C Library; see the file COPYING.LIB.  If
  21   not, write to the Free Software Foundation, Inc.,
  22   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  23
  24#ifndef __MATH_EMU_SOFT_FP_H__
  25#define __MATH_EMU_SOFT_FP_H__
  26
  27#include <asm/sfp-machine.h>
  28
  29/* Allow sfp-machine to have its own byte order definitions. */
  30#ifndef __BYTE_ORDER
  31#include <endian.h>
  32#endif
  33
  34#define _FP_WORKBITS            3
  35#define _FP_WORK_LSB            ((_FP_W_TYPE)1 << 3)
  36#define _FP_WORK_ROUND          ((_FP_W_TYPE)1 << 2)
  37#define _FP_WORK_GUARD          ((_FP_W_TYPE)1 << 1)
  38#define _FP_WORK_STICKY         ((_FP_W_TYPE)1 << 0)
  39
  40#ifndef FP_RND_NEAREST
  41# define FP_RND_NEAREST         0
  42# define FP_RND_ZERO            1
  43# define FP_RND_PINF            2
  44# define FP_RND_MINF            3
  45#ifndef FP_ROUNDMODE
  46# define FP_ROUNDMODE           FP_RND_NEAREST
  47#endif
  48#endif
  49
  50/* By default don't care about exceptions. */
  51#ifndef FP_EX_INVALID
  52#define FP_EX_INVALID           0
  53#endif
  54#ifndef FP_EX_INVALID_SNAN
  55#define FP_EX_INVALID_SNAN      0
  56#endif
  57/* inf - inf */
  58#ifndef FP_EX_INVALID_ISI
  59#define FP_EX_INVALID_ISI       0
  60#endif
  61/* inf / inf */
  62#ifndef FP_EX_INVALID_IDI
  63#define FP_EX_INVALID_IDI       0
  64#endif
  65/* 0 / 0 */
  66#ifndef FP_EX_INVALID_ZDZ
  67#define FP_EX_INVALID_ZDZ       0
  68#endif
  69/* inf * 0 */
  70#ifndef FP_EX_INVALID_IMZ
  71#define FP_EX_INVALID_IMZ       0
  72#endif
  73#ifndef FP_EX_OVERFLOW
  74#define FP_EX_OVERFLOW          0
  75#endif
  76#ifndef FP_EX_UNDERFLOW
  77#define FP_EX_UNDERFLOW         
  78#endif
  79#ifndef FP_EX_DIVZERO
  80#define FP_EX_DIVZERO           0
  81#endif
  82#ifndef FP_EX_INEXACT
  83#define FP_EX_INEXACT           0
  84#endif
  85#ifndef FP_EX_DENORM
  86#define FP_EX_DENORM            0
  87#endif
  88
  89#ifdef _FP_DECL_EX
  90#define FP_DECL_EX                                      \
  91  int _fex = 0;                                         \
  92  _FP_DECL_EX
  93#else
  94#define FP_DECL_EX int _fex = 0
  95#endif
  96  
  97#ifndef FP_INIT_ROUNDMODE
  98#define FP_INIT_ROUNDMODE do {} while (0)
  99#endif
 100
 101#ifndef FP_HANDLE_EXCEPTIONS
 102#define FP_HANDLE_EXCEPTIONS do {} while (0)
  13<03" class="line" name="L1="L60">  ji=>   13<03" class="line" name="L1="L60">  ji=de/math-emu/soft-fp.h#L14" id="L1g License along with the GNU C Library; see="L1="L604102" id="L102" class="line" name="L102"> 102a>   but WI05="L60an>
  51<10a>   MERCHA06="L60W" class="sref">FP_EX_UNDERFLOWath-em     1
 102a>   Librar07="L60W" class="sref">FP_EX_UNDERFLOWath-em     1
  95<10a>
  79<10a>   You sh09="L60L50" id="L50" class="line" name="L50">  50<1/a>   modifyy it 11IMZ" class="sref">FP_EX_INVALIDINHIBinclESUL   3
  50<1/a>   publishE_EXCy the Free Software Foundatimu/. */we .,

  18   Licensse, o1 (at your option) any later v*finitions. */may overridspahisoft- e.g.h#L18" id="L18" class="line" name="L18">  18   1ef="include/math-emu/softt-fp.11 part of the GNU C Library.<* check if someth-emu/soft ncluunmaske.h#L7" id="L7" class="line" name="L7">   71/a>   The GNNU C 1ibrary is distributed in the *oft- inhibide/main such/spaase.h#L18" id="L18" class="line" name="L18">  18   but WIITHOU1 ANY WARRANTY; without even tp.h#L51" id="L51" class="line" name="L51">  51<1/a>   MERCHAANTAB11class="sref">FP_EX_DENORM  INHIBinclESUL   3
  95<1/a>   Librarry Ge11-fp.h#L88" id="L88" class="line" name="L88">  88<1/a>
  19   You shhould11 class="sref">FP_EX_DIVZEROTRAPPINGIONS do {} while (0)
 do19" id="L19" class="line" name="L19">  19   Licen1se al12ass="sref">FP_DECL_EX      TRAPPINGIONS do {} while (0)
 do19" " id="L95" class="line" name="L95">  95<1/a>   not, 1write12-fp.h#L82" id="L82" class="line" name="L82">  82<12a>   Licensee, o1lace -id="L82" class="line" name="L82">  82<12 ji=>   1ef="include/math-emu/sof1t-fp.12 class="sref">FP_EX_INEXACTSETIONS d {} while (0)
 dclasFP_W_TYPE)1 lude/math-emu/soffp.h#L)lude/math-emu/soft-fp.h#L92" id="L92" class="line" name="L92">  92<1/a>#ifnde1f   92<1/a>  97<1/a>
FP_EX_DENORM  UNSETIONS d {} while (0)
 dclasFP_W_TYPE)1 lude/math-emu/soffp.h#L)lude/math-emu/soft-fp.h#L9 id="L92" class="line" name="L92">  92<1/a>  92<1/a>
  29<1/a>/* Allow1 sfp-12ISI" class="sref">FP_EX_INVALIDCURIONS do {} while (0)
 do\
  92<1/a>#ifnde1f   92<1/a>#inclu1de <  92<1/a>FP_HANDLE_CLEARIONS do {} while (0)
 do\
  92<1/a>
_FP_DECL_EX
  95<1/a>#defin1e  10/a>#defin1e _FP_WORK_LSB   lude/_FP_WORK_LSB  92<1/a>
  92<1/a>)1 ="+code=_fex" clX.h#L)l& 15) !=f">_FP_WORK_ROUND          ((  92<1/a>
)1 <FRAC_ADDI
_FP_WORK_LSB          ((  92<1/a>  13<03" class="line" name="L1="L60">/a>#ifnde1f  10/a># defi1ne FP_EX_INVA>   lude/<    1
_FP_WORK_LSB  95<1/a># defi1ne   82<1/a># defi1ne FP_EX_INEXACT<>   lude/<    2
_FP_WORK_LSB  92<1/a># defi1ne   92<1/a>#ifnde1f )1 <FRAC_LOW
  92<1/a>
)1 <FRAC_ADDI
_FP_WORK_LSB        ((  92<1/a>  13<03" class="line" name="L1="L60">/a>
  29<1/a>
FP_EX_INVA>   lude/<    3
_FP_WORK_LSB  92<1/a>/* By de1fault1donsoft href="include/math-emu/soft-fpe/math-emu/soft-fp.h# id="L92" class="line" name="L92">  92<1/a>#ifnde1f )1 <FRAC_LOW
  92<1/a># defi1e )1 <FRAC_ADDI
_FP_WORK_LSB        ((  92<1/a>#endif1
  13<03" class="line" name="L1="L60">/a>#ifnde1f  10/a>#defin1e FP_EX_INV>   lude/3
_FP_WORK_LSB  92<1/a>#endif1
  92<1/a>/* inf -1 inf 157" cl-fp.h#reif __FP_WORK_LSB  92<1/a>
FP_RND_NEAREST d {} while (0)
 dclasFP_W_TYPE)1 /a>           0
  92<1/a>
             92<1/a>#endif1
  92<1/a>#ifnde1class="comment">/* inf /1 inf 161" cl-fp.h#reefaasef">FP_RND_NEAREST
  92<1/a># defi1f )1 <lude/)1 ="+code=_fex" clX.h#L);u/soft-fp.h# id="L92" class="line" name="L92">  92<1/a>#defin1e   92<1/a>#ifnde1
FP_RND_NEAREST
<    1
  92<1/a>#defin1class="comment">/* 0 / 01 */)1 <lude/<    1
)1 ="+code=_fex" clX.h#L);u/soft-fp.h#sof id="L92" class="line" name="L92">  92<1/a>   MERCHANu/so166" cl-fp.h#reefh#break\
  92<1/a>FP_RND_NEAREST
<    2
  92<1/a>
)1 <lude/<    2
)1 ="+code=_fex" clX.h#L);u/soft-fp.h#sof id="L92" class="line" name="L92">  92<1/a>
/* inf *1 0 */169" cl-fp.h#reefh#break\
  92<1/a>#ifnde1f FP_RND_NEAREST
<    3
  92<1/a>#defin1e )1 <lude/<    3
)1 ="+code=_fex" clX.h#L);u/soft-fp.h#sof id="L92" class="line" name="L92">  92<1/a>#endif1
  92<1/a>#defin1f   92<1/a>#ifnde1e   13<03" class="line" name="L1="L60">/a>#endif1
  13<03" class="line" name="L1="L60">/a>FP_EX_DENORM  CLS_h-emAL {} while (0)
  95<1/a>#defin1e FP_EX_UNDERFLOWCLS_    1
  43<1/a>#endif1
FP_INIT_ROUNDCLS_   3
  44<1/a>#ifnde1f FP_EX_INVALIDCLS_h   0
  45<1/a>#defin1e  10/a>#endif1
FP_EX_INVA>   CLS_COMBath3
)1 ude/math-emu/sofxclas)t-fp.h#L37"  | __FP_WORK_LSB  13<03" class="line" name="L1="L60">/a>#ifnde1f   82<1/a>#defin1e endian.h>
  32<1/a>#endif1
endian.h>
  32<1/a>#endif1f endian.h>
  32<1/a>endian.h>
  32<1/a>#defin1
  32<1/a>
  89<1/a>#ifdef1 
  23<1/a>#defin1e FP_DECL_EX   UWlookde/math-emu/sofUWlook" cl-fp.h#reef">FP_RND_NEARES<< 0)
  23<1/a>#endif1FP_EX_INVAmath-e_SIZ0)
FP_RND_NEARES<< 0_SIZ0)
  23<1/a>#ifnde1ref="+code=_FP_DECL_EX" 1class19ace -id="L82" class="line" name="L82">  82<1/a>#else
1 = 0
FP_RND_NEARES&_atl,
)1    0
  32<1/a>#defin1e  = 0
FP_RND_NEARES&_atl,
)1    0
  32<1/a>#endif1
 = 0
FP_RND_NEARES&_atl,
)1    0
  32<1/a> = 0
FP_RND_NEARES&_atl,
)1    0
  32<1/a>#defin1f FP_RND_NEARES<< 0_SIZ0)
  44<1/a>#defin1e  = 0
FP_RND_NEARES&_atl,
)1 H  0
  32<1/a>   You shoEX" 1t-fp.h#Lllah">FP_RND_NEARES<< 0_SIZ0)
  32<20
FP_RND_NEARESUHWlookde/math-emu/sofUHWlook" cl id="L28" class="line" name="L28">  28#ifn2ef   82<22#def2ne   82<2  ji=>   23<03" class="line" name=2L1="L20" class="sref">FP_EX_OVERFLOumul_ppmmde/math-emu/sofumul_ppmmce -id="L82" class="line" name="L82">  82<2 a>#ifndef the GNU C Library; see=2L1="L20-fp.h#lass="lf">endian.h>
  32<22a>   but W205="L20-fp.h#L96" id="L96" class="line" name="L96">  96<20a>   MERCH206="L20L27" id="L27" class="line" name="L27">  27   Libra207="L20-fp.h#L88"  
  23



pe toriginal LXR/span> LXR/ludeunityclas,>ahisoexperie/maal ath-emu/rsid="L23" cmailto:lxr@/maux.no">lxr@/maux.noclas.
lxr./maux.no kindlsihost versid="L23" chttp:/=www.redpill-/mapro.no">Redpill Lmapro ASclas,>provie/maof Lmaux/lun>