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]

Re: [PATCH] middle-end: convert builtin finite -> MINUS/ORD


On Tue, 12 Jun 2007, Jakub Jelinek wrote:

> AFAIK isfinite/isinf/isnan/isnormal/fpclassify/signbit aren't supposed
> to raise exceptions even for signalling NaNs.
> 	Jakub

In libgcc2.c, we have:

/* All of these would be present in a full C99 implementation of <math.h>
   and <complex.h>.  Our problem is that only a few systems have such full
   implementations.  Further, libgcc_s.so isn't currently linked against
   libm.so, and even for systems that do provide full C99, the extra overhead
   of all programs using libgcc having to link against libm.  So avoid it.
*/

#define isnan(x)        __builtin_expect ((x) != (x), 0)
#define isfinite(x)     __builtin_expect (!isnan((x) - (x)), 1)
#define isinf(x)        __builtin_expect (!isnan(x) & !isfinite(x), 0)


So won't these raise exceptions as well?

BTW, the comment about libgcc_s.so not being linked against libm.so seems
to be out of date.

		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu


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