Builtins for all the other floating-point classification macros are already implemented and it would be nice to complete the set with __builtin_fpclassify (could be certainly exploited in libstdc++, also)
Confirmed.
Subject: Re: New: Missing __builtin_fpclassify As previously discussed, this builtin would either need to be used in the form #define fpclassify(x) __builtin_fpclassify(FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, (x)) or would need GCC to be configured with target-specific information about FP_*, since the values of the FP_* macros are not standardized.
(In reply to comment #2) > As previously discussed, Didn't know about that. If you have a pointer, I would like to read the thread. this builtin would either need to be used in the > form > > #define fpclassify(x) __builtin_fpclassify(FP_INFINITE, FP_NAN, FP_NORMAL, > FP_SUBNORMAL, FP_ZERO, (x)) In my opinion, this would be already a nice improvement. > or would need GCC to be configured with target-specific information about > FP_*, since the values of the FP_* macros are not standardized. I see. At the moment, I'm not able to understand whether that is a major / controversial change... I would appreciate some additional details, if possible. Thanks.
Subject: Re: Missing __builtin_fpclassify On Tue, 27 Nov 2007, pcarlini at suse dot de wrote: > > As previously discussed, > > Didn't know about that. If you have a pointer, I would like to read the thread. http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02210.html
Implemented here: 2008-05-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * builtin-types.def (BT_FN_INT_INT_INT_INT_INT_INT_VAR): New. * builtins.c (fold_builtin_fpclassify): New. (fold_builtin_varargs): Handle BUILT_IN_FPCLASSIFY. * builtins.def (BUILT_IN_FPCLASSIFY): New. * c-common.c (handle_type_generic_attribute): Adjust to accept fixed arguments before an elipsis. (check_builtin_function_arguments): Handle BUILT_IN_FPCLASSIFY. * doc/extend.texi: Document __builtin_fpclassify.