From bc5c7c50fd9d84b7317b3dbf8d983027ab71de7c Mon Sep 17 00:00:00 2001 From: Federico <55920584+federico-busato@users.noreply.github.com> Date: Fri, 22 Jul 2022 13:49:17 -0700 Subject: [PATCH] Fixes IBM XLC behavior with uint128 fallback (#2985) * Fixes IBM XLC behavior with uint128 fallback * Replace legacy xlc with clang-based xlc * simplify xlc intrinsics handling Co-authored-by: Federico Busato --- include/fmt/format.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 83b2a222..fcddeea4 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -391,11 +391,11 @@ class uint128_fallback { hi_ += (lo_ < n ? 1 : 0); return *this; } -#if FMT_HAS_BUILTIN(__builtin_addcll) +#if FMT_HAS_BUILTIN(__builtin_addcll) && !defined(__ibmxl__) unsigned long long carry; lo_ = __builtin_addcll(lo_, n, 0, &carry); hi_ += carry; -#elif FMT_HAS_BUILTIN(__builtin_ia32_addcarryx_u64) +#elif FMT_HAS_BUILTIN(__builtin_ia32_addcarryx_u64) && !defined(__ibmxl__) unsigned long long result; auto carry = __builtin_ia32_addcarryx_u64(0, lo_, n, &result); lo_ = result;