This is the mail archive of the 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: 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
it with

	#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.

Steve Ellcey

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