diff options
author | thegeorg <thegeorg@yandex-team.ru> | 2022-02-10 16:45:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:08 +0300 |
commit | 4e839db24a3bbc9f1c610c43d6faaaa99824dcca (patch) | |
tree | 506dac10f5df94fab310584ee51b24fc5a081c22 /contrib/libs/cxxsupp/libcxx/include | |
parent | 2d37894b1b037cf24231090eda8589bbb44fb6fc (diff) | |
download | ydb-4e839db24a3bbc9f1c610c43d6faaaa99824dcca.tar.gz |
Restoring authorship annotation for <thegeorg@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include')
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/__config | 2 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/__wrappers_config | 48 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/array | 224 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/cxxabi.h | 4 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/experimental/simd | 2444 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/functional | 2 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/locale | 8 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/span | 2 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/string | 56 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/string_view | 18 | ||||
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/include/vector | 20 |
11 files changed, 1414 insertions, 1414 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/__config b/contrib/libs/cxxsupp/libcxx/include/__config index bdc54b92d1..779575d0f7 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__config +++ b/contrib/libs/cxxsupp/libcxx/include/__config @@ -963,7 +963,7 @@ typedef unsigned int char32_t; #define _LIBCPP_WCTYPE_IS_MASK #endif -#if _LIBCPP_STD_VER <= 17 || !defined(__cpp_char8_t) +#if _LIBCPP_STD_VER <= 17 || !defined(__cpp_char8_t) #define _LIBCPP_HAS_NO_CHAR8_T #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/__wrappers_config b/contrib/libs/cxxsupp/libcxx/include/__wrappers_config index 934e7c9279..8231a777cc 100644 --- a/contrib/libs/cxxsupp/libcxx/include/__wrappers_config +++ b/contrib/libs/cxxsupp/libcxx/include/__wrappers_config @@ -1,31 +1,31 @@ #pragma once -#if !defined(NDEBUG) && !defined(_LIBCPP_DEBUG) -# define _LIBCPP_DEBUG 0 +#if !defined(NDEBUG) && !defined(_LIBCPP_DEBUG) +# define _LIBCPP_DEBUG 0 #endif - -#ifndef _YNDX_LIBCPP_ENABLE_EXTENSIONS -# define _YNDX_LIBCPP_ENABLE_EXTENSIONS 1 -#endif - -#if _YNDX_LIBCPP_ENABLE_EXTENSIONS == 1 -# define _YNDX_LIBCXX_ENABLE_STRING_RESIZE_UNINITIALIZED 1 -# define _YNDX_LIBCXX_ENABLE_VECTOR_BOOL_COMPRESSION 0 -# define _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED 1 -#else -# define _YNDX_LIBCXX_ENABLE_STRING_RESIZE_UNINITIALIZED 0 -# define _YNDX_LIBCXX_ENABLE_VECTOR_BOOL_COMPRESSION 1 -# define _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED 0 -#endif - -#if _YNDX_LIBCPP_ENABLE_EXTENSIONS == 1 && (!defined(_LIBCPP_DEBUG) || _LIBCPP_DEBUG == 0) -# define _YNDX_LIBCPP_MAKE_VECTOR_ITERATOR_POINTERS 1 -# define _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS 1 -#else -# define _YNDX_LIBCPP_MAKE_VECTOR_ITERATOR_POINTERS 0 -# define _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS 0 + +#ifndef _YNDX_LIBCPP_ENABLE_EXTENSIONS +# define _YNDX_LIBCPP_ENABLE_EXTENSIONS 1 #endif +#if _YNDX_LIBCPP_ENABLE_EXTENSIONS == 1 +# define _YNDX_LIBCXX_ENABLE_STRING_RESIZE_UNINITIALIZED 1 +# define _YNDX_LIBCXX_ENABLE_VECTOR_BOOL_COMPRESSION 0 +# define _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED 1 +#else +# define _YNDX_LIBCXX_ENABLE_STRING_RESIZE_UNINITIALIZED 0 +# define _YNDX_LIBCXX_ENABLE_VECTOR_BOOL_COMPRESSION 1 +# define _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED 0 +#endif + +#if _YNDX_LIBCPP_ENABLE_EXTENSIONS == 1 && (!defined(_LIBCPP_DEBUG) || _LIBCPP_DEBUG == 0) +# define _YNDX_LIBCPP_MAKE_VECTOR_ITERATOR_POINTERS 1 +# define _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS 1 +#else +# define _YNDX_LIBCPP_MAKE_VECTOR_ITERATOR_POINTERS 0 +# define _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS 0 +#endif + #define _YNDX_WIN32_NOFILESYSTEM_RUNTIME #define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS @@ -35,5 +35,5 @@ #define _LIBCPP_ENABLE_CXX20_REMOVED_TYPE_TRAITS #ifdef _musl_ -# define _LIBCPP_HAS_MUSL_LIBC +# define _LIBCPP_HAS_MUSL_LIBC #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/array b/contrib/libs/cxxsupp/libcxx/include/array index 0ddfc955af..1075d03fc0 100644 --- a/contrib/libs/cxxsupp/libcxx/include/array +++ b/contrib/libs/cxxsupp/libcxx/include/array @@ -32,24 +32,24 @@ struct array typedef std::reverse_iterator<const_iterator> const_reverse_iterator; // No explicit construct/copy/destroy for aggregate type - void fill(const T& u); // constexpr in C++20 - void swap(array& a) noexcept(is_nothrow_swappable_v<T>); // constexpr in C++20 + void fill(const T& u); // constexpr in C++20 + void swap(array& a) noexcept(is_nothrow_swappable_v<T>); // constexpr in C++20 // iterators: - iterator begin() noexcept; // constexpr in C++17 - const_iterator begin() const noexcept; // constexpr in C++17 - iterator end() noexcept; // constexpr in C++17 - const_iterator end() const noexcept; // constexpr in C++17 + iterator begin() noexcept; // constexpr in C++17 + const_iterator begin() const noexcept; // constexpr in C++17 + iterator end() noexcept; // constexpr in C++17 + const_iterator end() const noexcept; // constexpr in C++17 - reverse_iterator rbegin() noexcept; // constexpr in C++17 - const_reverse_iterator rbegin() const noexcept; // constexpr in C++17 - reverse_iterator rend() noexcept; // constexpr in C++17 - const_reverse_iterator rend() const noexcept; // constexpr in C++17 + reverse_iterator rbegin() noexcept; // constexpr in C++17 + const_reverse_iterator rbegin() const noexcept; // constexpr in C++17 + reverse_iterator rend() noexcept; // constexpr in C++17 + const_reverse_iterator rend() const noexcept; // constexpr in C++17 - const_iterator cbegin() const noexcept; // constexpr in C++17 - const_iterator cend() const noexcept; // constexpr in C++17 - const_reverse_iterator crbegin() const noexcept; // constexpr in C++17 - const_reverse_iterator crend() const noexcept; // constexpr in C++17 + const_iterator cbegin() const noexcept; // constexpr in C++17 + const_iterator cend() const noexcept; // constexpr in C++17 + const_reverse_iterator crbegin() const noexcept; // constexpr in C++17 + const_reverse_iterator crend() const noexcept; // constexpr in C++17 // capacity: constexpr size_type size() const noexcept; @@ -57,51 +57,51 @@ struct array constexpr bool empty() const noexcept; // element access: - reference operator[](size_type n); // constexpr in C++17 - const_reference operator[](size_type n) const; // constexpr in C++14 - reference at(size_type n); // constexpr in C++17 - const_reference at(size_type n) const; // constexpr in C++14 - - reference front(); // constexpr in C++17 - const_reference front() const; // constexpr in C++14 - reference back(); // constexpr in C++17 - const_reference back() const; // constexpr in C++14 - - T* data() noexcept; // constexpr in C++17 - const T* data() const noexcept; // constexpr in C++17 + reference operator[](size_type n); // constexpr in C++17 + const_reference operator[](size_type n) const; // constexpr in C++14 + reference at(size_type n); // constexpr in C++17 + const_reference at(size_type n) const; // constexpr in C++14 + + reference front(); // constexpr in C++17 + const_reference front() const; // constexpr in C++14 + reference back(); // constexpr in C++17 + const_reference back() const; // constexpr in C++14 + + T* data() noexcept; // constexpr in C++17 + const T* data() const noexcept; // constexpr in C++17 }; -template <class T, class... U> - array(T, U...) -> array<T, 1 + sizeof...(U)>; // C++17 +template <class T, class... U> + array(T, U...) -> array<T, 1 + sizeof...(U)>; // C++17 template <class T, size_t N> - bool operator==(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 + bool operator==(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 template <class T, size_t N> - bool operator!=(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 + bool operator!=(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 template <class T, size_t N> - bool operator<(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 + bool operator<(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 template <class T, size_t N> - bool operator>(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 + bool operator>(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 template <class T, size_t N> - bool operator<=(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 + bool operator<=(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 template <class T, size_t N> - bool operator>=(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 + bool operator>=(const array<T,N>& x, const array<T,N>& y); // constexpr in C++20 template <class T, size_t N > - void swap(array<T,N>& x, array<T,N>& y) noexcept(noexcept(x.swap(y))); // constexpr in C++20 - -template <class T, size_t N> - constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]); // C++20 -template <class T, size_t N> - constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]); // C++20 + void swap(array<T,N>& x, array<T,N>& y) noexcept(noexcept(x.swap(y))); // constexpr in C++20 +template <class T, size_t N> + constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]); // C++20 +template <class T, size_t N> + constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]); // C++20 + template <class T> struct tuple_size; template <size_t I, class T> struct tuple_element; template <class T, size_t N> struct tuple_size<array<T, N>>; template <size_t I, class T, size_t N> struct tuple_element<I, array<T, N>>; -template <size_t I, class T, size_t N> T& get(array<T, N>&) noexcept; // constexpr in C++14 -template <size_t I, class T, size_t N> const T& get(const array<T, N>&) noexcept; // constexpr in C++14 -template <size_t I, class T, size_t N> T&& get(array<T, N>&&) noexcept; // constexpr in C++14 +template <size_t I, class T, size_t N> T& get(array<T, N>&) noexcept; // constexpr in C++14 +template <size_t I, class T, size_t N> const T& get(const array<T, N>&) noexcept; // constexpr in C++14 +template <size_t I, class T, size_t N> T&& get(array<T, N>&&) noexcept; // constexpr in C++14 template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexcept; // constexpr in C++14 } // std @@ -139,20 +139,20 @@ struct _LIBCPP_TEMPLATE_VIS array typedef const value_type* const_pointer; typedef size_t size_type; typedef ptrdiff_t difference_type; - typedef _VSTD::reverse_iterator<iterator> reverse_iterator; - typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; + typedef _VSTD::reverse_iterator<iterator> reverse_iterator; + typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; _Tp __elems_[_Size]; // No explicit construct/copy/destroy for aggregate type - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 - void fill(const value_type& __u) { - _VSTD::fill_n(data(), _Size, __u); + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + void fill(const value_type& __u) { + _VSTD::fill_n(data(), _Size, __u); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void swap(array& __a) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) { - _VSTD::swap_ranges(data(), data() + _Size, __a.data()); + _VSTD::swap_ranges(data(), data() + _Size, __a.data()); } // iterators: @@ -189,39 +189,39 @@ struct _LIBCPP_TEMPLATE_VIS array _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT {return _Size;} _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY - _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return _Size == 0;} + _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return _Size == 0;} // element access: _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - reference operator[](size_type __n) _NOEXCEPT { - _LIBCPP_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>"); - return __elems_[__n]; - } + reference operator[](size_type __n) _NOEXCEPT { + _LIBCPP_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>"); + return __elems_[__n]; + } _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 - const_reference operator[](size_type __n) const _NOEXCEPT { - _LIBCPP_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>"); - return __elems_[__n]; - } - - _LIBCPP_CONSTEXPR_AFTER_CXX14 reference at(size_type __n) - { - if (__n >= _Size) - __throw_out_of_range("array::at"); - return __elems_[__n]; - } - - _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference at(size_type __n) const - { - if (__n >= _Size) - __throw_out_of_range("array::at"); - return __elems_[__n]; - } - - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference front() _NOEXCEPT {return (*this)[0];} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference front() const _NOEXCEPT {return (*this)[0];} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() _NOEXCEPT {return (*this)[_Size - 1];} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const _NOEXCEPT {return (*this)[_Size - 1];} - + const_reference operator[](size_type __n) const _NOEXCEPT { + _LIBCPP_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>"); + return __elems_[__n]; + } + + _LIBCPP_CONSTEXPR_AFTER_CXX14 reference at(size_type __n) + { + if (__n >= _Size) + __throw_out_of_range("array::at"); + return __elems_[__n]; + } + + _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference at(size_type __n) const + { + if (__n >= _Size) + __throw_out_of_range("array::at"); + return __elems_[__n]; + } + + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference front() _NOEXCEPT {return (*this)[0];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference front() const _NOEXCEPT {return (*this)[0];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() _NOEXCEPT {return (*this)[_Size - 1];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const _NOEXCEPT {return (*this)[_Size - 1];} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 value_type* data() _NOEXCEPT {return __elems_;} _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 @@ -242,8 +242,8 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> typedef const value_type* const_pointer; typedef size_t size_type; typedef ptrdiff_t difference_type; - typedef _VSTD::reverse_iterator<iterator> reverse_iterator; - typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; + typedef _VSTD::reverse_iterator<iterator> reverse_iterator; + typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; typedef typename conditional<is_const<_Tp>::value, const char, char>::type _CharType; @@ -251,50 +251,50 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> struct _ArrayInStructT { _Tp __data_[1]; }; _ALIGNAS_TYPE(_ArrayInStructT) _CharType __elems_[sizeof(_ArrayInStructT)]; - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - value_type* data() _NOEXCEPT {return nullptr;} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 - const value_type* data() const _NOEXCEPT {return nullptr;} - + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + value_type* data() _NOEXCEPT {return nullptr;} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + const value_type* data() const _NOEXCEPT {return nullptr;} + // No explicit construct/copy/destroy for aggregate type - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 - void fill(const value_type&) { + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + void fill(const value_type&) { static_assert(!is_const<_Tp>::value, "cannot fill zero-sized array of type 'const T'"); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 void swap(array&) _NOEXCEPT { static_assert(!is_const<_Tp>::value, "cannot swap zero-sized array of type 'const T'"); } // iterators: - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 iterator begin() _NOEXCEPT {return iterator(data());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_iterator begin() const _NOEXCEPT {return const_iterator(data());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 iterator end() _NOEXCEPT {return iterator(data());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_iterator end() const _NOEXCEPT {return const_iterator(data());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_reverse_iterator rbegin() const _NOEXCEPT {return const_reverse_iterator(end());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reverse_iterator rend() _NOEXCEPT {return reverse_iterator(begin());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_reverse_iterator rend() const _NOEXCEPT {return const_reverse_iterator(begin());} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_iterator cbegin() const _NOEXCEPT {return begin();} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_iterator cend() const _NOEXCEPT {return end();} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();} - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 const_reverse_iterator crend() const _NOEXCEPT {return rend();} // capacity: @@ -306,7 +306,7 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> _LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return true;} // element access: - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference operator[](size_type) _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array"); _LIBCPP_UNREACHABLE(); @@ -318,37 +318,37 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0> _LIBCPP_UNREACHABLE(); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference at(size_type) { __throw_out_of_range("array<T, 0>::at"); _LIBCPP_UNREACHABLE(); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference at(size_type) const { __throw_out_of_range("array<T, 0>::at"); _LIBCPP_UNREACHABLE(); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference front() _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array"); _LIBCPP_UNREACHABLE(); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference front() const _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array"); _LIBCPP_UNREACHABLE(); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference back() _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array"); _LIBCPP_UNREACHABLE(); } - _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference back() const _NOEXCEPT { _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array"); _LIBCPP_UNREACHABLE(); @@ -414,7 +414,7 @@ operator>=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y) } template <class _Tp, size_t _Size> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if < _Size == 0 || @@ -497,7 +497,7 @@ to_array(_Tp (&__arr)[_Size]) noexcept(is_nothrow_constructible_v<_Tp, _Tp&>) { static_assert( is_constructible_v<_Tp, _Tp&>, "[array.creation]/1: to_array requires copy constructible elements."); - return _VSTD::__to_array_lvalue_impl(__arr, make_index_sequence<_Size>()); + return _VSTD::__to_array_lvalue_impl(__arr, make_index_sequence<_Size>()); } template <typename _Tp, size_t _Size> @@ -509,8 +509,8 @@ to_array(_Tp(&&__arr)[_Size]) noexcept(is_nothrow_move_constructible_v<_Tp>) { static_assert( is_move_constructible_v<_Tp>, "[array.creation]/4: to_array requires move constructible elements."); - return _VSTD::__to_array_rvalue_impl(_VSTD::move(__arr), - make_index_sequence<_Size>()); + return _VSTD::__to_array_rvalue_impl(_VSTD::move(__arr), + make_index_sequence<_Size>()); } #endif // _LIBCPP_STD_VER > 17 diff --git a/contrib/libs/cxxsupp/libcxx/include/cxxabi.h b/contrib/libs/cxxsupp/libcxx/include/cxxabi.h index 3b1edaf75a..b3d950dd47 100644 --- a/contrib/libs/cxxsupp/libcxx/include/cxxabi.h +++ b/contrib/libs/cxxsupp/libcxx/include/cxxabi.h @@ -2,8 +2,8 @@ #if defined(__IOS__) || defined(__ANDROID__) #include_next <cxxabi.h> -#elif defined(_WIN32) -// pass +#elif defined(_WIN32) +// pass #else #include <contrib/libs/cxxsupp/libcxxrt/cxxabi.h> #endif diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/simd b/contrib/libs/cxxsupp/libcxx/include/experimental/simd index 59a7139585..782f82cda8 100644 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/simd +++ b/contrib/libs/cxxsupp/libcxx/include/experimental/simd @@ -1,684 +1,684 @@ -// -*- C++ -*- -//===------------------------------- simd ---------------------------------===// -// +// -*- C++ -*- +//===------------------------------- simd ---------------------------------===// +// // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP_EXPERIMENTAL_SIMD -#define _LIBCPP_EXPERIMENTAL_SIMD - -/* - experimental/simd synopsis - -namespace std::experimental { - -inline namespace parallelism_v2 { - -namespace simd_abi { - -struct scalar {}; -template <int N> struct fixed_size {}; -template <typename T> inline constexpr int max_fixed_size = implementation-defined; -template <typename T> using compatible = implementation-defined; -template <typename T> using native = implementation-defined; - -} // simd_abi - -struct element_aligned_tag {}; -struct vector_aligned_tag {}; -template <size_t> struct overaligned_tag {}; -inline constexpr element_aligned_tag element_aligned{}; -inline constexpr vector_aligned_tag vector_aligned{}; -template <size_t N> inline constexpr overaligned_tag<N> overaligned{}; - -// traits [simd.traits] -template <class T> struct is_abi_tag; -template <class T> inline constexpr bool is_abi_tag_v = is_abi_tag<T>::value; - -template <class T> struct is_simd; -template <class T> inline constexpr bool is_simd_v = is_simd<T>::value; - -template <class T> struct is_simd_mask; -template <class T> inline constexpr bool is_simd_mask_v = is_simd_mask<T>::value; - -template <class T> struct is_simd_flag_type; -template <class T> inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<T>::value; - -template <class T, size_t N> struct abi_for_size { using type = see below; }; -template <class T, size_t N> using abi_for_size_t = typename abi_for_size<T, N>::type; - -template <class T, class Abi = simd_abi::compatible<T>> struct simd_size; -template <class T, class Abi = simd_abi::compatible<T>> -inline constexpr size_t simd_size_v = simd_size<T, Abi>::value; - -template <class T, class U = typename T::value_type> struct memory_alignment; -template <class T, class U = typename T::value_type> -inline constexpr size_t memory_alignment_v = memory_alignment<T, U>::value; - -// class template simd [simd.class] -template <class T, class Abi = simd_abi::compatible<T>> class simd; -template <class T> using native_simd = simd<T, simd_abi::native<T>>; -template <class T, int N> using fixed_size_simd = simd<T, simd_abi::fixed_size<N>>; - -// class template simd_mask [simd.mask.class] -template <class T, class Abi = simd_abi::compatible<T>> class simd_mask; -template <class T> using native_simd_mask = simd_mask<T, simd_abi::native<T>>; -template <class T, int N> using fixed_size_simd_mask = simd_mask<T, simd_abi::fixed_size<N>>; - -// casts [simd.casts] -template <class T, class U, class Abi> see below simd_cast(const simd<U, Abi>&); -template <class T, class U, class Abi> see below static_simd_cast(const simd<U, Abi>&); - -template <class T, class Abi> -fixed_size_simd<T, simd_size_v<T, Abi>> to_fixed_size(const simd<T, Abi>&) noexcept; -template <class T, class Abi> -fixed_size_simd_mask<T, simd_size_v<T, Abi>> to_fixed_size(const simd_mask<T, Abi>&) noexcept; -template <class T, size_t N> native_simd<T> to_native(const fixed_size_simd<T, N>&) noexcept; -template <class T, size_t N> -native_simd_mask<T> to_native(const fixed_size_simd_mask<T, N>> &) noexcept; -template <class T, size_t N> simd<T> to_compatible(const fixed_size_simd<T, N>&) noexcept; -template <class T, size_t N> simd_mask<T> to_compatible(const fixed_size_simd_mask<T, N>&) noexcept; - -template <size_t... Sizes, class T, class Abi> -tuple<simd<T, abi_for_size_t<Sizes>>...> split(const simd<T, Abi>&); -template <size_t... Sizes, class T, class Abi> -tuple<simd_mask<T, abi_for_size_t<Sizes>>...> split(const simd_mask<T, Abi>&); -template <class V, class Abi> -array<V, simd_size_v<typename V::value_type, Abi> / V::size()> split( -const simd<typename V::value_type, Abi>&); -template <class V, class Abi> -array<V, simd_size_v<typename V::value_type, Abi> / V::size()> split( -const simd_mask<typename V::value_type, Abi>&); - -template <class T, class... Abis> -simd<T, abi_for_size_t<T, (simd_size_v<T, Abis> + ...)>> concat(const simd<T, Abis>&...); -template <class T, class... Abis> -simd_mask<T, abi_for_size_t<T, (simd_size_v<T, Abis> + ...)>> concat(const simd_mask<T, Abis>&...); - -// reductions [simd.mask.reductions] -template <class T, class Abi> bool all_of(const simd_mask<T, Abi>&) noexcept; -template <class T, class Abi> bool any_of(const simd_mask<T, Abi>&) noexcept; -template <class T, class Abi> bool none_of(const simd_mask<T, Abi>&) noexcept; -template <class T, class Abi> bool some_of(const simd_mask<T, Abi>&) noexcept; -template <class T, class Abi> int popcount(const simd_mask<T, Abi>&) noexcept; -template <class T, class Abi> int find_first_set(const simd_mask<T, Abi>&); -template <class T, class Abi> int find_last_set(const simd_mask<T, Abi>&); - -bool all_of(see below) noexcept; -bool any_of(see below) noexcept; -bool none_of(see below) noexcept; -bool some_of(see below) noexcept; -int popcount(see below) noexcept; -int find_first_set(see below) noexcept; -int find_last_set(see below) noexcept; - -// masked assignment [simd.whereexpr] -template <class M, class T> class const_where_expression; -template <class M, class T> class where_expression; - -// masked assignment [simd.mask.where] -template <class T> struct nodeduce { using type = T; }; // exposition only - -template <class T> using nodeduce_t = typename nodeduce<T>::type; // exposition only - -template <class T, class Abi> -where_expression<simd_mask<T, Abi>, simd<T, Abi>> -where(const typename simd<T, Abi>::mask_type&, simd<T, Abi>&) noexcept; - -template <class T, class Abi> -const_where_expression<simd_mask<T, Abi>, const simd<T, Abi>> -where(const typename simd<T, Abi>::mask_type&, const simd<T, Abi>&) noexcept; - -template <class T, class Abi> -where_expression<simd_mask<T, Abi>, simd_mask<T, Abi>> -where(const nodeduce_t<simd_mask<T, Abi>>&, simd_mask<T, Abi>&) noexcept; - -template <class T, class Abi> -const_where_expression<simd_mask<T, Abi>, const simd_mask<T, Abi>> -where(const nodeduce_t<simd_mask<T, Abi>>&, const simd_mask<T, Abi>&) noexcept; - -template <class T> where_expression<bool, T> where(see below k, T& d) noexcept; - -template <class T> -const_where_expression<bool, const T> where(see below k, const T& d) noexcept; - -// reductions [simd.reductions] -template <class T, class Abi, class BinaryOperation = std::plus<>> -T reduce(const simd<T, Abi>&, BinaryOperation = BinaryOperation()); - -template <class M, class V, class BinaryOperation> -typename V::value_type reduce(const const_where_expression<M, V>& x, -typename V::value_type neutral_element, BinaryOperation binary_op); - -template <class M, class V> -typename V::value_type reduce(const const_where_expression<M, V>& x, plus<> binary_op = plus<>()); - -template <class M, class V> -typename V::value_type reduce(const const_where_expression<M, V>& x, multiplies<> binary_op); - -template <class M, class V> -typename V::value_type reduce(const const_where_expression<M, V>& x, bit_and<> binary_op); - -template <class M, class V> -typename V::value_type reduce(const const_where_expression<M, V>& x, bit_or<> binary_op); - -template <class M, class V> -typename V::value_type reduce(const const_where_expression<M, V>& x, bit_xor<> binary_op); - -template <class T, class Abi> T hmin(const simd<T, Abi>&); -template <class M, class V> T hmin(const const_where_expression<M, V>&); -template <class T, class Abi> T hmax(const simd<T, Abi>&); -template <class M, class V> T hmax(const const_where_expression<M, V>&); - -// algorithms [simd.alg] -template <class T, class Abi> simd<T, Abi> min(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; - -template <class T, class Abi> simd<T, Abi> max(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; - -template <class T, class Abi> -std::pair<simd<T, Abi>, simd<T, Abi>> minmax(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; - -template <class T, class Abi> -simd<T, Abi> clamp(const simd<T, Abi>& v, const simd<T, Abi>& lo, const simd<T, Abi>& hi); - -// [simd.whereexpr] -template <class M, class T> -class const_where_expression { - const M& mask; // exposition only - T& data; // exposition only -public: - const_where_expression(const const_where_expression&) = delete; - const_where_expression& operator=(const const_where_expression&) = delete; - remove_const_t<T> operator-() const &&; - template <class U, class Flags> void copy_to(U* mem, Flags f) const &&; -}; - -template <class M, class T> -class where_expression : public const_where_expression<M, T> { -public: - where_expression(const where_expression&) = delete; - where_expression& operator=(const where_expression&) = delete; - template <class U> void operator=(U&& x); - template <class U> void operator+=(U&& x); - template <class U> void operator-=(U&& x); - template <class U> void operator*=(U&& x); - template <class U> void operator/=(U&& x); - template <class U> void operator%=(U&& x); - template <class U> void operator&=(U&& x); - template <class U> void operator|=(U&& x); - template <class U> void operator^=(U&& x); - template <class U> void operator<<=(U&& x); - template <class U> void operator>>=(U&& x); - void operator++(); - void operator++(int); - void operator--(); - void operator--(int); - template <class U, class Flags> void copy_from(const U* mem, Flags); -}; - -// [simd.class] -template <class T, class Abi> class simd { -public: - using value_type = T; - using reference = see below; - using mask_type = simd_mask<T, Abi>; - - using abi_type = Abi; - static constexpr size_t size() noexcept; - simd() = default; - - // implicit type conversion constructor - template <class U> simd(const simd<U, simd_abi::fixed_size<size()>>&); - - // implicit broadcast constructor (see below for constraints) - template <class U> simd(U&& value); - - // generator constructor (see below for constraints) - template <class G> explicit simd(G&& gen); - - // load constructor - template <class U, class Flags> simd(const U* mem, Flags f); - - // loads [simd.load] - template <class U, class Flags> void copy_from(const U* mem, Flags f); - - // stores [simd.store] - template <class U, class Flags> void copy_to(U* mem, Flags f) const; - - // scalar access [simd.subscr] - reference operator[](size_t); - value_type operator[](size_t) const; - - // unary operators [simd.unary] - simd& operator++(); - simd operator++(int); - simd& operator--(); - simd operator--(int); - mask_type operator!() const; - simd operator~() const; // see below - simd operator+() const; - simd operator-() const; - - // binary operators [simd.binary] - friend simd operator+ (const simd&, const simd&); - friend simd operator- (const simd&, const simd&); - friend simd operator* (const simd&, const simd&); - friend simd operator/ (const simd&, const simd&); - friend simd operator% (const simd&, const simd&); - friend simd operator& (const simd&, const simd&); - friend simd operator| (const simd&, const simd&); - friend simd operator^ (const simd&, const simd&); - friend simd operator<<(const simd&, const simd&); - friend simd operator>>(const simd&, const simd&); - friend simd operator<<(const simd&, int); - friend simd operator>>(const simd&, int); - - // compound assignment [simd.cassign] - friend simd& operator+= (simd&, const simd&); - friend simd& operator-= (simd&, const simd&); - friend simd& operator*= (simd&, const simd&); - friend simd& operator/= (simd&, const simd&); - friend simd& operator%= (simd&, const simd&); - - friend simd& operator&= (simd&, const simd&); - friend simd& operator|= (simd&, const simd&); - friend simd& operator^= (simd&, const simd&); - friend simd& operator<<=(simd&, const simd&); - friend simd& operator>>=(simd&, const simd&); - friend simd& operator<<=(simd&, int); - friend simd& operator>>=(simd&, int); - - // compares [simd.comparison] - friend mask_type operator==(const simd&, const simd&); - friend mask_type operator!=(const simd&, const simd&); - friend mask_type operator>=(const simd&, const simd&); - friend mask_type operator<=(const simd&, const simd&); - friend mask_type operator> (const simd&, const simd&); - friend mask_type operator< (const simd&, const simd&); -}; - -// [simd.math] -template <class Abi> using scharv = simd<signed char, Abi>; // exposition only -template <class Abi> using shortv = simd<short, Abi>; // exposition only -template <class Abi> using intv = simd<int, Abi>; // exposition only -template <class Abi> using longv = simd<long int, Abi>; // exposition only -template <class Abi> using llongv = simd<long long int, Abi>; // exposition only -template <class Abi> using floatv = simd<float, Abi>; // exposition only -template <class Abi> using doublev = simd<double, Abi>; // exposition only -template <class Abi> using ldoublev = simd<long double, Abi>; // exposition only -template <class T, class V> using samesize = fixed_size_simd<T, V::size()>; // exposition only - -template <class Abi> floatv<Abi> acos(floatv<Abi> x); -template <class Abi> doublev<Abi> acos(doublev<Abi> x); -template <class Abi> ldoublev<Abi> acos(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> asin(floatv<Abi> x); -template <class Abi> doublev<Abi> asin(doublev<Abi> x); -template <class Abi> ldoublev<Abi> asin(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> atan(floatv<Abi> x); -template <class Abi> doublev<Abi> atan(doublev<Abi> x); -template <class Abi> ldoublev<Abi> atan(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> atan2(floatv<Abi> y, floatv<Abi> x); -template <class Abi> doublev<Abi> atan2(doublev<Abi> y, doublev<Abi> x); -template <class Abi> ldoublev<Abi> atan2(ldoublev<Abi> y, ldoublev<Abi> x); - -template <class Abi> floatv<Abi> cos(floatv<Abi> x); -template <class Abi> doublev<Abi> cos(doublev<Abi> x); -template <class Abi> ldoublev<Abi> cos(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> sin(floatv<Abi> x); -template <class Abi> doublev<Abi> sin(doublev<Abi> x); -template <class Abi> ldoublev<Abi> sin(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> tan(floatv<Abi> x); -template <class Abi> doublev<Abi> tan(doublev<Abi> x); -template <class Abi> ldoublev<Abi> tan(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> acosh(floatv<Abi> x); -template <class Abi> doublev<Abi> acosh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> acosh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> asinh(floatv<Abi> x); -template <class Abi> doublev<Abi> asinh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> asinh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> atanh(floatv<Abi> x); -template <class Abi> doublev<Abi> atanh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> atanh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> cosh(floatv<Abi> x); -template <class Abi> doublev<Abi> cosh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> cosh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> sinh(floatv<Abi> x); -template <class Abi> doublev<Abi> sinh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> sinh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> tanh(floatv<Abi> x); -template <class Abi> doublev<Abi> tanh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> tanh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> exp(floatv<Abi> x); -template <class Abi> doublev<Abi> exp(doublev<Abi> x); -template <class Abi> ldoublev<Abi> exp(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> exp2(floatv<Abi> x); -template <class Abi> doublev<Abi> exp2(doublev<Abi> x); -template <class Abi> ldoublev<Abi> exp2(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> expm1(floatv<Abi> x); -template <class Abi> doublev<Abi> expm1(doublev<Abi> x); -template <class Abi> ldoublev<Abi> expm1(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> frexp(floatv<Abi> value, samesize<int, floatv<Abi>>* exp); -template <class Abi> doublev<Abi> frexp(doublev<Abi> value, samesize<int, doublev<Abi>>* exp); -template <class Abi> ldoublev<Abi> frexp(ldoublev<Abi> value, samesize<int, ldoublev<Abi>>* exp); - -template <class Abi> samesize<int, floatv<Abi>> ilogb(floatv<Abi> x); -template <class Abi> samesize<int, doublev<Abi>> ilogb(doublev<Abi> x); -template <class Abi> samesize<int, ldoublev<Abi>> ilogb(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> ldexp(floatv<Abi> x, samesize<int, floatv<Abi>> exp); -template <class Abi> doublev<Abi> ldexp(doublev<Abi> x, samesize<int, doublev<Abi>> exp); -template <class Abi> ldoublev<Abi> ldexp(ldoublev<Abi> x, samesize<int, ldoublev<Abi>> exp); - -template <class Abi> floatv<Abi> log(floatv<Abi> x); -template <class Abi> doublev<Abi> log(doublev<Abi> x); -template <class Abi> ldoublev<Abi> log(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> log10(floatv<Abi> x); -template <class Abi> doublev<Abi> log10(doublev<Abi> x); -template <class Abi> ldoublev<Abi> log10(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> log1p(floatv<Abi> x); -template <class Abi> doublev<Abi> log1p(doublev<Abi> x); -template <class Abi> ldoublev<Abi> log1p(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> log2(floatv<Abi> x); -template <class Abi> doublev<Abi> log2(doublev<Abi> x); -template <class Abi> ldoublev<Abi> log2(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> logb(floatv<Abi> x); -template <class Abi> doublev<Abi> logb(doublev<Abi> x); -template <class Abi> ldoublev<Abi> logb(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> modf(floatv<Abi> value, floatv<Abi>* iptr); -template <class Abi> doublev<Abi> modf(doublev<Abi> value, doublev<Abi>* iptr); -template <class Abi> ldoublev<Abi> modf(ldoublev<Abi> value, ldoublev<Abi>* iptr); - -template <class Abi> floatv<Abi> scalbn(floatv<Abi> x, samesize<int, floatv<Abi>> n); -template <class Abi> doublev<Abi> scalbn(doublev<Abi> x, samesize<int, doublev<Abi>> n); -template <class Abi> ldoublev<Abi> scalbn(ldoublev<Abi> x, samesize<int, ldoublev<Abi>> n); -template <class Abi> floatv<Abi> scalbln(floatv<Abi> x, samesize<long int, floatv<Abi>> n); -template <class Abi> doublev<Abi> scalbln(doublev<Abi> x, samesize<long int, doublev<Abi>> n); -template <class Abi> ldoublev<Abi> scalbln(ldoublev<Abi> x, samesize<long int, ldoublev<Abi>> n); - -template <class Abi> floatv<Abi> cbrt(floatv<Abi> x); -template <class Abi> doublev<Abi> cbrt(doublev<Abi> x); -template <class Abi> ldoublev<Abi> cbrt(ldoublev<Abi> x); - -template <class Abi> scharv<Abi> abs(scharv<Abi> j); -template <class Abi> shortv<Abi> abs(shortv<Abi> j); -template <class Abi> intv<Abi> abs(intv<Abi> j); -template <class Abi> longv<Abi> abs(longv<Abi> j); -template <class Abi> llongv<Abi> abs(llongv<Abi> j); -template <class Abi> floatv<Abi> abs(floatv<Abi> j); -template <class Abi> doublev<Abi> abs(doublev<Abi> j); -template <class Abi> ldoublev<Abi> abs(ldoublev<Abi> j); - -template <class Abi> floatv<Abi> hypot(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y); -template <class Abi> floatv<Abi> hypot(floatv<Abi> x, floatv<Abi> y, floatv<Abi> z); -template <class Abi> doublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y, doublev<Abi> z); -template <class Abi> ldoublev<Abi> hypot(ldoublev<Abi> x, ldoublev<Abi> y, ldoublev<Abi> z); - -template <class Abi> floatv<Abi> pow(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> pow(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> pow(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> sqrt(floatv<Abi> x); -template <class Abi> doublev<Abi> sqrt(doublev<Abi> x); -template <class Abi> ldoublev<Abi> sqrt(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> erf(floatv<Abi> x); -template <class Abi> doublev<Abi> erf(doublev<Abi> x); -template <class Abi> ldoublev<Abi> erf(ldoublev<Abi> x); -template <class Abi> floatv<Abi> erfc(floatv<Abi> x); -template <class Abi> doublev<Abi> erfc(doublev<Abi> x); -template <class Abi> ldoublev<Abi> erfc(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> lgamma(floatv<Abi> x); -template <class Abi> doublev<Abi> lgamma(doublev<Abi> x); -template <class Abi> ldoublev<Abi> lgamma(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> tgamma(floatv<Abi> x); -template <class Abi> doublev<Abi> tgamma(doublev<Abi> x); -template <class Abi> ldoublev<Abi> tgamma(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> ceil(floatv<Abi> x); -template <class Abi> doublev<Abi> ceil(doublev<Abi> x); -template <class Abi> ldoublev<Abi> ceil(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> floor(floatv<Abi> x); -template <class Abi> doublev<Abi> floor(doublev<Abi> x); -template <class Abi> ldoublev<Abi> floor(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> nearbyint(floatv<Abi> x); -template <class Abi> doublev<Abi> nearbyint(doublev<Abi> x); -template <class Abi> ldoublev<Abi> nearbyint(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> rint(floatv<Abi> x); -template <class Abi> doublev<Abi> rint(doublev<Abi> x); -template <class Abi> ldoublev<Abi> rint(ldoublev<Abi> x); - -template <class Abi> samesize<long int, floatv<Abi>> lrint(floatv<Abi> x); -template <class Abi> samesize<long int, doublev<Abi>> lrint(doublev<Abi> x); -template <class Abi> samesize<long int, ldoublev<Abi>> lrint(ldoublev<Abi> x); -template <class Abi> samesize<long long int, floatv<Abi>> llrint(floatv<Abi> x); -template <class Abi> samesize<long long int, doublev<Abi>> llrint(doublev<Abi> x); -template <class Abi> samesize<long long int, ldoublev<Abi>> llrint(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> round(floatv<Abi> x); -template <class Abi> doublev<Abi> round(doublev<Abi> x); -template <class Abi> ldoublev<Abi> round(ldoublev<Abi> x); -template <class Abi> samesize<long int, floatv<Abi>> lround(floatv<Abi> x); -template <class Abi> samesize<long int, doublev<Abi>> lround(doublev<Abi> x); -template <class Abi> samesize<long int, ldoublev<Abi>> lround(ldoublev<Abi> x); -template <class Abi> samesize<long long int, floatv<Abi>> llround(floatv<Abi> x); -template <class Abi> samesize<long long int, doublev<Abi>> llround(doublev<Abi> x); -template <class Abi> samesize<long long int, ldoublev<Abi>> llround(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> trunc(floatv<Abi> x); -template <class Abi> doublev<Abi> trunc(doublev<Abi> x); -template <class Abi> ldoublev<Abi> trunc(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> fmod(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> fmod(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> fmod(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> remainder(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> remainder(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> remainder(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> remquo(floatv<Abi> x, floatv<Abi> y, samesize<int, floatv<Abi>>* quo); -template <class Abi> doublev<Abi> remquo(doublev<Abi> x, doublev<Abi> y, samesize<int, doublev<Abi>>* quo); -template <class Abi> ldoublev<Abi> remquo(ldoublev<Abi> x, ldoublev<Abi> y, samesize<int, ldoublev<Abi>>* quo); - -template <class Abi> floatv<Abi> copysign(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> copysign(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> copysign(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> doublev<Abi> nan(const char* tagp); -template <class Abi> floatv<Abi> nanf(const char* tagp); -template <class Abi> ldoublev<Abi> nanl(const char* tagp); - -template <class Abi> floatv<Abi> nextafter(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> nextafter(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> nextafter(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> nexttoward(floatv<Abi> x, ldoublev<Abi> y); -template <class Abi> doublev<Abi> nexttoward(doublev<Abi> x, ldoublev<Abi> y); -template <class Abi> ldoublev<Abi> nexttoward(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> fdim(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> fdim(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> fdim(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> fmax(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> fmax(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> fmax(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> fmin(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> fmin(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> fmin(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> fma(floatv<Abi> x, floatv<Abi> y, floatv<Abi> z); -template <class Abi> doublev<Abi> fma(doublev<Abi> x, doublev<Abi> y, doublev<Abi> z); -template <class Abi> ldoublev<Abi> fma(ldoublev<Abi> x, ldoublev<Abi> y, ldoublev<Abi> z); - -template <class Abi> samesize<int, floatv<Abi>> fpclassify(floatv<Abi> x); -template <class Abi> samesize<int, doublev<Abi>> fpclassify(doublev<Abi> x); -template <class Abi> samesize<int, ldoublev<Abi>> fpclassify(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> isfinite(floatv<Abi> x); -template <class Abi> simd_mask<double, Abi> isfinite(doublev<Abi> x); -template <class Abi> simd_mask<long double, Abi> isfinite(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> isinf(floatv<Abi> x); -template <class Abi> simd_mask<double, Abi> isinf(doublev<Abi> x); -template <class Abi> simd_mask<long double, Abi> isinf(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> isnan(floatv<Abi> x); -template <class Abi> simd_mask<double, Abi> isnan(doublev<Abi> x); -template <class Abi> simd_mask<long double, Abi> isnan(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> isnormal(floatv<Abi> x); -template <class Abi> simd_mask<double, Abi> isnormal(doublev<Abi> x); -template <class Abi> simd_mask<long double, Abi> isnormal(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> signbit(floatv<Abi> x); -template <class Abi> simd_mask<double, Abi> signbit(doublev<Abi> x); -template <class Abi> simd_mask<long double, Abi> signbit(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> isgreater(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> isgreater(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> isgreater(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> simd_mask<float, Abi> isgreaterequal(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> isgreaterequal(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> isgreaterequal(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> simd_mask<float, Abi> isless(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> isless(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> isless(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> simd_mask<float, Abi> islessequal(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> islessequal(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> islessequal(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> simd_mask<float, Abi> islessgreater(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> islessgreater(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> islessgreater(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> simd_mask<float, Abi> isunordered(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> isunordered(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> isunordered(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class V> struct simd_div_t { V quot, rem; }; -template <class Abi> simd_div_t<scharv<Abi>> div(scharv<Abi> numer, scharv<Abi> denom); -template <class Abi> simd_div_t<shortv<Abi>> div(shortv<Abi> numer, shortv<Abi> denom); -template <class Abi> simd_div_t<intv<Abi>> div(intv<Abi> numer, intv<Abi> denom); -template <class Abi> simd_div_t<longv<Abi>> div(longv<Abi> numer, longv<Abi> denom); -template <class Abi> simd_div_t<llongv<Abi>> div(llongv<Abi> numer, llongv<Abi> denom); - -// [simd.mask.class] -template <class T, class Abi> -class simd_mask { -public: - using value_type = bool; - using reference = see below; - using simd_type = simd<T, Abi>; - using abi_type = Abi; - static constexpr size_t size() noexcept; - simd_mask() = default; - - // broadcast constructor - explicit simd_mask(value_type) noexcept; - - // implicit type conversion constructor - template <class U> simd_mask(const simd_mask<U, simd_abi::fixed_size<size()>>&) noexcept; - - // load constructor - template <class Flags> simd_mask(const value_type* mem, Flags); - - // loads [simd.mask.copy] - template <class Flags> void copy_from(const value_type* mem, Flags); - template <class Flags> void copy_to(value_type* mem, Flags) const; - - // scalar access [simd.mask.subscr] - reference operator[](size_t); - value_type operator[](size_t) const; - - // unary operators [simd.mask.unary] - simd_mask operator!() const noexcept; - - // simd_mask binary operators [simd.mask.binary] - friend simd_mask operator&&(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator||(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator& (const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator| (const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator^ (const simd_mask&, const simd_mask&) noexcept; - - // simd_mask compound assignment [simd.mask.cassign] - friend simd_mask& operator&=(simd_mask&, const simd_mask&) noexcept; - friend simd_mask& operator|=(simd_mask&, const simd_mask&) noexcept; - friend simd_mask& operator^=(simd_mask&, const simd_mask&) noexcept; - - // simd_mask compares [simd.mask.comparison] - friend simd_mask operator==(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator!=(const simd_mask&, const simd_mask&) noexcept; -}; - -} // parallelism_v2 -} // std::experimental - -*/ - -#include <experimental/__config> +// +//===----------------------------------------------------------------------===// +#ifndef _LIBCPP_EXPERIMENTAL_SIMD +#define _LIBCPP_EXPERIMENTAL_SIMD + +/* + experimental/simd synopsis + +namespace std::experimental { + +inline namespace parallelism_v2 { + +namespace simd_abi { + +struct scalar {}; +template <int N> struct fixed_size {}; +template <typename T> inline constexpr int max_fixed_size = implementation-defined; +template <typename T> using compatible = implementation-defined; +template <typename T> using native = implementation-defined; + +} // simd_abi + +struct element_aligned_tag {}; +struct vector_aligned_tag {}; +template <size_t> struct overaligned_tag {}; +inline constexpr element_aligned_tag element_aligned{}; +inline constexpr vector_aligned_tag vector_aligned{}; +template <size_t N> inline constexpr overaligned_tag<N> overaligned{}; + +// traits [simd.traits] +template <class T> struct is_abi_tag; +template <class T> inline constexpr bool is_abi_tag_v = is_abi_tag<T>::value; + +template <class T> struct is_simd; +template <class T> inline constexpr bool is_simd_v = is_simd<T>::value; + +template <class T> struct is_simd_mask; +template <class T> inline constexpr bool is_simd_mask_v = is_simd_mask<T>::value; + +template <class T> struct is_simd_flag_type; +template <class T> inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<T>::value; + +template <class T, size_t N> struct abi_for_size { using type = see below; }; +template <class T, size_t N> using abi_for_size_t = typename abi_for_size<T, N>::type; + +template <class T, class Abi = simd_abi::compatible<T>> struct simd_size; +template <class T, class Abi = simd_abi::compatible<T>> +inline constexpr size_t simd_size_v = simd_size<T, Abi>::value; + +template <class T, class U = typename T::value_type> struct memory_alignment; +template <class T, class U = typename T::value_type> +inline constexpr size_t memory_alignment_v = memory_alignment<T, U>::value; + +// class template simd [simd.class] +template <class T, class Abi = simd_abi::compatible<T>> class simd; +template <class T> using native_simd = simd<T, simd_abi::native<T>>; +template <class T, int N> using fixed_size_simd = simd<T, simd_abi::fixed_size<N>>; + +// class template simd_mask [simd.mask.class] +template <class T, class Abi = simd_abi::compatible<T>> class simd_mask; +template <class T> using native_simd_mask = simd_mask<T, simd_abi::native<T>>; +template <class T, int N> using fixed_size_simd_mask = simd_mask<T, simd_abi::fixed_size<N>>; + +// casts [simd.casts] +template <class T, class U, class Abi> see below simd_cast(const simd<U, Abi>&); +template <class T, class U, class Abi> see below static_simd_cast(const simd<U, Abi>&); + +template <class T, class Abi> +fixed_size_simd<T, simd_size_v<T, Abi>> to_fixed_size(const simd<T, Abi>&) noexcept; +template <class T, class Abi> +fixed_size_simd_mask<T, simd_size_v<T, Abi>> to_fixed_size(const simd_mask<T, Abi>&) noexcept; +template <class T, size_t N> native_simd<T> to_native(const fixed_size_simd<T, N>&) noexcept; +template <class T, size_t N> +native_simd_mask<T> to_native(const fixed_size_simd_mask<T, N>> &) noexcept; +template <class T, size_t N> simd<T> to_compatible(const fixed_size_simd<T, N>&) noexcept; +template <class T, size_t N> simd_mask<T> to_compatible(const fixed_size_simd_mask<T, N>&) noexcept; + +template <size_t... Sizes, class T, class Abi> +tuple<simd<T, abi_for_size_t<Sizes>>...> split(const simd<T, Abi>&); +template <size_t... Sizes, class T, class Abi> +tuple<simd_mask<T, abi_for_size_t<Sizes>>...> split(const simd_mask<T, Abi>&); +template <class V, class Abi> +array<V, simd_size_v<typename V::value_type, Abi> / V::size()> split( +const simd<typename V::value_type, Abi>&); +template <class V, class Abi> +array<V, simd_size_v<typename V::value_type, Abi> / V::size()> split( +const simd_mask<typename V::value_type, Abi>&); + +template <class T, class... Abis> +simd<T, abi_for_size_t<T, (simd_size_v<T, Abis> + ...)>> concat(const simd<T, Abis>&...); +template <class T, class... Abis> +simd_mask<T, abi_for_size_t<T, (simd_size_v<T, Abis> + ...)>> concat(const simd_mask<T, Abis>&...); + +// reductions [simd.mask.reductions] +template <class T, class Abi> bool all_of(const simd_mask<T, Abi>&) noexcept; +template <class T, class Abi> bool any_of(const simd_mask<T, Abi>&) noexcept; +template <class T, class Abi> bool none_of(const simd_mask<T, Abi>&) noexcept; +template <class T, class Abi> bool some_of(const simd_mask<T, Abi>&) noexcept; +template <class T, class Abi> int popcount(const simd_mask<T, Abi>&) noexcept; +template <class T, class Abi> int find_first_set(const simd_mask<T, Abi>&); +template <class T, class Abi> int find_last_set(const simd_mask<T, Abi>&); + +bool all_of(see below) noexcept; +bool any_of(see below) noexcept; +bool none_of(see below) noexcept; +bool some_of(see below) noexcept; +int popcount(see below) noexcept; +int find_first_set(see below) noexcept; +int find_last_set(see below) noexcept; + +// masked assignment [simd.whereexpr] +template <class M, class T> class const_where_expression; +template <class M, class T> class where_expression; + +// masked assignment [simd.mask.where] +template <class T> struct nodeduce { using type = T; }; // exposition only + +template <class T> using nodeduce_t = typename nodeduce<T>::type; // exposition only + +template <class T, class Abi> +where_expression<simd_mask<T, Abi>, simd<T, Abi>> +where(const typename simd<T, Abi>::mask_type&, simd<T, Abi>&) noexcept; + +template <class T, class Abi> +const_where_expression<simd_mask<T, Abi>, const simd<T, Abi>> +where(const typename simd<T, Abi>::mask_type&, const simd<T, Abi>&) noexcept; + +template <class T, class Abi> +where_expression<simd_mask<T, Abi>, simd_mask<T, Abi>> +where(const nodeduce_t<simd_mask<T, Abi>>&, simd_mask<T, Abi>&) noexcept; + +template <class T, class Abi> +const_where_expression<simd_mask<T, Abi>, const simd_mask<T, Abi>> +where(const nodeduce_t<simd_mask<T, Abi>>&, const simd_mask<T, Abi>&) noexcept; + +template <class T> where_expression<bool, T> where(see below k, T& d) noexcept; + +template <class T> +const_where_expression<bool, const T> where(see below k, const T& d) noexcept; + +// reductions [simd.reductions] +template <class T, class Abi, class BinaryOperation = std::plus<>> +T reduce(const simd<T, Abi>&, BinaryOperation = BinaryOperation()); + +template <class M, class V, class BinaryOperation> +typename V::value_type reduce(const const_where_expression<M, V>& x, +typename V::value_type neutral_element, BinaryOperation binary_op); + +template <class M, class V> +typename V::value_type reduce(const const_where_expression<M, V>& x, plus<> binary_op = plus<>()); + +template <class M, class V> +typename V::value_type reduce(const const_where_expression<M, V>& x, multiplies<> binary_op); + +template <class M, class V> +typename V::value_type reduce(const const_where_expression<M, V>& x, bit_and<> binary_op); + +template <class M, class V> +typename V::value_type reduce(const const_where_expression<M, V>& x, bit_or<> binary_op); + +template <class M, class V> +typename V::value_type reduce(const const_where_expression<M, V>& x, bit_xor<> binary_op); + +template <class T, class Abi> T hmin(const simd<T, Abi>&); +template <class M, class V> T hmin(const const_where_expression<M, V>&); +template <class T, class Abi> T hmax(const simd<T, Abi>&); +template <class M, class V> T hmax(const const_where_expression<M, V>&); + +// algorithms [simd.alg] +template <class T, class Abi> simd<T, Abi> min(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; + +template <class T, class Abi> simd<T, Abi> max(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; + +template <class T, class Abi> +std::pair<simd<T, Abi>, simd<T, Abi>> minmax(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; + +template <class T, class Abi> +simd<T, Abi> clamp(const simd<T, Abi>& v, const simd<T, Abi>& lo, const simd<T, Abi>& hi); + +// [simd.whereexpr] +template <class M, class T> +class const_where_expression { + const M& mask; // exposition only + T& data; // exposition only +public: + const_where_expression(const const_where_expression&) = delete; + const_where_expression& operator=(const const_where_expression&) = delete; + remove_const_t<T> operator-() const &&; + template <class U, class Flags> void copy_to(U* mem, Flags f) const &&; +}; + +template <class M, class T> +class where_expression : public const_where_expression<M, T> { +public: + where_expression(const where_expression&) = delete; + where_expression& operator=(const where_expression&) = delete; + template <class U> void operator=(U&& x); + template <class U> void operator+=(U&& x); + template <class U> void operator-=(U&& x); + template <class U> void operator*=(U&& x); + template <class U> void operator/=(U&& x); + template <class U> void operator%=(U&& x); + template <class U> void operator&=(U&& x); + template <class U> void operator|=(U&& x); + template <class U> void operator^=(U&& x); + template <class U> void operator<<=(U&& x); + template <class U> void operator>>=(U&& x); + void operator++(); + void operator++(int); + void operator--(); + void operator--(int); + template <class U, class Flags> void copy_from(const U* mem, Flags); +}; + +// [simd.class] +template <class T, class Abi> class simd { +public: + using value_type = T; + using reference = see below; + using mask_type = simd_mask<T, Abi>; + + using abi_type = Abi; + static constexpr size_t size() noexcept; + simd() = default; + + // implicit type conversion constructor + template <class U> simd(const simd<U, simd_abi::fixed_size<size()>>&); + + // implicit broadcast constructor (see below for constraints) + template <class U> simd(U&& value); + + // generator constructor (see below for constraints) + template <class G> explicit simd(G&& gen); + + // load constructor + template <class U, class Flags> simd(const U* mem, Flags f); + + // loads [simd.load] + template <class U, class Flags> void copy_from(const U* mem, Flags f); + + // stores [simd.store] + template <class U, class Flags> void copy_to(U* mem, Flags f) const; + + // scalar access [simd.subscr] + reference operator[](size_t); + value_type operator[](size_t) const; + + // unary operators [simd.unary] + simd& operator++(); + simd operator++(int); + simd& operator--(); + simd operator--(int); + mask_type operator!() const; + simd operator~() const; // see below + simd operator+() const; + simd operator-() const; + + // binary operators [simd.binary] + friend simd operator+ (const simd&, const simd&); + friend simd operator- (const simd&, const simd&); + friend simd operator* (const simd&, const simd&); + friend simd operator/ (const simd&, const simd&); + friend simd operator% (const simd&, const simd&); + friend simd operator& (const simd&, const simd&); + friend simd operator| (const simd&, const simd&); + friend simd operator^ (const simd&, const simd&); + friend simd operator<<(const simd&, const simd&); + friend simd operator>>(const simd&, const simd&); + friend simd operator<<(const simd&, int); + friend simd operator>>(const simd&, int); + + // compound assignment [simd.cassign] + friend simd& operator+= (simd&, const simd&); + friend simd& operator-= (simd&, const simd&); + friend simd& operator*= (simd&, const simd&); + friend simd& operator/= (simd&, const simd&); + friend simd& operator%= (simd&, const simd&); + + friend simd& operator&= (simd&, const simd&); + friend simd& operator|= (simd&, const simd&); + friend simd& operator^= (simd&, const simd&); + friend simd& operator<<=(simd&, const simd&); + friend simd& operator>>=(simd&, const simd&); + friend simd& operator<<=(simd&, int); + friend simd& operator>>=(simd&, int); + + // compares [simd.comparison] + friend mask_type operator==(const simd&, const simd&); + friend mask_type operator!=(const simd&, const simd&); + friend mask_type operator>=(const simd&, const simd&); + friend mask_type operator<=(const simd&, const simd&); + friend mask_type operator> (const simd&, const simd&); + friend mask_type operator< (const simd&, const simd&); +}; + +// [simd.math] +template <class Abi> using scharv = simd<signed char, Abi>; // exposition only +template <class Abi> using shortv = simd<short, Abi>; // exposition only +template <class Abi> using intv = simd<int, Abi>; // exposition only +template <class Abi> using longv = simd<long int, Abi>; // exposition only +template <class Abi> using llongv = simd<long long int, Abi>; // exposition only +template <class Abi> using floatv = simd<float, Abi>; // exposition only +template <class Abi> using doublev = simd<double, Abi>; // exposition only +template <class Abi> using ldoublev = simd<long double, Abi>; // exposition only +template <class T, class V> using samesize = fixed_size_simd<T, V::size()>; // exposition only + +template <class Abi> floatv<Abi> acos(floatv<Abi> x); +template <class Abi> doublev<Abi> acos(doublev<Abi> x); +template <class Abi> ldoublev<Abi> acos(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> asin(floatv<Abi> x); +template <class Abi> doublev<Abi> asin(doublev<Abi> x); +template <class Abi> ldoublev<Abi> asin(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> atan(floatv<Abi> x); +template <class Abi> doublev<Abi> atan(doublev<Abi> x); +template <class Abi> ldoublev<Abi> atan(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> atan2(floatv<Abi> y, floatv<Abi> x); +template <class Abi> doublev<Abi> atan2(doublev<Abi> y, doublev<Abi> x); +template <class Abi> ldoublev<Abi> atan2(ldoublev<Abi> y, ldoublev<Abi> x); + +template <class Abi> floatv<Abi> cos(floatv<Abi> x); +template <class Abi> doublev<Abi> cos(doublev<Abi> x); +template <class Abi> ldoublev<Abi> cos(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> sin(floatv<Abi> x); +template <class Abi> doublev<Abi> sin(doublev<Abi> x); +template <class Abi> ldoublev<Abi> sin(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> tan(floatv<Abi> x); +template <class Abi> doublev<Abi> tan(doublev<Abi> x); +template <class Abi> ldoublev<Abi> tan(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> acosh(floatv<Abi> x); +template <class Abi> doublev<Abi> acosh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> acosh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> asinh(floatv<Abi> x); +template <class Abi> doublev<Abi> asinh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> asinh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> atanh(floatv<Abi> x); +template <class Abi> doublev<Abi> atanh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> atanh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> cosh(floatv<Abi> x); +template <class Abi> doublev<Abi> cosh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> cosh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> sinh(floatv<Abi> x); +template <class Abi> doublev<Abi> sinh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> sinh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> tanh(floatv<Abi> x); +template <class Abi> doublev<Abi> tanh(doublev<Abi> x); +template <class Abi> ldoublev<Abi> tanh(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> exp(floatv<Abi> x); +template <class Abi> doublev<Abi> exp(doublev<Abi> x); +template <class Abi> ldoublev<Abi> exp(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> exp2(floatv<Abi> x); +template <class Abi> doublev<Abi> exp2(doublev<Abi> x); +template <class Abi> ldoublev<Abi> exp2(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> expm1(floatv<Abi> x); +template <class Abi> doublev<Abi> expm1(doublev<Abi> x); +template <class Abi> ldoublev<Abi> expm1(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> frexp(floatv<Abi> value, samesize<int, floatv<Abi>>* exp); +template <class Abi> doublev<Abi> frexp(doublev<Abi> value, samesize<int, doublev<Abi>>* exp); +template <class Abi> ldoublev<Abi> frexp(ldoublev<Abi> value, samesize<int, ldoublev<Abi>>* exp); + +template <class Abi> samesize<int, floatv<Abi>> ilogb(floatv<Abi> x); +template <class Abi> samesize<int, doublev<Abi>> ilogb(doublev<Abi> x); +template <class Abi> samesize<int, ldoublev<Abi>> ilogb(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> ldexp(floatv<Abi> x, samesize<int, floatv<Abi>> exp); +template <class Abi> doublev<Abi> ldexp(doublev<Abi> x, samesize<int, doublev<Abi>> exp); +template <class Abi> ldoublev<Abi> ldexp(ldoublev<Abi> x, samesize<int, ldoublev<Abi>> exp); + +template <class Abi> floatv<Abi> log(floatv<Abi> x); +template <class Abi> doublev<Abi> log(doublev<Abi> x); +template <class Abi> ldoublev<Abi> log(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> log10(floatv<Abi> x); +template <class Abi> doublev<Abi> log10(doublev<Abi> x); +template <class Abi> ldoublev<Abi> log10(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> log1p(floatv<Abi> x); +template <class Abi> doublev<Abi> log1p(doublev<Abi> x); +template <class Abi> ldoublev<Abi> log1p(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> log2(floatv<Abi> x); +template <class Abi> doublev<Abi> log2(doublev<Abi> x); +template <class Abi> ldoublev<Abi> log2(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> logb(floatv<Abi> x); +template <class Abi> doublev<Abi> logb(doublev<Abi> x); +template <class Abi> ldoublev<Abi> logb(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> modf(floatv<Abi> value, floatv<Abi>* iptr); +template <class Abi> doublev<Abi> modf(doublev<Abi> value, doublev<Abi>* iptr); +template <class Abi> ldoublev<Abi> modf(ldoublev<Abi> value, ldoublev<Abi>* iptr); + +template <class Abi> floatv<Abi> scalbn(floatv<Abi> x, samesize<int, floatv<Abi>> n); +template <class Abi> doublev<Abi> scalbn(doublev<Abi> x, samesize<int, doublev<Abi>> n); +template <class Abi> ldoublev<Abi> scalbn(ldoublev<Abi> x, samesize<int, ldoublev<Abi>> n); +template <class Abi> floatv<Abi> scalbln(floatv<Abi> x, samesize<long int, floatv<Abi>> n); +template <class Abi> doublev<Abi> scalbln(doublev<Abi> x, samesize<long int, doublev<Abi>> n); +template <class Abi> ldoublev<Abi> scalbln(ldoublev<Abi> x, samesize<long int, ldoublev<Abi>> n); + +template <class Abi> floatv<Abi> cbrt(floatv<Abi> x); +template <class Abi> doublev<Abi> cbrt(doublev<Abi> x); +template <class Abi> ldoublev<Abi> cbrt(ldoublev<Abi> x); + +template <class Abi> scharv<Abi> abs(scharv<Abi> j); +template <class Abi> shortv<Abi> abs(shortv<Abi> j); +template <class Abi> intv<Abi> abs(intv<Abi> j); +template <class Abi> longv<Abi> abs(longv<Abi> j); +template <class Abi> llongv<Abi> abs(llongv<Abi> j); +template <class Abi> floatv<Abi> abs(floatv<Abi> j); +template <class Abi> doublev<Abi> abs(doublev<Abi> j); +template <class Abi> ldoublev<Abi> abs(ldoublev<Abi> j); + +template <class Abi> floatv<Abi> hypot(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y); +template <class Abi> floatv<Abi> hypot(floatv<Abi> x, floatv<Abi> y, floatv<Abi> z); +template <class Abi> doublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y, doublev<Abi> z); +template <class Abi> ldoublev<Abi> hypot(ldoublev<Abi> x, ldoublev<Abi> y, ldoublev<Abi> z); + +template <class Abi> floatv<Abi> pow(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> pow(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> pow(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> sqrt(floatv<Abi> x); +template <class Abi> doublev<Abi> sqrt(doublev<Abi> x); +template <class Abi> ldoublev<Abi> sqrt(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> erf(floatv<Abi> x); +template <class Abi> doublev<Abi> erf(doublev<Abi> x); +template <class Abi> ldoublev<Abi> erf(ldoublev<Abi> x); +template <class Abi> floatv<Abi> erfc(floatv<Abi> x); +template <class Abi> doublev<Abi> erfc(doublev<Abi> x); +template <class Abi> ldoublev<Abi> erfc(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> lgamma(floatv<Abi> x); +template <class Abi> doublev<Abi> lgamma(doublev<Abi> x); +template <class Abi> ldoublev<Abi> lgamma(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> tgamma(floatv<Abi> x); +template <class Abi> doublev<Abi> tgamma(doublev<Abi> x); +template <class Abi> ldoublev<Abi> tgamma(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> ceil(floatv<Abi> x); +template <class Abi> doublev<Abi> ceil(doublev<Abi> x); +template <class Abi> ldoublev<Abi> ceil(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> floor(floatv<Abi> x); +template <class Abi> doublev<Abi> floor(doublev<Abi> x); +template <class Abi> ldoublev<Abi> floor(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> nearbyint(floatv<Abi> x); +template <class Abi> doublev<Abi> nearbyint(doublev<Abi> x); +template <class Abi> ldoublev<Abi> nearbyint(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> rint(floatv<Abi> x); +template <class Abi> doublev<Abi> rint(doublev<Abi> x); +template <class Abi> ldoublev<Abi> rint(ldoublev<Abi> x); + +template <class Abi> samesize<long int, floatv<Abi>> lrint(floatv<Abi> x); +template <class Abi> samesize<long int, doublev<Abi>> lrint(doublev<Abi> x); +template <class Abi> samesize<long int, ldoublev<Abi>> lrint(ldoublev<Abi> x); +template <class Abi> samesize<long long int, floatv<Abi>> llrint(floatv<Abi> x); +template <class Abi> samesize<long long int, doublev<Abi>> llrint(doublev<Abi> x); +template <class Abi> samesize<long long int, ldoublev<Abi>> llrint(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> round(floatv<Abi> x); +template <class Abi> doublev<Abi> round(doublev<Abi> x); +template <class Abi> ldoublev<Abi> round(ldoublev<Abi> x); +template <class Abi> samesize<long int, floatv<Abi>> lround(floatv<Abi> x); +template <class Abi> samesize<long int, doublev<Abi>> lround(doublev<Abi> x); +template <class Abi> samesize<long int, ldoublev<Abi>> lround(ldoublev<Abi> x); +template <class Abi> samesize<long long int, floatv<Abi>> llround(floatv<Abi> x); +template <class Abi> samesize<long long int, doublev<Abi>> llround(doublev<Abi> x); +template <class Abi> samesize<long long int, ldoublev<Abi>> llround(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> trunc(floatv<Abi> x); +template <class Abi> doublev<Abi> trunc(doublev<Abi> x); +template <class Abi> ldoublev<Abi> trunc(ldoublev<Abi> x); + +template <class Abi> floatv<Abi> fmod(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> fmod(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> fmod(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> remainder(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> remainder(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> remainder(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> remquo(floatv<Abi> x, floatv<Abi> y, samesize<int, floatv<Abi>>* quo); +template <class Abi> doublev<Abi> remquo(doublev<Abi> x, doublev<Abi> y, samesize<int, doublev<Abi>>* quo); +template <class Abi> ldoublev<Abi> remquo(ldoublev<Abi> x, ldoublev<Abi> y, samesize<int, ldoublev<Abi>>* quo); + +template <class Abi> floatv<Abi> copysign(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> copysign(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> copysign(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> doublev<Abi> nan(const char* tagp); +template <class Abi> floatv<Abi> nanf(const char* tagp); +template <class Abi> ldoublev<Abi> nanl(const char* tagp); + +template <class Abi> floatv<Abi> nextafter(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> nextafter(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> nextafter(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> nexttoward(floatv<Abi> x, ldoublev<Abi> y); +template <class Abi> doublev<Abi> nexttoward(doublev<Abi> x, ldoublev<Abi> y); +template <class Abi> ldoublev<Abi> nexttoward(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> fdim(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> fdim(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> fdim(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> fmax(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> fmax(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> fmax(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> fmin(floatv<Abi> x, floatv<Abi> y); +template <class Abi> doublev<Abi> fmin(doublev<Abi> x, doublev<Abi> y); +template <class Abi> ldoublev<Abi> fmin(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> floatv<Abi> fma(floatv<Abi> x, floatv<Abi> y, floatv<Abi> z); +template <class Abi> doublev<Abi> fma(doublev<Abi> x, doublev<Abi> y, doublev<Abi> z); +template <class Abi> ldoublev<Abi> fma(ldoublev<Abi> x, ldoublev<Abi> y, ldoublev<Abi> z); + +template <class Abi> samesize<int, floatv<Abi>> fpclassify(floatv<Abi> x); +template <class Abi> samesize<int, doublev<Abi>> fpclassify(doublev<Abi> x); +template <class Abi> samesize<int, ldoublev<Abi>> fpclassify(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> isfinite(floatv<Abi> x); +template <class Abi> simd_mask<double, Abi> isfinite(doublev<Abi> x); +template <class Abi> simd_mask<long double, Abi> isfinite(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> isinf(floatv<Abi> x); +template <class Abi> simd_mask<double, Abi> isinf(doublev<Abi> x); +template <class Abi> simd_mask<long double, Abi> isinf(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> isnan(floatv<Abi> x); +template <class Abi> simd_mask<double, Abi> isnan(doublev<Abi> x); +template <class Abi> simd_mask<long double, Abi> isnan(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> isnormal(floatv<Abi> x); +template <class Abi> simd_mask<double, Abi> isnormal(doublev<Abi> x); +template <class Abi> simd_mask<long double, Abi> isnormal(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> signbit(floatv<Abi> x); +template <class Abi> simd_mask<double, Abi> signbit(doublev<Abi> x); +template <class Abi> simd_mask<long double, Abi> signbit(ldoublev<Abi> x); + +template <class Abi> simd_mask<float, Abi> isgreater(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> isgreater(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> isgreater(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> simd_mask<float, Abi> isgreaterequal(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> isgreaterequal(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> isgreaterequal(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> simd_mask<float, Abi> isless(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> isless(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> isless(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> simd_mask<float, Abi> islessequal(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> islessequal(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> islessequal(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> simd_mask<float, Abi> islessgreater(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> islessgreater(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> islessgreater(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class Abi> simd_mask<float, Abi> isunordered(floatv<Abi> x, floatv<Abi> y); +template <class Abi> simd_mask<double, Abi> isunordered(doublev<Abi> x, doublev<Abi> y); +template <class Abi> simd_mask<long double, Abi> isunordered(ldoublev<Abi> x, ldoublev<Abi> y); + +template <class V> struct simd_div_t { V quot, rem; }; +template <class Abi> simd_div_t<scharv<Abi>> div(scharv<Abi> numer, scharv<Abi> denom); +template <class Abi> simd_div_t<shortv<Abi>> div(shortv<Abi> numer, shortv<Abi> denom); +template <class Abi> simd_div_t<intv<Abi>> div(intv<Abi> numer, intv<Abi> denom); +template <class Abi> simd_div_t<longv<Abi>> div(longv<Abi> numer, longv<Abi> denom); +template <class Abi> simd_div_t<llongv<Abi>> div(llongv<Abi> numer, llongv<Abi> denom); + +// [simd.mask.class] +template <class T, class Abi> +class simd_mask { +public: + using value_type = bool; + using reference = see below; + using simd_type = simd<T, Abi>; + using abi_type = Abi; + static constexpr size_t size() noexcept; + simd_mask() = default; + + // broadcast constructor + explicit simd_mask(value_type) noexcept; + + // implicit type conversion constructor + template <class U> simd_mask(const simd_mask<U, simd_abi::fixed_size<size()>>&) noexcept; + + // load constructor + template <class Flags> simd_mask(const value_type* mem, Flags); + + // loads [simd.mask.copy] + template <class Flags> void copy_from(const value_type* mem, Flags); + template <class Flags> void copy_to(value_type* mem, Flags) const; + + // scalar access [simd.mask.subscr] + reference operator[](size_t); + value_type operator[](size_t) const; + + // unary operators [simd.mask.unary] + simd_mask operator!() const noexcept; + + // simd_mask binary operators [simd.mask.binary] + friend simd_mask operator&&(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator||(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator& (const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator| (const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator^ (const simd_mask&, const simd_mask&) noexcept; + + // simd_mask compound assignment [simd.mask.cassign] + friend simd_mask& operator&=(simd_mask&, const simd_mask&) noexcept; + friend simd_mask& operator|=(simd_mask&, const simd_mask&) noexcept; + friend simd_mask& operator^=(simd_mask&, const simd_mask&) noexcept; + + // simd_mask compares [simd.mask.comparison] + friend simd_mask operator==(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator!=(const simd_mask&, const simd_mask&) noexcept; +}; + +} // parallelism_v2 +} // std::experimental + +*/ + +#include <experimental/__config> #include <algorithm> -#include <array> -#include <cstddef> -#include <functional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - +#include <array> +#include <cstddef> +#include <functional> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + _LIBCPP_PUSH_MACROS #include <__undef_macros> -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD - +_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD + #if _LIBCPP_STD_VER >= 17 -enum class _StorageKind { - _Scalar, - _Array, +enum class _StorageKind { + _Scalar, + _Array, _VecExt, -}; - -template <_StorageKind __kind, int _Np> -struct __simd_abi {}; - -template <class _Tp, class _Abi> +}; + +template <_StorageKind __kind, int _Np> +struct __simd_abi {}; + +template <class _Tp, class _Abi> class __simd_storage {}; - -template <class _Tp, int __num_element> + +template <class _Tp, int __num_element> class __simd_storage<_Tp, __simd_abi<_StorageKind::_Array, __num_element>> { std::array<_Tp, __num_element> __storage_; @@ -693,9 +693,9 @@ public: void __set(size_t __index, _Tp __val) noexcept { __storage_[__index] = __val; } -}; - -template <class _Tp> +}; + +template <class _Tp> class __simd_storage<_Tp, __simd_abi<_StorageKind::_Scalar, 1>> { _Tp __storage_; @@ -710,8 +710,8 @@ public: void __set(size_t __index, _Tp __val) noexcept { (&__storage_)[__index] = __val; } -}; - +}; + #ifndef _LIBCPP_HAS_NO_VECTOR_EXTENSION constexpr size_t __floor_pow_of_2(size_t __val) { @@ -906,43 +906,43 @@ public: } }; -template <class _To, class _From> -constexpr decltype(_To{std::declval<_From>()}, true) -__is_non_narrowing_convertible_impl(_From) { - return true; -} - -template <class _To> -constexpr bool __is_non_narrowing_convertible_impl(...) { - return false; -} - -template <class _From, class _To> -constexpr typename std::enable_if<std::is_arithmetic<_To>::value && - std::is_arithmetic<_From>::value, - bool>::type -__is_non_narrowing_arithmetic_convertible() { - return __is_non_narrowing_convertible_impl<_To>(_From{}); -} - -template <class _From, class _To> -constexpr typename std::enable_if<!(std::is_arithmetic<_To>::value && - std::is_arithmetic<_From>::value), - bool>::type -__is_non_narrowing_arithmetic_convertible() { - return false; -} - -template <class _Tp> -constexpr _Tp __variadic_sum() { - return _Tp{}; -} - -template <class _Tp, class _Up, class... _Args> -constexpr _Tp __variadic_sum(_Up __first, _Args... __rest) { - return static_cast<_Tp>(__first) + __variadic_sum<_Tp>(__rest...); -} - +template <class _To, class _From> +constexpr decltype(_To{std::declval<_From>()}, true) +__is_non_narrowing_convertible_impl(_From) { + return true; +} + +template <class _To> +constexpr bool __is_non_narrowing_convertible_impl(...) { + return false; +} + +template <class _From, class _To> +constexpr typename std::enable_if<std::is_arithmetic<_To>::value && + std::is_arithmetic<_From>::value, + bool>::type +__is_non_narrowing_arithmetic_convertible() { + return __is_non_narrowing_convertible_impl<_To>(_From{}); +} + +template <class _From, class _To> +constexpr typename std::enable_if<!(std::is_arithmetic<_To>::value && + std::is_arithmetic<_From>::value), + bool>::type +__is_non_narrowing_arithmetic_convertible() { + return false; +} + +template <class _Tp> +constexpr _Tp __variadic_sum() { + return _Tp{}; +} + +template <class _Tp, class _Up, class... _Args> +constexpr _Tp __variadic_sum(_Up __first, _Args... __rest) { + return static_cast<_Tp>(__first) + __variadic_sum<_Tp>(__rest...); +} + template <class _Tp> struct __nodeduce { using type = _Tp; @@ -954,22 +954,22 @@ constexpr bool __vectorizable() { !std::is_volatile<_Tp>::value && !std::is_same<_Tp, bool>::value; } -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI - -using scalar = __simd_abi<_StorageKind::_Scalar, 1>; - -template <int _Np> -using fixed_size = __simd_abi<_StorageKind::_Array, _Np>; - -template <class _Tp> +_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD +_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI + +using scalar = __simd_abi<_StorageKind::_Scalar, 1>; + +template <int _Np> +using fixed_size = __simd_abi<_StorageKind::_Array, _Np>; + +template <class _Tp> inline constexpr size_t max_fixed_size = 32; -template <class _Tp> -using compatible = fixed_size<16 / sizeof(_Tp)>; +template <class _Tp> +using compatible = fixed_size<16 / sizeof(_Tp)>; #ifndef _LIBCPP_HAS_NO_VECTOR_EXTENSION -template <class _Tp> +template <class _Tp> using native = __simd_abi<_StorageKind::_VecExt, _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>; #else @@ -977,369 +977,369 @@ template <class _Tp> using native = fixed_size<_Tp, _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>; #endif // _LIBCPP_HAS_NO_VECTOR_EXTENSION - -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD_ABI -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD - -template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> -class simd; -template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> -class simd_mask; - -struct element_aligned_tag {}; -struct vector_aligned_tag {}; -template <size_t> -struct overaligned_tag {}; + +_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD_ABI +_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD + +template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> +class simd; +template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> +class simd_mask; + +struct element_aligned_tag {}; +struct vector_aligned_tag {}; +template <size_t> +struct overaligned_tag {}; inline constexpr element_aligned_tag element_aligned{}; inline constexpr vector_aligned_tag vector_aligned{}; -template <size_t _Np> +template <size_t _Np> inline constexpr overaligned_tag<_Np> overaligned{}; - -// traits [simd.traits] -template <class _Tp> -struct is_abi_tag : std::integral_constant<bool, false> {}; - -template <_StorageKind __kind, int _Np> -struct is_abi_tag<__simd_abi<__kind, _Np>> - : std::integral_constant<bool, true> {}; - -template <class _Tp> -struct is_simd : std::integral_constant<bool, false> {}; - -template <class _Tp, class _Abi> -struct is_simd<simd<_Tp, _Abi>> : std::integral_constant<bool, true> {}; - -template <class _Tp> -struct is_simd_mask : std::integral_constant<bool, false> {}; - -template <class _Tp, class _Abi> -struct is_simd_mask<simd_mask<_Tp, _Abi>> : std::integral_constant<bool, true> { -}; - -template <class _Tp> -struct is_simd_flag_type : std::integral_constant<bool, false> {}; - -template <> -struct is_simd_flag_type<element_aligned_tag> - : std::integral_constant<bool, true> {}; - -template <> -struct is_simd_flag_type<vector_aligned_tag> - : std::integral_constant<bool, true> {}; - -template <size_t _Align> -struct is_simd_flag_type<overaligned_tag<_Align>> - : std::integral_constant<bool, true> {}; - -template <class _Tp> + +// traits [simd.traits] +template <class _Tp> +struct is_abi_tag : std::integral_constant<bool, false> {}; + +template <_StorageKind __kind, int _Np> +struct is_abi_tag<__simd_abi<__kind, _Np>> + : std::integral_constant<bool, true> {}; + +template <class _Tp> +struct is_simd : std::integral_constant<bool, false> {}; + +template <class _Tp, class _Abi> +struct is_simd<simd<_Tp, _Abi>> : std::integral_constant<bool, true> {}; + +template <class _Tp> +struct is_simd_mask : std::integral_constant<bool, false> {}; + +template <class _Tp, class _Abi> +struct is_simd_mask<simd_mask<_Tp, _Abi>> : std::integral_constant<bool, true> { +}; + +template <class _Tp> +struct is_simd_flag_type : std::integral_constant<bool, false> {}; + +template <> +struct is_simd_flag_type<element_aligned_tag> + : std::integral_constant<bool, true> {}; + +template <> +struct is_simd_flag_type<vector_aligned_tag> + : std::integral_constant<bool, true> {}; + +template <size_t _Align> +struct is_simd_flag_type<overaligned_tag<_Align>> + : std::integral_constant<bool, true> {}; + +template <class _Tp> inline constexpr bool is_abi_tag_v = is_abi_tag<_Tp>::value; -template <class _Tp> +template <class _Tp> inline constexpr bool is_simd_v = is_simd<_Tp>::value; -template <class _Tp> +template <class _Tp> inline constexpr bool is_simd_mask_v = is_simd_mask<_Tp>::value; -template <class _Tp> +template <class _Tp> inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<_Tp>::value; -template <class _Tp, size_t _Np> -struct abi_for_size { - using type = simd_abi::fixed_size<_Np>; -}; -template <class _Tp, size_t _Np> -using abi_for_size_t = typename abi_for_size<_Tp, _Np>::type; - -template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> -struct simd_size; - -template <class _Tp, _StorageKind __kind, int _Np> -struct simd_size<_Tp, __simd_abi<__kind, _Np>> - : std::integral_constant<size_t, _Np> { - static_assert( - std::is_arithmetic<_Tp>::value && - !std::is_same<typename std::remove_const<_Tp>::type, bool>::value, - "Element type should be vectorizable"); -}; - +template <class _Tp, size_t _Np> +struct abi_for_size { + using type = simd_abi::fixed_size<_Np>; +}; +template <class _Tp, size_t _Np> +using abi_for_size_t = typename abi_for_size<_Tp, _Np>::type; + +template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> +struct simd_size; + +template <class _Tp, _StorageKind __kind, int _Np> +struct simd_size<_Tp, __simd_abi<__kind, _Np>> + : std::integral_constant<size_t, _Np> { + static_assert( + std::is_arithmetic<_Tp>::value && + !std::is_same<typename std::remove_const<_Tp>::type, bool>::value, + "Element type should be vectorizable"); +}; + // TODO: implement it. -template <class _Tp, class _Up = typename _Tp::value_type> -struct memory_alignment; - -template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> +template <class _Tp, class _Up = typename _Tp::value_type> +struct memory_alignment; + +template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> inline constexpr size_t simd_size_v = simd_size<_Tp, _Abi>::value; - -template <class _Tp, class _Up = typename _Tp::value_type> + +template <class _Tp, class _Up = typename _Tp::value_type> inline constexpr size_t memory_alignment_v = memory_alignment<_Tp, _Up>::value; - -// class template simd [simd.class] -template <class _Tp> -using native_simd = simd<_Tp, simd_abi::native<_Tp>>; -template <class _Tp, int _Np> -using fixed_size_simd = simd<_Tp, simd_abi::fixed_size<_Np>>; - -// class template simd_mask [simd.mask.class] -template <class _Tp> -using native_simd_mask = simd_mask<_Tp, simd_abi::native<_Tp>>; - -template <class _Tp, int _Np> -using fixed_size_simd_mask = simd_mask<_Tp, simd_abi::fixed_size<_Np>>; - -// casts [simd.casts] -template <class _Tp> -struct __static_simd_cast_traits { - template <class _Up, class _Abi> - static simd<_Tp, _Abi> __apply(const simd<_Up, _Abi>& __v); -}; - -template <class _Tp, class _NewAbi> -struct __static_simd_cast_traits<simd<_Tp, _NewAbi>> { - template <class _Up, class _Abi> - static typename std::enable_if<simd<_Up, _Abi>::size() == - simd<_Tp, _NewAbi>::size(), - simd<_Tp, _NewAbi>>::type - __apply(const simd<_Up, _Abi>& __v); -}; - -template <class _Tp> -struct __simd_cast_traits { - template <class _Up, class _Abi> - static typename std::enable_if< - __is_non_narrowing_arithmetic_convertible<_Up, _Tp>(), - simd<_Tp, _Abi>>::type - __apply(const simd<_Up, _Abi>& __v); -}; - -template <class _Tp, class _NewAbi> -struct __simd_cast_traits<simd<_Tp, _NewAbi>> { - template <class _Up, class _Abi> - static typename std::enable_if< - __is_non_narrowing_arithmetic_convertible<_Up, _Tp>() && - simd<_Up, _Abi>::size() == simd<_Tp, _NewAbi>::size(), - simd<_Tp, _NewAbi>>::type - __apply(const simd<_Up, _Abi>& __v); -}; - -template <class _Tp, class _Up, class _Abi> -auto simd_cast(const simd<_Up, _Abi>& __v) - -> decltype(__simd_cast_traits<_Tp>::__apply(__v)) { - return __simd_cast_traits<_Tp>::__apply(__v); -} - -template <class _Tp, class _Up, class _Abi> -auto static_simd_cast(const simd<_Up, _Abi>& __v) - -> decltype(__static_simd_cast_traits<_Tp>::__apply(__v)) { - return __static_simd_cast_traits<_Tp>::__apply(__v); -} - -template <class _Tp, class _Abi> -fixed_size_simd<_Tp, simd_size<_Tp, _Abi>::value> -to_fixed_size(const simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -fixed_size_simd_mask<_Tp, simd_size<_Tp, _Abi>::value> -to_fixed_size(const simd_mask<_Tp, _Abi>&) noexcept; - -template <class _Tp, size_t _Np> -native_simd<_Tp> to_native(const fixed_size_simd<_Tp, _Np>&) noexcept; - -template <class _Tp, size_t _Np> -native_simd_mask<_Tp> to_native(const fixed_size_simd_mask<_Tp, _Np>&) noexcept; - -template <class _Tp, size_t _Np> -simd<_Tp> to_compatible(const fixed_size_simd<_Tp, _Np>&) noexcept; - -template <class _Tp, size_t _Np> -simd_mask<_Tp> to_compatible(const fixed_size_simd_mask<_Tp, _Np>&) noexcept; - -template <size_t... __sizes, class _Tp, class _Abi> -tuple<simd<_Tp, abi_for_size_t<_Tp, __sizes>>...> split(const simd<_Tp, _Abi>&); - -template <size_t... __sizes, class _Tp, class _Abi> -tuple<simd_mask<_Tp, abi_for_size_t<_Tp, __sizes>>...> -split(const simd_mask<_Tp, _Abi>&); - -template <class _SimdType, class _Abi> -array<_SimdType, simd_size<typename _SimdType::value_type, _Abi>::value / - _SimdType::size()> -split(const simd<typename _SimdType::value_type, _Abi>&); - -template <class _SimdType, class _Abi> -array<_SimdType, simd_size<typename _SimdType::value_type, _Abi>::value / - _SimdType::size()> -split(const simd_mask<typename _SimdType::value_type, _Abi>&); - -template <class _Tp, class... _Abis> -simd<_Tp, abi_for_size_t<_Tp, __variadic_sum(simd_size<_Tp, _Abis>::value...)>> -concat(const simd<_Tp, _Abis>&...); - -template <class _Tp, class... _Abis> -simd_mask<_Tp, - abi_for_size_t<_Tp, __variadic_sum(simd_size<_Tp, _Abis>::value...)>> -concat(const simd_mask<_Tp, _Abis>&...); - -// reductions [simd.mask.reductions] -template <class _Tp, class _Abi> -bool all_of(const simd_mask<_Tp, _Abi>&) noexcept; -template <class _Tp, class _Abi> -bool any_of(const simd_mask<_Tp, _Abi>&) noexcept; -template <class _Tp, class _Abi> -bool none_of(const simd_mask<_Tp, _Abi>&) noexcept; -template <class _Tp, class _Abi> -bool some_of(const simd_mask<_Tp, _Abi>&) noexcept; -template <class _Tp, class _Abi> -int popcount(const simd_mask<_Tp, _Abi>&) noexcept; -template <class _Tp, class _Abi> -int find_first_set(const simd_mask<_Tp, _Abi>&); -template <class _Tp, class _Abi> -int find_last_set(const simd_mask<_Tp, _Abi>&); -bool all_of(bool) noexcept; -bool any_of(bool) noexcept; -bool none_of(bool) noexcept; -bool some_of(bool) noexcept; -int popcount(bool) noexcept; -int find_first_set(bool) noexcept; -int find_last_set(bool) noexcept; - -// masked assignment [simd.whereexpr] -template <class _MaskType, class _Tp> -class const_where_expression; -template <class _MaskType, class _Tp> -class where_expression; - -// masked assignment [simd.mask.where] -template <class _Tp, class _Abi> -where_expression<simd_mask<_Tp, _Abi>, simd<_Tp, _Abi>> -where(const typename simd<_Tp, _Abi>::mask_type&, simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -const_where_expression<simd_mask<_Tp, _Abi>, const simd<_Tp, _Abi>> -where(const typename simd<_Tp, _Abi>::mask_type&, - const simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -where_expression<simd_mask<_Tp, _Abi>, simd_mask<_Tp, _Abi>> -where(const typename __nodeduce<simd_mask<_Tp, _Abi>>::type&, - simd_mask<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -const_where_expression<simd_mask<_Tp, _Abi>, const simd_mask<_Tp, _Abi>> -where(const typename __nodeduce<simd_mask<_Tp, _Abi>>::type&, - const simd_mask<_Tp, _Abi>&) noexcept; - -template <class _Tp> -where_expression<bool, _Tp> where(bool, _Tp&) noexcept; - -template <class _Tp> -const_where_expression<bool, const _Tp> where(bool, const _Tp&) noexcept; - -// reductions [simd.reductions] -template <class _Tp, class _Abi, class _BinaryOp = std::plus<_Tp>> -_Tp reduce(const simd<_Tp, _Abi>&, _BinaryOp = _BinaryOp()); - -template <class _MaskType, class _SimdType, class _BinaryOp> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - typename _SimdType::value_type neutral_element, _BinaryOp binary_op); - -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - plus<typename _SimdType::value_type> binary_op = {}); - -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - multiplies<typename _SimdType::value_type> binary_op); - -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - bit_and<typename _SimdType::value_type> binary_op); - -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - bit_or<typename _SimdType::value_type> binary_op); - -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - bit_xor<typename _SimdType::value_type> binary_op); - -template <class _Tp, class _Abi> -_Tp hmin(const simd<_Tp, _Abi>&); -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -hmin(const const_where_expression<_MaskType, _SimdType>&); -template <class _Tp, class _Abi> -_Tp hmax(const simd<_Tp, _Abi>&); -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -hmax(const const_where_expression<_MaskType, _SimdType>&); - -// algorithms [simd.alg] -template <class _Tp, class _Abi> -simd<_Tp, _Abi> min(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -simd<_Tp, _Abi> max(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -std::pair<simd<_Tp, _Abi>, simd<_Tp, _Abi>> -minmax(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -simd<_Tp, _Abi> clamp(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&, - const simd<_Tp, _Abi>&); - -// [simd.whereexpr] -// TODO implement where expressions. -template <class _MaskType, class _Tp> -class const_where_expression { -public: - const_where_expression(const const_where_expression&) = delete; - const_where_expression& operator=(const const_where_expression&) = delete; - typename remove_const<_Tp>::type operator-() const&&; - template <class _Up, class _Flags> - void copy_to(_Up*, _Flags) const&&; -}; - -template <class _MaskType, class _Tp> -class where_expression : public const_where_expression<_MaskType, _Tp> { -public: - where_expression(const where_expression&) = delete; - where_expression& operator=(const where_expression&) = delete; - template <class _Up> - void operator=(_Up&&); - template <class _Up> - void operator+=(_Up&&); - template <class _Up> - void operator-=(_Up&&); - template <class _Up> - void operator*=(_Up&&); - template <class _Up> - void operator/=(_Up&&); - template <class _Up> - void operator%=(_Up&&); - template <class _Up> - void operator&=(_Up&&); - template <class _Up> - void operator|=(_Up&&); - template <class _Up> - void operator^=(_Up&&); - template <class _Up> - void operator<<=(_Up&&); - template <class _Up> - void operator>>=(_Up&&); - void operator++(); - void operator++(int); - void operator--(); - void operator--(int); - template <class _Up, class _Flags> - void copy_from(const _Up*, _Flags); -}; - -// [simd.class] -// TODO: implement simd -template <class _Tp, class _Abi> -class simd { + +// class template simd [simd.class] +template <class _Tp> +using native_simd = simd<_Tp, simd_abi::native<_Tp>>; +template <class _Tp, int _Np> +using fixed_size_simd = simd<_Tp, simd_abi::fixed_size<_Np>>; + +// class template simd_mask [simd.mask.class] +template <class _Tp> +using native_simd_mask = simd_mask<_Tp, simd_abi::native<_Tp>>; + +template <class _Tp, int _Np> +using fixed_size_simd_mask = simd_mask<_Tp, simd_abi::fixed_size<_Np>>; + +// casts [simd.casts] +template <class _Tp> +struct __static_simd_cast_traits { + template <class _Up, class _Abi> + static simd<_Tp, _Abi> __apply(const simd<_Up, _Abi>& __v); +}; + +template <class _Tp, class _NewAbi> +struct __static_simd_cast_traits<simd<_Tp, _NewAbi>> { + template <class _Up, class _Abi> + static typename std::enable_if<simd<_Up, _Abi>::size() == + simd<_Tp, _NewAbi>::size(), + simd<_Tp, _NewAbi>>::type + __apply(const simd<_Up, _Abi>& __v); +}; + +template <class _Tp> +struct __simd_cast_traits { + template <class _Up, class _Abi> + static typename std::enable_if< + __is_non_narrowing_arithmetic_convertible<_Up, _Tp>(), + simd<_Tp, _Abi>>::type + __apply(const simd<_Up, _Abi>& __v); +}; + +template <class _Tp, class _NewAbi> +struct __simd_cast_traits<simd<_Tp, _NewAbi>> { + template <class _Up, class _Abi> + static typename std::enable_if< + __is_non_narrowing_arithmetic_convertible<_Up, _Tp>() && + simd<_Up, _Abi>::size() == simd<_Tp, _NewAbi>::size(), + simd<_Tp, _NewAbi>>::type + __apply(const simd<_Up, _Abi>& __v); +}; + +template <class _Tp, class _Up, class _Abi> +auto simd_cast(const simd<_Up, _Abi>& __v) + -> decltype(__simd_cast_traits<_Tp>::__apply(__v)) { + return __simd_cast_traits<_Tp>::__apply(__v); +} + +template <class _Tp, class _Up, class _Abi> +auto static_simd_cast(const simd<_Up, _Abi>& __v) + -> decltype(__static_simd_cast_traits<_Tp>::__apply(__v)) { + return __static_simd_cast_traits<_Tp>::__apply(__v); +} + +template <class _Tp, class _Abi> +fixed_size_simd<_Tp, simd_size<_Tp, _Abi>::value> +to_fixed_size(const simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +fixed_size_simd_mask<_Tp, simd_size<_Tp, _Abi>::value> +to_fixed_size(const simd_mask<_Tp, _Abi>&) noexcept; + +template <class _Tp, size_t _Np> +native_simd<_Tp> to_native(const fixed_size_simd<_Tp, _Np>&) noexcept; + +template <class _Tp, size_t _Np> +native_simd_mask<_Tp> to_native(const fixed_size_simd_mask<_Tp, _Np>&) noexcept; + +template <class _Tp, size_t _Np> +simd<_Tp> to_compatible(const fixed_size_simd<_Tp, _Np>&) noexcept; + +template <class _Tp, size_t _Np> +simd_mask<_Tp> to_compatible(const fixed_size_simd_mask<_Tp, _Np>&) noexcept; + +template <size_t... __sizes, class _Tp, class _Abi> +tuple<simd<_Tp, abi_for_size_t<_Tp, __sizes>>...> split(const simd<_Tp, _Abi>&); + +template <size_t... __sizes, class _Tp, class _Abi> +tuple<simd_mask<_Tp, abi_for_size_t<_Tp, __sizes>>...> +split(const simd_mask<_Tp, _Abi>&); + +template <class _SimdType, class _Abi> +array<_SimdType, simd_size<typename _SimdType::value_type, _Abi>::value / + _SimdType::size()> +split(const simd<typename _SimdType::value_type, _Abi>&); + +template <class _SimdType, class _Abi> +array<_SimdType, simd_size<typename _SimdType::value_type, _Abi>::value / + _SimdType::size()> +split(const simd_mask<typename _SimdType::value_type, _Abi>&); + +template <class _Tp, class... _Abis> +simd<_Tp, abi_for_size_t<_Tp, __variadic_sum(simd_size<_Tp, _Abis>::value...)>> +concat(const simd<_Tp, _Abis>&...); + +template <class _Tp, class... _Abis> +simd_mask<_Tp, + abi_for_size_t<_Tp, __variadic_sum(simd_size<_Tp, _Abis>::value...)>> +concat(const simd_mask<_Tp, _Abis>&...); + +// reductions [simd.mask.reductions] +template <class _Tp, class _Abi> +bool all_of(const simd_mask<_Tp, _Abi>&) noexcept; +template <class _Tp, class _Abi> +bool any_of(const simd_mask<_Tp, _Abi>&) noexcept; +template <class _Tp, class _Abi> +bool none_of(const simd_mask<_Tp, _Abi>&) noexcept; +template <class _Tp, class _Abi> +bool some_of(const simd_mask<_Tp, _Abi>&) noexcept; +template <class _Tp, class _Abi> +int popcount(const simd_mask<_Tp, _Abi>&) noexcept; +template <class _Tp, class _Abi> +int find_first_set(const simd_mask<_Tp, _Abi>&); +template <class _Tp, class _Abi> +int find_last_set(const simd_mask<_Tp, _Abi>&); +bool all_of(bool) noexcept; +bool any_of(bool) noexcept; +bool none_of(bool) noexcept; +bool some_of(bool) noexcept; +int popcount(bool) noexcept; +int find_first_set(bool) noexcept; +int find_last_set(bool) noexcept; + +// masked assignment [simd.whereexpr] +template <class _MaskType, class _Tp> +class const_where_expression; +template <class _MaskType, class _Tp> +class where_expression; + +// masked assignment [simd.mask.where] +template <class _Tp, class _Abi> +where_expression<simd_mask<_Tp, _Abi>, simd<_Tp, _Abi>> +where(const typename simd<_Tp, _Abi>::mask_type&, simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +const_where_expression<simd_mask<_Tp, _Abi>, const simd<_Tp, _Abi>> +where(const typename simd<_Tp, _Abi>::mask_type&, + const simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +where_expression<simd_mask<_Tp, _Abi>, simd_mask<_Tp, _Abi>> +where(const typename __nodeduce<simd_mask<_Tp, _Abi>>::type&, + simd_mask<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +const_where_expression<simd_mask<_Tp, _Abi>, const simd_mask<_Tp, _Abi>> +where(const typename __nodeduce<simd_mask<_Tp, _Abi>>::type&, + const simd_mask<_Tp, _Abi>&) noexcept; + +template <class _Tp> +where_expression<bool, _Tp> where(bool, _Tp&) noexcept; + +template <class _Tp> +const_where_expression<bool, const _Tp> where(bool, const _Tp&) noexcept; + +// reductions [simd.reductions] +template <class _Tp, class _Abi, class _BinaryOp = std::plus<_Tp>> +_Tp reduce(const simd<_Tp, _Abi>&, _BinaryOp = _BinaryOp()); + +template <class _MaskType, class _SimdType, class _BinaryOp> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + typename _SimdType::value_type neutral_element, _BinaryOp binary_op); + +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + plus<typename _SimdType::value_type> binary_op = {}); + +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + multiplies<typename _SimdType::value_type> binary_op); + +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + bit_and<typename _SimdType::value_type> binary_op); + +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + bit_or<typename _SimdType::value_type> binary_op); + +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +reduce(const const_where_expression<_MaskType, _SimdType>&, + bit_xor<typename _SimdType::value_type> binary_op); + +template <class _Tp, class _Abi> +_Tp hmin(const simd<_Tp, _Abi>&); +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +hmin(const const_where_expression<_MaskType, _SimdType>&); +template <class _Tp, class _Abi> +_Tp hmax(const simd<_Tp, _Abi>&); +template <class _MaskType, class _SimdType> +typename _SimdType::value_type +hmax(const const_where_expression<_MaskType, _SimdType>&); + +// algorithms [simd.alg] +template <class _Tp, class _Abi> +simd<_Tp, _Abi> min(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +simd<_Tp, _Abi> max(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +std::pair<simd<_Tp, _Abi>, simd<_Tp, _Abi>> +minmax(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; + +template <class _Tp, class _Abi> +simd<_Tp, _Abi> clamp(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&, + const simd<_Tp, _Abi>&); + +// [simd.whereexpr] +// TODO implement where expressions. +template <class _MaskType, class _Tp> +class const_where_expression { +public: + const_where_expression(const const_where_expression&) = delete; + const_where_expression& operator=(const const_where_expression&) = delete; + typename remove_const<_Tp>::type operator-() const&&; + template <class _Up, class _Flags> + void copy_to(_Up*, _Flags) const&&; +}; + +template <class _MaskType, class _Tp> +class where_expression : public const_where_expression<_MaskType, _Tp> { +public: + where_expression(const where_expression&) = delete; + where_expression& operator=(const where_expression&) = delete; + template <class _Up> + void operator=(_Up&&); + template <class _Up> + void operator+=(_Up&&); + template <class _Up> + void operator-=(_Up&&); + template <class _Up> + void operator*=(_Up&&); + template <class _Up> + void operator/=(_Up&&); + template <class _Up> + void operator%=(_Up&&); + template <class _Up> + void operator&=(_Up&&); + template <class _Up> + void operator|=(_Up&&); + template <class _Up> + void operator^=(_Up&&); + template <class _Up> + void operator<<=(_Up&&); + template <class _Up> + void operator>>=(_Up&&); + void operator++(); + void operator++(int); + void operator--(); + void operator--(int); + template <class _Up, class _Flags> + void copy_from(const _Up*, _Flags); +}; + +// [simd.class] +// TODO: implement simd +template <class _Tp, class _Abi> +class simd { public: using value_type = _Tp; using reference = __simd_reference<_Tp, _Tp, _Abi>; @@ -1354,21 +1354,21 @@ public: return simd_size<_Tp, _Abi>::value; } -private: +private: __simd_storage<_Tp, _Abi> __s_; - template <class _Up> - static constexpr bool __can_broadcast() { - return (std::is_arithmetic<_Up>::value && - __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()) || - (!std::is_arithmetic<_Up>::value && - std::is_convertible<_Up, _Tp>::value) || - std::is_same<typename std::remove_const<_Up>::type, int>::value || - (std::is_same<typename std::remove_const<_Up>::type, - unsigned int>::value && - std::is_unsigned<_Tp>::value); - } - + template <class _Up> + static constexpr bool __can_broadcast() { + return (std::is_arithmetic<_Up>::value && + __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()) || + (!std::is_arithmetic<_Up>::value && + std::is_convertible<_Up, _Tp>::value) || + std::is_same<typename std::remove_const<_Up>::type, int>::value || + (std::is_same<typename std::remove_const<_Up>::type, + unsigned int>::value && + std::is_unsigned<_Tp>::value); + } + template <class _Generator, size_t... __indicies> static constexpr decltype( std::forward_as_tuple(std::declval<_Generator>()( @@ -1379,44 +1379,44 @@ private: !__can_broadcast<decltype(std::declval<_Generator>()( std::integral_constant<size_t, __indicies>()))>()...); } - + template <class _Generator> static bool __can_generate(...) { return false; } - + template <class _Generator, size_t... __indicies> void __generator_init(_Generator&& __g, std::index_sequence<__indicies...>) { int __not_used[]{((*this)[__indicies] = __g(std::integral_constant<size_t, __indicies>()), 0)...}; (void)__not_used; - } - + } + public: - // implicit type conversion constructor - template <class _Up, - class = typename std::enable_if< - std::is_same<_Abi, simd_abi::fixed_size<size()>>::value && - __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()>::type> + // implicit type conversion constructor + template <class _Up, + class = typename std::enable_if< + std::is_same<_Abi, simd_abi::fixed_size<size()>>::value && + __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()>::type> simd(const simd<_Up, simd_abi::fixed_size<size()>>& __v) { for (size_t __i = 0; __i < size(); __i++) { (*this)[__i] = static_cast<_Tp>(__v[__i]); } } - - // implicit broadcast constructor - template <class _Up, - class = typename std::enable_if<__can_broadcast<_Up>()>::type> + + // implicit broadcast constructor + template <class _Up, + class = typename std::enable_if<__can_broadcast<_Up>()>::type> simd(_Up&& __rv) { auto __v = static_cast<_Tp>(__rv); for (size_t __i = 0; __i < size(); __i++) { (*this)[__i] = __v; } } - - // generator constructor - template <class _Generator, + + // generator constructor + template <class _Generator, int = typename std::enable_if< __can_generate<_Generator>(std::make_index_sequence<size()>()), int>::type()> @@ -1424,8 +1424,8 @@ public: __generator_init(std::forward<_Generator>(__g), std::make_index_sequence<size()>()); } - - // load constructor + + // load constructor template < class _Up, class _Flags, class = typename std::enable_if<__vectorizable<_Up>()>::type, @@ -1436,17 +1436,17 @@ public: (*this)[__i] = static_cast<_Tp>(__buffer[__i]); } } - - // loads [simd.load] - template <class _Up, class _Flags> + + // loads [simd.load] + template <class _Up, class _Flags> typename std::enable_if<__vectorizable<_Up>() && is_simd_flag_type<_Flags>::value>::type copy_from(const _Up* __buffer, _Flags) { *this = simd(__buffer, _Flags()); } - - // stores [simd.store] - template <class _Up, class _Flags> + + // stores [simd.store] + template <class _Up, class _Flags> typename std::enable_if<__vectorizable<_Up>() && is_simd_flag_type<_Flags>::value>::type copy_to(_Up* __buffer, _Flags) const { @@ -1455,118 +1455,118 @@ public: __buffer[__i] = static_cast<_Up>((*this)[__i]); } } - - // scalar access [simd.subscr] + + // scalar access [simd.subscr] reference operator[](size_t __i) { return reference(&__s_, __i); } - + value_type operator[](size_t __i) const { return __s_.__get(__i); } - // unary operators [simd.unary] - simd& operator++(); - simd operator++(int); - simd& operator--(); - simd operator--(int); - mask_type operator!() const; - simd operator~() const; - simd operator+() const; - simd operator-() const; - - // binary operators [simd.binary] - friend simd operator+(const simd&, const simd&); - friend simd operator-(const simd&, const simd&); - friend simd operator*(const simd&, const simd&); - friend simd operator/(const simd&, const simd&); - friend simd operator%(const simd&, const simd&); - friend simd operator&(const simd&, const simd&); - friend simd operator|(const simd&, const simd&); - friend simd operator^(const simd&, const simd&); - friend simd operator<<(const simd&, const simd&); - friend simd operator>>(const simd&, const simd&); - friend simd operator<<(const simd&, int); - friend simd operator>>(const simd&, int); - - // compound assignment [simd.cassign] - friend simd& operator+=(simd&, const simd&); - friend simd& operator-=(simd&, const simd&); - friend simd& operator*=(simd&, const simd&); - friend simd& operator/=(simd&, const simd&); - friend simd& operator%=(simd&, const simd&); - - friend simd& operator&=(simd&, const simd&); - friend simd& operator|=(simd&, const simd&); - friend simd& operator^=(simd&, const simd&); - friend simd& operator<<=(simd&, const simd&); - friend simd& operator>>=(simd&, const simd&); - friend simd& operator<<=(simd&, int); - friend simd& operator>>=(simd&, int); - - // compares [simd.comparison] - friend mask_type operator==(const simd&, const simd&); - friend mask_type operator!=(const simd&, const simd&); - friend mask_type operator>=(const simd&, const simd&); - friend mask_type operator<=(const simd&, const simd&); - friend mask_type operator>(const simd&, const simd&); - friend mask_type operator<(const simd&, const simd&); -}; - -// [simd.mask.class] -template <class _Tp, class _Abi> -// TODO: implement simd_mask -class simd_mask { -public: - using value_type = bool; - // TODO: this is strawman implementation. Turn it into a proxy type. - using reference = bool&; - using simd_type = simd<_Tp, _Abi>; - using abi_type = _Abi; - static constexpr size_t size() noexcept; - simd_mask() = default; - - // broadcast constructor - explicit simd_mask(value_type) noexcept; - - // implicit type conversion constructor - template <class _Up> - simd_mask(const simd_mask<_Up, simd_abi::fixed_size<size()>>&) noexcept; - - // load constructor - template <class _Flags> - simd_mask(const value_type*, _Flags); - - // loads [simd.mask.copy] - template <class _Flags> - void copy_from(const value_type*, _Flags); - template <class _Flags> - void copy_to(value_type*, _Flags) const; - - // scalar access [simd.mask.subscr] - reference operator[](size_t); - value_type operator[](size_t) const; - - // unary operators [simd.mask.unary] - simd_mask operator!() const noexcept; - - // simd_mask binary operators [simd.mask.binary] - friend simd_mask operator&&(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator||(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator&(const simd_mask&, const simd_mask&)noexcept; - friend simd_mask operator|(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator^(const simd_mask&, const simd_mask&) noexcept; - - // simd_mask compound assignment [simd.mask.cassign] - friend simd_mask& operator&=(simd_mask&, const simd_mask&) noexcept; - friend simd_mask& operator|=(simd_mask&, const simd_mask&) noexcept; - friend simd_mask& operator^=(simd_mask&, const simd_mask&) noexcept; - - // simd_mask compares [simd.mask.comparison] - friend simd_mask operator==(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator!=(const simd_mask&, const simd_mask&) noexcept; -}; - + // unary operators [simd.unary] + simd& operator++(); + simd operator++(int); + simd& operator--(); + simd operator--(int); + mask_type operator!() const; + simd operator~() const; + simd operator+() const; + simd operator-() const; + + // binary operators [simd.binary] + friend simd operator+(const simd&, const simd&); + friend simd operator-(const simd&, const simd&); + friend simd operator*(const simd&, const simd&); + friend simd operator/(const simd&, const simd&); + friend simd operator%(const simd&, const simd&); + friend simd operator&(const simd&, const simd&); + friend simd operator|(const simd&, const simd&); + friend simd operator^(const simd&, const simd&); + friend simd operator<<(const simd&, const simd&); + friend simd operator>>(const simd&, const simd&); + friend simd operator<<(const simd&, int); + friend simd operator>>(const simd&, int); + + // compound assignment [simd.cassign] + friend simd& operator+=(simd&, const simd&); + friend simd& operator-=(simd&, const simd&); + friend simd& operator*=(simd&, const simd&); + friend simd& operator/=(simd&, const simd&); + friend simd& operator%=(simd&, const simd&); + + friend simd& operator&=(simd&, const simd&); + friend simd& operator|=(simd&, const simd&); + friend simd& operator^=(simd&, const simd&); + friend simd& operator<<=(simd&, const simd&); + friend simd& operator>>=(simd&, const simd&); + friend simd& operator<<=(simd&, int); + friend simd& operator>>=(simd&, int); + + // compares [simd.comparison] + friend mask_type operator==(const simd&, const simd&); + friend mask_type operator!=(const simd&, const simd&); + friend mask_type operator>=(const simd&, const simd&); + friend mask_type operator<=(const simd&, const simd&); + friend mask_type operator>(const simd&, const simd&); + friend mask_type operator<(const simd&, const simd&); +}; + +// [simd.mask.class] +template <class _Tp, class _Abi> +// TODO: implement simd_mask +class simd_mask { +public: + using value_type = bool; + // TODO: this is strawman implementation. Turn it into a proxy type. + using reference = bool&; + using simd_type = simd<_Tp, _Abi>; + using abi_type = _Abi; + static constexpr size_t size() noexcept; + simd_mask() = default; + + // broadcast constructor + explicit simd_mask(value_type) noexcept; + + // implicit type conversion constructor + template <class _Up> + simd_mask(const simd_mask<_Up, simd_abi::fixed_size<size()>>&) noexcept; + + // load constructor + template <class _Flags> + simd_mask(const value_type*, _Flags); + + // loads [simd.mask.copy] + template <class _Flags> + void copy_from(const value_type*, _Flags); + template <class _Flags> + void copy_to(value_type*, _Flags) const; + + // scalar access [simd.mask.subscr] + reference operator[](size_t); + value_type operator[](size_t) const; + + // unary operators [simd.mask.unary] + simd_mask operator!() const noexcept; + + // simd_mask binary operators [simd.mask.binary] + friend simd_mask operator&&(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator||(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator&(const simd_mask&, const simd_mask&)noexcept; + friend simd_mask operator|(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator^(const simd_mask&, const simd_mask&) noexcept; + + // simd_mask compound assignment [simd.mask.cassign] + friend simd_mask& operator&=(simd_mask&, const simd_mask&) noexcept; + friend simd_mask& operator|=(simd_mask&, const simd_mask&) noexcept; + friend simd_mask& operator^=(simd_mask&, const simd_mask&) noexcept; + + // simd_mask compares [simd.mask.comparison] + friend simd_mask operator==(const simd_mask&, const simd_mask&) noexcept; + friend simd_mask operator!=(const simd_mask&, const simd_mask&) noexcept; +}; + #endif // _LIBCPP_STD_VER >= 17 -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD - +_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD + _LIBCPP_POP_MACROS -#endif /* _LIBCPP_EXPERIMENTAL_SIMD */ +#endif /* _LIBCPP_EXPERIMENTAL_SIMD */ diff --git a/contrib/libs/cxxsupp/libcxx/include/functional b/contrib/libs/cxxsupp/libcxx/include/functional index 53a5f2bc37..d6b1ec05ab 100644 --- a/contrib/libs/cxxsupp/libcxx/include/functional +++ b/contrib/libs/cxxsupp/libcxx/include/functional @@ -462,7 +462,7 @@ template <> struct hash<bool>; template <> struct hash<char>; template <> struct hash<signed char>; template <> struct hash<unsigned char>; -template <> struct hash<char8_t>; // since C++20 +template <> struct hash<char8_t>; // since C++20 template <> struct hash<char16_t>; template <> struct hash<char32_t>; template <> struct hash<wchar_t>; diff --git a/contrib/libs/cxxsupp/libcxx/include/locale b/contrib/libs/cxxsupp/libcxx/include/locale index 242790a9d4..15b6e96b22 100644 --- a/contrib/libs/cxxsupp/libcxx/include/locale +++ b/contrib/libs/cxxsupp/libcxx/include/locale @@ -2636,12 +2636,12 @@ public: : time_put<_CharT, _OutputIterator>(__nm, __refs) {} protected: -#if defined(_MSC_VER) && defined(__clang__) - ~time_put_byname() {} -#else +#if defined(_MSC_VER) && defined(__clang__) + ~time_put_byname() {} +#else _LIBCPP_INLINE_VISIBILITY ~time_put_byname() {} -#endif +#endif }; _LIBCPP_EXTERN_TEMPLATE_EVEN_IN_DEBUG_MODE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname<char>) diff --git a/contrib/libs/cxxsupp/libcxx/include/span b/contrib/libs/cxxsupp/libcxx/include/span index 5d57bd693c..54c7cacf28 100644 --- a/contrib/libs/cxxsupp/libcxx/include/span +++ b/contrib/libs/cxxsupp/libcxx/include/span @@ -550,7 +550,7 @@ public: constexpr span<element_type, dynamic_extent> _LIBCPP_INLINE_VISIBILITY - subspan(size_type __offset, size_type __count = dynamic_extent) const noexcept + subspan(size_type __offset, size_type __count = dynamic_extent) const noexcept { _LIBCPP_ASSERT(__offset <= size(), "Offset out of range in span::subspan(offset, count)"); _LIBCPP_ASSERT(__count <= size() || __count == dynamic_extent, "count out of range in span::subspan(offset, count)"); diff --git a/contrib/libs/cxxsupp/libcxx/include/string b/contrib/libs/cxxsupp/libcxx/include/string index 4f3309fea9..1a41d7285f 100644 --- a/contrib/libs/cxxsupp/libcxx/include/string +++ b/contrib/libs/cxxsupp/libcxx/include/string @@ -683,7 +683,7 @@ class basic_string : private __basic_string_common<true> // This base class is historical, but it needs to remain for ABI compatibility { - static_assert(sizeof(_CharT) <= 4, "libc++ implementation of std::basic_string does not support extra-wide character types"); + static_assert(sizeof(_CharT) <= 4, "libc++ implementation of std::basic_string does not support extra-wide character types"); public: typedef basic_string __self; typedef basic_string_view<_CharT, _Traits> __self_view; @@ -706,13 +706,13 @@ public: static_assert(( is_same<typename allocator_type::value_type, value_type>::value), "Allocator::value_type must be same type as value_type"); -#if _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS == 1 +#if _YNDX_LIBCPP_MAKE_STRING_ITERATOR_POINTERS == 1 typedef pointer iterator; typedef const_pointer const_iterator; -#else +#else typedef __wrap_iter<pointer> iterator; typedef __wrap_iter<const_pointer> const_iterator; -#endif +#endif typedef _VSTD::reverse_iterator<iterator> reverse_iterator; typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator; @@ -835,9 +835,9 @@ public: basic_string(basic_string&& __str, const allocator_type& __a); #endif // _LIBCPP_CXX03_LANG - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - basic_string(nullptr_t) = delete; - + _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY + basic_string(nullptr_t) = delete; + template <class = __enable_if_t<__is_allocator<_Allocator>::value, nullptr_t> > _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s) : __r_(__default_init_tag(), __default_init_tag()) { @@ -852,18 +852,18 @@ public: _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s, const _Allocator& __a); - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - basic_string(nullptr_t, size_t) = delete; - + _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY + basic_string(nullptr_t, size_t) = delete; + _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s, size_type __n); - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - basic_string(nullptr_t, size_t, const _Allocator&) = delete; - + + _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY + basic_string(nullptr_t, size_t, const _Allocator&) = delete; + _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s, size_type __n, const _Allocator& __a); - + _LIBCPP_INLINE_VISIBILITY basic_string(size_type __n, _CharT __c); @@ -911,8 +911,8 @@ public: basic_string& operator=(const basic_string& __str); - basic_string& operator=(nullptr_t) = delete; - + basic_string& operator=(nullptr_t) = delete; + template <class _Tp, class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value && !__is_same_uncvref<_Tp, basic_string>::value> > basic_string& operator=(const _Tp& __t) {__self_view __sv = __t; return assign(__sv);} @@ -991,14 +991,14 @@ public: {return (__is_long() ? __get_long_cap() : static_cast<size_type>(__min_cap)) - 1;} - -#if _YNDX_LIBCXX_ENABLE_STRING_RESIZE_UNINITIALIZED == 1 - inline void resize_uninitialized(size_type __n) - { - __resize_default_init(__n); - } -#endif - + +#if _YNDX_LIBCXX_ENABLE_STRING_RESIZE_UNINITIALIZED == 1 + inline void resize_uninitialized(size_type __n) + { + __resize_default_init(__n); + } +#endif + void resize(size_type __n, value_type __c); _LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());} @@ -1425,8 +1425,8 @@ public: int compare(size_type __pos1, size_type __n1, const value_type* __s) const; int compare(size_type __pos1, size_type __n1, const value_type* __s, size_type __n2) const; -//WARN: disabled std guards in order to allow using these options without switching to new std -//#if _LIBCPP_STD_VER > 17 +//WARN: disabled std guards in order to allow using these options without switching to new std +//#if _LIBCPP_STD_VER > 17 constexpr _LIBCPP_INLINE_VISIBILITY bool starts_with(__self_view __sv) const noexcept { return __self_view(data(), size()).starts_with(__sv); } @@ -1450,7 +1450,7 @@ public: constexpr _LIBCPP_INLINE_VISIBILITY bool ends_with(const value_type* __s) const noexcept { return ends_with(__self_view(__s)); } -//#endif +//#endif #if _LIBCPP_STD_VER > 20 constexpr _LIBCPP_INLINE_VISIBILITY diff --git a/contrib/libs/cxxsupp/libcxx/include/string_view b/contrib/libs/cxxsupp/libcxx/include/string_view index 8df3ff297c..56461f099c 100644 --- a/contrib/libs/cxxsupp/libcxx/include/string_view +++ b/contrib/libs/cxxsupp/libcxx/include/string_view @@ -277,9 +277,9 @@ public: basic_string_view& operator=(const basic_string_view&) _NOEXCEPT = default; _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - basic_string_view(nullptr_t, size_t) = delete; - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY + basic_string_view(nullptr_t, size_t) = delete; + + _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY basic_string_view(const _CharT* __s, size_type __len) _NOEXCEPT : __data(__s), __size(__len) { @@ -299,9 +299,9 @@ public: #endif _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY - basic_string_view(nullptr_t) = delete; - - _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY + basic_string_view(nullptr_t) = delete; + + _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY basic_string_view(const _CharT* __s) : __data(__s), __size(_VSTD::__char_traits_length_checked<_Traits>(__s)) {} @@ -648,8 +648,8 @@ public: (data(), size(), __s, __pos, traits_type::length(__s)); } -//WARN: disabled std guards in order to allow using these options without switching to new std -//#if _LIBCPP_STD_VER > 17 +//WARN: disabled std guards in order to allow using these options without switching to new std +//#if _LIBCPP_STD_VER > 17 constexpr _LIBCPP_INLINE_VISIBILITY bool starts_with(basic_string_view __s) const noexcept { return size() >= __s.size() && compare(0, __s.size(), __s) == 0; } @@ -673,7 +673,7 @@ public: constexpr _LIBCPP_INLINE_VISIBILITY bool ends_with(const value_type* __s) const noexcept { return ends_with(basic_string_view(__s)); } -//#endif +//#endif #if _LIBCPP_STD_VER > 20 constexpr _LIBCPP_INLINE_VISIBILITY diff --git a/contrib/libs/cxxsupp/libcxx/include/vector b/contrib/libs/cxxsupp/libcxx/include/vector index c02253c751..c04259679e 100644 --- a/contrib/libs/cxxsupp/libcxx/include/vector +++ b/contrib/libs/cxxsupp/libcxx/include/vector @@ -492,7 +492,7 @@ public: typedef typename __base::difference_type difference_type; typedef typename __base::pointer pointer; typedef typename __base::const_pointer const_pointer; -#if _YNDX_LIBCPP_MAKE_VECTOR_ITERATOR_POINTERS == 1 +#if _YNDX_LIBCPP_MAKE_VECTOR_ITERATOR_POINTERS == 1 typedef typename __base::pointer iterator; typedef typename __base::const_pointer const_iterator; #else @@ -788,10 +788,10 @@ public: __invalidate_all_iterators(); } -#if _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED +#if _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED void resize_uninitialized(size_type __sz); -#endif - +#endif + void resize(size_type __sz); void resize(size_type __sz, const_reference __x); @@ -2057,8 +2057,8 @@ vector<_Tp, _Allocator>::insert(const_iterator __position, _ForwardIterator __fi return __make_iter(__p); } -#if _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED - +#if _YNDX_LIBCXX_ENABLE_VECTOR_POD_RESIZE_UNINITIALIZED + template <class _Tp, class _Allocator> void vector<_Tp, _Allocator>::resize_uninitialized(size_type __sz) @@ -2072,8 +2072,8 @@ vector<_Tp, _Allocator>::resize_uninitialized(size_type __sz) } } -#endif - +#endif + template <class _Tp, class _Allocator> void vector<_Tp, _Allocator>::resize(size_type __sz) @@ -2207,7 +2207,7 @@ vector<_Tp, _Allocator>::__invalidate_iterators_past(pointer __new_last) { #endif } -#if _YNDX_LIBCXX_ENABLE_VECTOR_BOOL_COMPRESSION == 1 +#if _YNDX_LIBCXX_ENABLE_VECTOR_BOOL_COMPRESSION == 1 // vector<bool> template <class _Allocator> class vector<bool, _Allocator>; @@ -3390,7 +3390,7 @@ struct _LIBCPP_TEMPLATE_VIS hash<vector<bool, _Allocator> > size_t operator()(const vector<bool, _Allocator>& __vec) const _NOEXCEPT {return __vec.__hash_code();} }; -#endif // _YNDX_LIBCXX_DISABLE_VECTOR_BOOL_COMPRESSION +#endif // _YNDX_LIBCXX_DISABLE_VECTOR_BOOL_COMPRESSION template <class _Tp, class _Allocator> inline _LIBCPP_INLINE_VISIBILITY |