29 Numerics library [numerics]

29.10 Data-parallel types [simd]

29.10.6 Class template basic_simd [simd.class]

29.10.6.1 Class template basic_simd overview [simd.overview]

namespace std { template<class T, class Abi> class basic_simd { public: using value_type = T; using mask_type = basic_simd_mask<sizeof(T), Abi>; using abi_type = Abi; static constexpr integral_constant<simd-size-type, simd-size-v<T, Abi>> size {}; constexpr basic_simd() noexcept = default; // [simd.ctor], basic_simd constructors template<class U> constexpr basic_simd(U&& value) noexcept; template<class U, class UAbi> constexpr explicit(see below) basic_simd(const basic_simd<U, UAbi>&) noexcept; template<class G> constexpr explicit basic_simd(G&& gen) noexcept; template<class R, class... Flags> constexpr basic_simd(R&& range, simd_flags<Flags...> = {}); template<class R, class... Flags> constexpr basic_simd(R&& range, const mask_type& mask, simd_flags<Flags...> = {}); // [simd.subscr], basic_simd subscript operators constexpr value_type operator[](simd-size-type) const; // [simd.unary], basic_simd unary operators constexpr basic_simd& operator++() noexcept; constexpr basic_simd operator++(int) noexcept; constexpr basic_simd& operator--() noexcept; constexpr basic_simd operator--(int) noexcept; constexpr mask_type operator!() const noexcept; constexpr basic_simd operator~() const noexcept; constexpr basic_simd operator+() const noexcept; constexpr basic_simd operator-() const noexcept; // [simd.binary], basic_simd binary operators friend constexpr basic_simd operator+(const basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd operator-(const basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd operator*(const basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd operator/(const basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd operator%(const basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd operator&(const basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd operator|(const basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd operator^(const basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd operator<<(const basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd operator>>(const basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd operator<<(const basic_simd&, simd-size-type) noexcept; friend constexpr basic_simd operator>>(const basic_simd&, simd-size-type) noexcept; // [simd.cassign], basic_simd compound assignment friend constexpr basic_simd& operator+=(basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd& operator-=(basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd& operator*=(basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd& operator/=(basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd& operator%=(basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd& operator&=(basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd& operator|=(basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd& operator^=(basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd& operator<<=(basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd& operator>>=(basic_simd&, const basic_simd&) noexcept; friend constexpr basic_simd& operator<<=(basic_simd&, simd-size-type) noexcept; friend constexpr basic_simd& operator>>=(basic_simd&, simd-size-type) noexcept; // [simd.comparison], basic_simd compare operators friend constexpr mask_type operator==(const basic_simd&, const basic_simd&) noexcept; friend constexpr mask_type operator!=(const basic_simd&, const basic_simd&) noexcept; friend constexpr mask_type operator>=(const basic_simd&, const basic_simd&) noexcept; friend constexpr mask_type operator<=(const basic_simd&, const basic_simd&) noexcept; friend constexpr mask_type operator>(const basic_simd&, const basic_simd&) noexcept; friend constexpr mask_type operator<(const basic_simd&, const basic_simd&) noexcept; // [simd.cond], basic_simd exposition only conditional operators friend constexpr basic_simd simd-select-impl( // exposition only const mask_type&, const basic_simd&, const basic_simd&) noexcept; }; template<class R, class... Ts> basic_simd(R&& r, Ts...) -> see below; }
Every specialization of basic_simd is a complete type.
The specialization of basic_simd<T, Abi> is
  • enabled, if T is a vectorizable type, and there exists value N in the range [1, 64], such that Abi is deduce-abi-t<T, N>,
  • otherwise, disabled, if T is not a vectorizable type,
  • otherwise, it is implementation-defined if such a specialization is enabled.
If basic_simd<T, Abi> is disabled, the specialization has a deleted default constructor, deleted destructor, deleted copy constructor, and deleted copy assignment.
In addition only the value_type, abi_type, and mask_type members are present.
If basic_simd<T, Abi> is enabled, basic_simd<T, Abi> is trivially copyable.
Recommended practice: Implementations should support explicit conversions between specializations of basic_simd and appropriate implementation-defined types.
[Note 1: 
Appropriate types are non-standard vector types which are available in the implementation.
— end note]