This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PR bootstrap/26059 Remove fenv access from libgcc-math


This patch removes the only use of fenv.h from libgcc-math which is in
the expf function.  While (one part of) the use is deliberate - disabling
FP exceptions - the currently very controlled use of libgcc-math (only
via -msselibm switch) makes this change safe enough to warrant quick
restoring of bootstrap on netbsd.  The other part of fenv use is to
set rounding mode to nearest, but as all other parts of libgcc-math assume
round-to-nearest already this extra taking care can be safely removed.

Will commit as obvious after a bootstrap.

Richard.


2006-02-01  Richard Guenther  <rguenther@suse.de>

	* flt-32/e_expf.c: Remove fenv access.

Index: flt-32/e_expf.c
===================================================================
*** flt-32/e_expf.c	(revision 110468)
--- flt-32/e_expf.c	(working copy)
***************
*** 53,59 ****
  #include <float.h>
  #include <ieee754.h>
  #include <math.h>
- #include <fenv.h>
  #include <inttypes.h>
  #include <math_private.h>
  
--- 53,58 ----
*************** __ieee754_expf (float x)
*** 84,95 ****
        double x22, t, result, dx;
        float n, delta;
        union ieee754_double ex2_u;
-       fenv_t oldenv;
- 
-       feholdexcept (&oldenv);
- #ifdef FE_TONEAREST
-       fesetround (FE_TONEAREST);
- #endif
  
        /* Calculate n.  */
        n = x * M_1_LN2 + THREEp22;
--- 83,88 ----
*************** __ieee754_expf (float x)
*** 119,126 ****
        x22 = (0.5000000496709180453 * dx + 1.0000001192102037084) * dx + delta;
  
        /* Return result.  */
-       fesetenv (&oldenv);
- 
        result = x22 * ex2_u.d + ex2_u.d;
        return (float) result;
      }
--- 112,117 ----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]