Skip to content

Commit 767eadd

Browse files
committed
[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
1 parent 3bc7119 commit 767eadd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libcxx/include/math.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,11 @@ _LIBCPP_INLINE_VISIBILITY
510510
bool
511511
__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
512512
{
513+
#if __has_builtin(__builtin_isnan)
514+
return __builtin_isnan(__lcpp_x);
515+
#else
513516
return isnan(__lcpp_x);
517+
#endif
514518
}
515519

516520
#undef isnan

0 commit comments

Comments
 (0)