Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Define math_errhandling is possible.
  • Loading branch information
Ulrich Drepper committed Aug 24, 2009
1 parent ef72d5f commit 7b943af
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,5 +1,9 @@
2009-08-24 Ulrich Drepper <drepper@redhat.com>

* math/math.h: Define math_errhandling of __FAST_MATH__ is not defined.
* sysdeps/i386/fpu/bits/mathinline.h: Undefine math_errhandling if we
are using the inline optimizations.

* sysdeps/x86_64/fpu/bits/mathinline.h (__signbit): Optimize.
(__signbitf): Likewise.

Expand Down
11 changes: 9 additions & 2 deletions math/math.h
@@ -1,5 +1,5 @@
/* Declarations for math functions.
Copyright (C) 1991-1993, 1995-1999, 2001, 2002, 2004, 2006
Copyright (C) 1991-1993, 1995-1999, 2001, 2002, 2004, 2006, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Expand Down Expand Up @@ -101,7 +101,7 @@ __BEGIN_DECLS
&& (!defined __NO_LONG_DOUBLE_MATH || defined __LDBL_COMPAT)
# ifdef __LDBL_COMPAT

# ifdef __USE_ISOC99
# ifdef __USE_ISOC99
extern float __nldbl_nexttowardf (float __x, long double __y)
__THROW __attribute__ ((__const__));
# ifdef __REDIRECT_NTH
Expand Down Expand Up @@ -277,6 +277,13 @@ enum
# define MATH_ERRNO 1 /* errno set by math functions. */
# define MATH_ERREXCEPT 2 /* Exceptions raised by math functions. */

/* By default all functions support both errno and exception handling.
In gcc's fast math mode and if inline functions are defined this
might not be true. */
# ifndef __FAST_MATH__
# define math_errhandling (MATH_ERRNO | MATH_ERREXCEPT)
# endif

#endif /* Use ISO C99. */

#ifdef __USE_MISC
Expand Down
6 changes: 5 additions & 1 deletion sysdeps/i386/fpu/bits/mathinline.h
@@ -1,5 +1,5 @@
/* Inline math functions for i387.
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2003,2004,2006,2007
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2003,2004,2006,2007,2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by John C. Bowman <bowman@math.ualberta.ca>, 1995.
Expand Down Expand Up @@ -153,6 +153,10 @@ __NTH (__signbitl (long double __x))
#if ((!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
&& defined __OPTIMIZE__)

/* The inline functions do not set errno or raise necessarily the
correct exceptions. */
# undef math_errhandling

/* A macro to define float, double, and long double versions of various
math functions for the ix87 FPU. FUNC is the function name (which will
be suffixed with f and l for the float and long double version,
Expand Down

0 comments on commit 7b943af

Please sign in to comment.