------- Comment #9 from ghazi at gcc dot gnu dot org 2008-04-15 00:38 ------- (In reply to comment #7) > Possible the > (isgreater(fabs(x), DBL_MAX) ? (signbit(x) ? -1 : 1) : 0) > will be fast with common finite numbers?
Yes, it seems to be slightly faster (~5%), but you get larger code generated. I think the best thing would be to find a way to fold "if (isinf(x))" to the boolean version and other uses could remain as the sign dependent one. > Question: in case of AVR target, is it possible to call extern > isinf() function regardless of language dialect? Inline code is > very undesirable with small memory. > Thanks. Yes, you can override the middle-end builtins using your own or delete them altogether. See config/pa/pa.c:pa_init_builtins(). If you want an extern isinf, you'll need some magic in the header file to define a macro based on the type size. The nice thing about gcc's type-generic builtins is that you can define isinf(x) to __builtin_isinf(x) and it'll work for all three types: float, double or long double. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35509