From 4d52050e165b474ffa24035eeb69d5c7bc461408 Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 10 Aug 2021 13:39:09 -0700 Subject: [PATCH 1/2] use builtin functions on intel --- include/fmt/format.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 7b78200cf8d0..17c848450f21 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -150,16 +150,16 @@ FMT_END_NAMESPACE // __builtin_clz is broken in clang with Microsoft CodeGen: // https://github.com/fmtlib/fmt/issues/519 -#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clz)) && !FMT_MSC_VER +#if (FMT_GCC_VERSION || FMT_ICC_VERSION || FMT_HAS_BUILTIN(__builtin_clz)) && !FMT_MSC_VER # define FMT_BUILTIN_CLZ(n) __builtin_clz(n) #endif -#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clzll)) && !FMT_MSC_VER +#if (FMT_GCC_VERSION || FMT_ICC_VERSION || FMT_HAS_BUILTIN(__builtin_clzll)) && !FMT_MSC_VER # define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n) #endif -#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_ctz)) +#if (FMT_GCC_VERSION || FMT_ICC_VERSION || FMT_HAS_BUILTIN(__builtin_ctz)) # define FMT_BUILTIN_CTZ(n) __builtin_ctz(n) #endif -#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_ctzll)) +#if (FMT_GCC_VERSION || FMT_ICC_VERSION || FMT_HAS_BUILTIN(__builtin_ctzll)) # define FMT_BUILTIN_CTZLL(n) __builtin_ctzll(n) #endif From 898fe56724c9cafc3f1553a43767360756d0dd1c Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 10 Aug 2021 19:28:16 -0700 Subject: [PATCH 2/2] Address comments --- include/fmt/format.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 17c848450f21..07d3524bf430 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -150,16 +150,16 @@ FMT_END_NAMESPACE // __builtin_clz is broken in clang with Microsoft CodeGen: // https://github.com/fmtlib/fmt/issues/519 -#if (FMT_GCC_VERSION || FMT_ICC_VERSION || FMT_HAS_BUILTIN(__builtin_clz)) && !FMT_MSC_VER +#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clz) || FMT_ICC_VERSION) && !FMT_MSC_VER # define FMT_BUILTIN_CLZ(n) __builtin_clz(n) #endif -#if (FMT_GCC_VERSION || FMT_ICC_VERSION || FMT_HAS_BUILTIN(__builtin_clzll)) && !FMT_MSC_VER +#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_clzll) || FMT_ICC_VERSION) && !FMT_MSC_VER # define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n) #endif -#if (FMT_GCC_VERSION || FMT_ICC_VERSION || FMT_HAS_BUILTIN(__builtin_ctz)) +#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_ctz) || FMT_ICC_VERSION) # define FMT_BUILTIN_CTZ(n) __builtin_ctz(n) #endif -#if (FMT_GCC_VERSION || FMT_ICC_VERSION || FMT_HAS_BUILTIN(__builtin_ctzll)) +#if (FMT_GCC_VERSION || FMT_HAS_BUILTIN(__builtin_ctzll) || FMT_ICC_VERSION) # define FMT_BUILTIN_CTZLL(n) __builtin_ctzll(n) #endif