Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ target_include_directories(xsimd INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

target_compile_features(xsimd INTERFACE cxx_std_14)
target_compile_features(xsimd INTERFACE cxx_std_17)

# Only add xtl build option to the build tree, that is, if xsimd being locally
# developed or is vendored.
Expand Down
3 changes: 1 addition & 2 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,5 @@ WARN_AS_ERROR = NO
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
PREDEFINED = XSIMD_NO_DISCARD= \
XSIMD_INLINE=inline \
PREDEFINED = XSIMD_INLINE=inline \
DOXYGEN_SHOULD_SKIP_THIS=
2 changes: 1 addition & 1 deletion docs/source/vectorized_code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ One that is simple and compiles on all platforms is using C++17 ``if constexpr``
xsimd::batch<int8_t, Arch> const& y
) -> xsimd::batch<uint8_t, Arch> {
// Dedicated instruction dispatch at compile time
if constexpr(std::is_same_v<Arch, xsimd::avx2>){
if constexpr (std::is_same_v<Arch, xsimd::avx2>){
// Automatic conversion back and forth between xsimd::batch and native types
return _mm256_sign_epi8(x, y);
// When compiler complains we can be more explicit
Expand Down
14 changes: 7 additions & 7 deletions include/xsimd/arch/common/xsimd_common_bit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace xsimd
#if XSIMD_HAS_BUILTIN(__builtin_popcountg)
return __builtin_popcountg(x);
#else
XSIMD_IF_CONSTEXPR(sizeof(T) == 1)
if constexpr (sizeof(T) == 1)
{
#if XSIMD_HAS_BUILTIN(__builtin_popcount)
return __builtin_popcount(x);
Expand All @@ -68,7 +68,7 @@ namespace xsimd
return ((uint64_t)x * 0x200040008001ULL & 0x111111111111111ULL) % 0xf;
#endif
}
else XSIMD_IF_CONSTEXPR(sizeof(T) == 2)
else if constexpr (sizeof(T) == 2)
{
#if XSIMD_HAS_BUILTIN(__builtin_popcount)
return __builtin_popcount(x);
Expand All @@ -85,7 +85,7 @@ namespace xsimd
+ (((v & 0xfff000) >> 12) * msb12 & mask5) % 0x1f;
#endif
}
else XSIMD_IF_CONSTEXPR(sizeof(T) == 4)
else if constexpr (sizeof(T) == 4)
{
#if XSIMD_HAS_BUILTIN(__builtin_popcount)
return __builtin_popcount(x);
Expand Down Expand Up @@ -132,7 +132,7 @@ namespace xsimd
if (x == 0)
return sizeof(T) * CHAR_BIT;

XSIMD_IF_CONSTEXPR(sizeof(T) <= 4)
if constexpr (sizeof(T) <= 4)
{
#if XSIMD_HAS_BUILTIN(__builtin_clz)
return __builtin_clz((unsigned int)x) - (4 - sizeof(T)) * CHAR_BIT;
Expand All @@ -144,11 +144,11 @@ namespace xsimd
x |= x >> 1;
x |= x >> 2;
x |= x >> 4;
XSIMD_IF_CONSTEXPR(sizeof(T) >= 2)
if constexpr (sizeof(T) >= 2)
{
x |= x >> 8;
}
XSIMD_IF_CONSTEXPR(sizeof(T) >= 4)
if constexpr (sizeof(T) >= 4)
{
x |= x >> 16;
}
Expand Down Expand Up @@ -192,7 +192,7 @@ namespace xsimd
if (x == 0)
return sizeof(T) * CHAR_BIT;

XSIMD_IF_CONSTEXPR(sizeof(T) <= 4)
if constexpr (sizeof(T) <= 4)
{
#if XSIMD_HAS_BUILTIN(__builtin_ctz)
return __builtin_ctz((unsigned int)x);
Expand Down
10 changes: 5 additions & 5 deletions include/xsimd/arch/common/xsimd_common_memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,27 +655,27 @@ namespace xsimd
static_assert(bsize == batch<T, A>::size, "valid shuffle");

// Detect common patterns
XSIMD_IF_CONSTEXPR(detail::is_swizzle_fst(bsize, Indices...))
if constexpr (detail::is_swizzle_fst(bsize, Indices...))
{
return swizzle(x, batch_constant<ITy, A, ((Indices >= bsize) ? 0 /* never happens */ : Indices)...>());
}

XSIMD_IF_CONSTEXPR(detail::is_swizzle_snd(bsize, Indices...))
if constexpr (detail::is_swizzle_snd(bsize, Indices...))
{
return swizzle(y, batch_constant<ITy, A, ((Indices >= bsize) ? (Indices - bsize) : 0 /* never happens */)...>());
}

XSIMD_IF_CONSTEXPR(detail::is_zip_lo(bsize, Indices...))
if constexpr (detail::is_zip_lo(bsize, Indices...))
{
return zip_lo(x, y);
}

XSIMD_IF_CONSTEXPR(detail::is_zip_hi(bsize, Indices...))
if constexpr (detail::is_zip_hi(bsize, Indices...))
{
return zip_hi(x, y);
}

XSIMD_IF_CONSTEXPR(detail::is_select(bsize, Indices...))
if constexpr (detail::is_select(bsize, Indices...))
{
return select(batch_bool_constant<T, A, (Indices < bsize)...>(), x, y);
}
Expand Down
Loading
Loading