[simd.bit] (original) (raw)

29 Numerics library [numerics]

29.10 Data-parallel types [simd]

29.10.8 basic_vec non-member operations [simd.nonmembers]

29.10.8.14 Bit manipulation [simd.bit]

template<[_simd-vec-type_](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V> constexpr V byteswap(const V& v) noexcept;

Constraints: The type V​::​value_type models integral.

Returns: A basic_vec object where the element is initialized to the result of std​::​byteswap(v[i]) for all i in the range [0, V​::​size()).

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 typeV​::​value_type.

Returns: A basic_vec 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-vec-type_](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V> constexpr V bit_floor(const V& v) noexcept;

Returns: A basic_vec 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-vec-type_](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V> constexpr typename V::mask_type has_single_bit(const V& v) noexcept;

Returns: A basic_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()).

Constraints:

Returns: A basic_vec 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 .

template<[_simd-vec-type_](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V> constexpr V rotl(const V& v, int s) noexcept;template<[_simd-vec-type_](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V> constexpr V rotr(const V& v, int s) noexcept;

Returns: A basic_vec 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 .

template<[_simd-vec-type_](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V> constexpr rebind_t<make_signed_t<typename V::value_type>, V> bit_width(const V& v) noexcept;template<[_simd-vec-type_](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V> constexpr rebind_t<make_signed_t<typename V::value_type>, V> countl_zero(const V& v) noexcept;template<[_simd-vec-type_](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V> constexpr rebind_t<make_signed_t<typename V::value_type>, V> countl_one(const V& v) noexcept;template<[_simd-vec-type_](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V> constexpr rebind_t<make_signed_t<typename V::value_type>, V> countr_zero(const V& v) noexcept;template<[_simd-vec-type_](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V> constexpr rebind_t<make_signed_t<typename V::value_type>, V> countr_one(const V& v) noexcept;template<[_simd-vec-type_](simd.expos#concept:simd-vec-type "29.10.2 Exposition-only types, variables, and concepts [simd.expos]") V> constexpr rebind_t<make_signed_t<typename V::value_type>, V> popcount(const V& v) noexcept;

Returns: A basic_vec 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 .