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 <fbusato@nvidia.com>
This commit is contained in:
Federico 2022-07-22 13:49:17 -07:00 committed by GitHub
parent 00adc7120d
commit bc5c7c50fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;