graphene icon indicating copy to clipboard operation
graphene copied to clipboard

Don't use obsolete isinff and isnanf functions

Open lantw44 opened this issue 4 years ago • 2 comments

GNU libc already marks isinff and isnanf functions as obsolete. They have been replaced by isinf and isnan macros defined by C99. Since we already requires C99 in this project, it should be nice if we can switch to standard macros.

Proposed changes:

  • Drop the use of non-standard and obsolete isinff and isnanf functions.

Benchmark results:

  • None

Test suite changes:

  • None

lantw44 avatar Dec 01 '19 12:12 lantw44

It currently fails with GCC __builtin_isinf when -O1 or higher is used. I haven't found out why it fails. It works with Clang __builtin_isinf and FreeBSD libc. GNU libc just defines isinf as __builtin_isinf.

lantw44 avatar Dec 01 '19 12:12 lantw44

I initially used isinf() and isnan(), but those ended up breaking when using GCC because it tried to promote floats to doubles, and the results wouldn't match any more—especially when using GCC vectorisation.

It could very well be a bug in GCC.

ebassi avatar Dec 03 '19 19:12 ebassi