[libcxx] use __builtin_isnan in std::isnan.

Summary: This allows std::isnan to be fully inlined, instead of generating calls.

Reviewers: EricWF

Reviewed By: EricWF

Subscribers: christof, ldionne

Differential Revision: https://reviews.llvm.org/D69806
This commit is contained in:
Ilya Tokar 2019-11-15 12:29:02 -05:00
parent 3bc71193bd
commit 767eadd782
1 changed files with 4 additions and 0 deletions

View File

@ -510,7 +510,11 @@ _LIBCPP_INLINE_VISIBILITY
bool bool
__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT __libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
{ {
#if __has_builtin(__builtin_isnan)
return __builtin_isnan(__lcpp_x);
#else
return isnan(__lcpp_x); return isnan(__lcpp_x);
#endif
} }
#undef isnan #undef isnan