simplify xlc intrinsics handling

This commit is contained in:
Federico Busato 2022-07-22 13:28:10 -07:00
parent 043c1e4a69
commit 1ade10c862
2 changed files with 2 additions and 11 deletions

View File

@ -49,12 +49,6 @@
# define FMT_ICC_VERSION 0
#endif
#ifdef __ibmxl__
# define FMT_XLC_VERSION __ibmxl_vrm__
#else
# define FMT_XLC_VERSION 0
#endif
#ifdef _MSC_VER
# define FMT_MSC_VERSION _MSC_VER
# define FMT_MSC_WARNING(...) __pragma(warning(__VA_ARGS__))

View File

@ -391,14 +391,11 @@ class uint128_fallback {
hi_ += (lo_ < n ? 1 : 0);
return *this;
}
#if FMT_XLC_VERSION && defined(_ARCH_PWR9)
lo_ = __addex(lo_, n, 0, &carry);
hi_ += carry;
#elif FMT_HAS_BUILTIN(__builtin_addcll) && !FMT_XLC_VERSION
#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) && !FMT_XLC_VERSION
#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;