29 Numerics library [numerics]

29.10 Data-parallel types [simd]

29.10.7 basic_simd non-member operations [simd.nonmembers]

29.10.7.11 basic_simd bit library [simd.bit]

template<simd-type V> constexpr V byteswap(const V& v) noexcept;
Constraints: The type V​::​value_type models integral.
Returns: A basic_simd object where the element is initialized to the result of std​::​byteswap(v[i]) for all i in the range [0, V​::​size()).
template<simd-type V> constexpr V bit_ceil(const V& v) noexcept;
Constraints: The type V​::​value_type is an unsigned integer type ([basic.fundamental]).
Preconditions: For every i in the range [0, V​::​size()), the smallest power of 2 greater than or equal to v[i] is representable as a value of type V​::​value_type.
Returns: A basic_simd object where the element is initialized to the result of std​::​bit_ceil(v[i]) for all i in the range [0, V​::​size()).
Remarks: A function call expression that violates the precondition in the Preconditions: element is not a core constant expression ([expr.const]).
template<simd-type V> constexpr V bit_floor(const V& v) noexcept;
Constraints: The type V​::​value_type is an unsigned integer type ([basic.fundamental]).
Returns: A basic_simd object where the element is initialized to the result of std​::​bit_floor(v[i]) for all i in the range [0, V​::​size()).
template<simd-type V> constexpr typename V::mask_type has_single_bit(const V& v) noexcept;
Constraints: The type V​::​value_type is an unsigned integer type ([basic.fundamental]).
Returns: A basic_simd_mask object where the element is initialized to the result of std​::​has_single_bit(v[i]) for all i in the range [0, V​::​size()).
template<simd-type V0, simd-type V1> constexpr V0 rotl(const V0& v0, const V1& v1) noexcept; template<simd-type V0, simd-type V1> constexpr V0 rotr(const V0& v0, const V1& v1) noexcept;
Constraints:
  • The type V0​::​value_type is an unsigned integer type ([basic.fundamental]),
  • the type V1​::​value_type models integral,
  • V0​::​size() == V1​::​size() is true, and
  • sizeof(typename V0​::​value_type) == sizeof(typename V1​::​value_type) is true.
Returns: A basic_simd object where the element is initialized to the result of bit-func(v0[i], static_cast<int>(v1[i])) for all i in the range [0, V0​::​size()), where bit-func is the corresponding scalar function from <bit>.
template<simd-type V> constexpr V rotl(const V& v, int s) noexcept; template<simd-type V> constexpr V rotr(const V& v, int s) noexcept;
Constraints: The type V​::​value_type is an unsigned integer type ([basic.fundamental])
Returns: A basic_simd object where the element is initialized to the result of bit-func(v[i], s) for all i in the range [0, V​::​size()), where bit-func is the corresponding scalar function from <bit>.
template<simd-type V> constexpr rebind_t<make_signed_t<typename V::value_type>, V> bit_width(const V& v) noexcept; template<simd-type V> constexpr rebind_t<make_signed_t<typename V::value_type>, V> countl_zero(const V& v) noexcept; template<simd-type V> constexpr rebind_t<make_signed_t<typename V::value_type>, V> countl_one(const V& v) noexcept; template<simd-type V> constexpr rebind_t<make_signed_t<typename V::value_type>, V> countr_zero(const V& v) noexcept; template<simd-type V> constexpr rebind_t<make_signed_t<typename V::value_type>, V> countr_one(const V& v) noexcept; template<simd-type V> constexpr rebind_t<make_signed_t<typename V::value_type>, V> popcount(const V& v) noexcept;
Constraints: The type V​::​value_type is an unsigned integer type ([basic.fundamental])
Returns: A basic_simd object where the element is initialized to the result of bit-func(v[i]) for all i in the range [0, V​::​size()), where bit-func is the corresponding scalar function from <bit>.