[clang] [clang] Add __builtin_isnanf and __builtin_isnanl (PR #218004)

Joshua Cranmer via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 31 13:57:45 PDT 2026


jcranmer-intel wrote:

> the actual high-level goal here (from my "i'm just the libc maintainer" perspective) was "clang should automatically replace calls to isnanf() with an instruction or two, like it already does with isnan()".

I think `#define isnanf(x) __builtin_isnan((float)(x))` should do the trick. The existing `__builtin_isnan` macro already supports all of the floating-point types; all you need to do is to add a cast to ensure that the argument is of the intended type.

https://github.com/llvm/llvm-project/pull/218004


More information about the cfe-commits mailing list