Skip to content

Commit 03839ea

Browse files
committed
Use builtin for comparisons on x64
1 parent d71fc15 commit 03839ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/boost/int128/detail/int128_imp.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ constexpr bool operator!=(const detail::builtin_u128 lhs, const int128_t rhs) no
376376
constexpr bool operator<(const int128_t lhs, const int128_t rhs) noexcept
377377
{
378378
// On ARM macs only with the clang compiler is casting to __int128 uniformly better (and seemingly cost free)
379-
#if defined(__aarch64__) && defined(__APPLE__) && defined(__clang__)
379+
#if (defined(__aarch64__) && defined(__APPLE__) && defined(__clang__)) || (defined(__x86_64__))
380380

381381
return static_cast<detail::builtin_i128>(lhs) < static_cast<detail::builtin_i128>(rhs);
382382

@@ -442,7 +442,7 @@ constexpr bool operator<(const detail::builtin_u128 lhs, const int128_t rhs) noe
442442
constexpr bool operator>(const int128_t lhs, const int128_t rhs) noexcept
443443
{
444444
// On ARM macs only with the clang compiler is casting to __int128 uniformly better (and seemingly cost free)
445-
#if defined(__aarch64__) && defined(__APPLE__) && defined(__clang__)
445+
#if (defined(__aarch64__) && defined(__APPLE__) && defined(__clang__)) || (defined(__x86_64__))
446446

447447
return static_cast<detail::builtin_i128>(lhs) > static_cast<detail::builtin_i128>(rhs);
448448

@@ -508,7 +508,7 @@ constexpr bool operator>(const detail::builtin_u128 lhs, const int128_t rhs) noe
508508
constexpr bool operator<=(const int128_t lhs, const int128_t rhs) noexcept
509509
{
510510
// On ARM macs only with the clang compiler is casting to __int128 uniformly better (and seemingly cost free)
511-
#if defined(__aarch64__) && defined(__APPLE__) && defined(__clang__)
511+
#if (defined(__aarch64__) && defined(__APPLE__) && defined(__clang__)) || (defined(__x86_64__))
512512

513513
return static_cast<detail::builtin_i128>(lhs) <= static_cast<detail::builtin_i128>(rhs);
514514

@@ -574,7 +574,7 @@ constexpr bool operator<=(const detail::builtin_u128 lhs, const int128_t rhs) no
574574
constexpr bool operator>=(const int128_t lhs, const int128_t rhs) noexcept
575575
{
576576
// On ARM macs only with the clang compiler is casting to __int128 uniformly better (and seemingly cost free)
577-
#if defined(__aarch64__) && defined(__APPLE__) && defined(__clang__)
577+
#if (defined(__aarch64__) && defined(__APPLE__) && defined(__clang__)) || (defined(__x86_64__))
578578

579579
return static_cast<detail::builtin_i128>(lhs) >= static_cast<detail::builtin_i128>(rhs);
580580

0 commit comments

Comments
 (0)