This is the mail archive of the
mailing list for the GCC project.
Re: IA64 HP-UX __builtin_finite patch (and questions about __builtin_)
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: joseph at codesourcery dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 11 Jan 2007 14:27:58 -0800 (PST)
- Subject: Re: IA64 HP-UX __builtin_finite patch (and questions about __builtin_)
> We should have a proper type-generic __builtin_isfinite function that can
> be used directly to implement the C99 macro (and then the non-type-generic
> __builtin_finite* would fall out from that), that expands inline or calls
> a libgcc function. See bug 20558 for some commentary on the state of
> builtins for such C99 macros.
> Joseph S. Myers
Help me make sure I understand how this would work. It seems like
implementing a type generic __builtin_isfinite function would be fairly
straight forward. It could be expanded into one of several type
specific __builtin_isfinite functions (with unique names) that would
then be expanded into inline code or called.
But then how do we implement the C99 isfinite macro using
__builtin_isfinite? Would we have a fixincludes rule that removes the
standard definition of isfinite from the math.h header file and replaces
#define isfinite(x) __builtin_isfinite(x)
It seems like without a fixincludes rule the compiler will never see
isfinite because it is a macro that gets expanded to something else
(which will vary from system to system) before the compiler gets to it.