28#ifndef VC_COMMON_UTILITY_H_
29#define VC_COMMON_UTILITY_H_
33namespace Vc_VERSIONED_NAMESPACE
41template <
size_t x,
bool = (x & (x - 1)) == 0>
struct NextPowerOfTwo;
43struct NextPowerOfTwo<x, true> :
public std::integral_constant<size_t, x> {
46struct NextPowerOfTwo<x, false>
47 :
public std::integral_constant<
48 size_t, NextPowerOfTwo<(x | (x >> 1) | (x >> 2) | (x >> 5)) + 1>::value> {
57struct BoundedAlignment :
public std::integral_constant<size_t,
58#if defined Vc_MSVC || defined Vc_GCC
78template <std::
size_t N>
static constexpr std::size_t left_size()
80 return Common::NextPowerOfTwo<(N + 1) / 2>::value;
86template <std::
size_t N>
static constexpr std::size_t right_size()
88 return N - left_size<N>();