forked from OSchip/llvm-project
Revert "[libcxx] implement <simd> ABI for Clang/GCC vector extension, constructors, copy_from and copy_to."
This reverts commit r338309. llvm-svn: 338316
This commit is contained in:
parent
8a0f890e29
commit
6f33ea4ef6
|
@ -620,8 +620,6 @@ namespace std {
|
|||
|
||||
#define _LIBCPP_ALWAYS_INLINE __forceinline
|
||||
|
||||
#define _LIBCPP_HAS_NO_VECTOR_EXTENSION
|
||||
|
||||
#elif defined(_LIBCPP_COMPILER_IBM)
|
||||
|
||||
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
|
||||
|
@ -654,8 +652,6 @@ namespace std {
|
|||
|
||||
#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__always_inline__))
|
||||
|
||||
#define _LIBCPP_HAS_NO_VECTOR_EXTENSION
|
||||
|
||||
#endif // _LIBCPP_COMPILER_[CLANG|GCC|MSVC|IBM]
|
||||
|
||||
#if _LIBCPP_STD_VER >= 17
|
||||
|
|
|
@ -64,11 +64,4 @@
|
|||
#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD_ABI \
|
||||
} _LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD
|
||||
|
||||
// TODO: support more targets
|
||||
#if defined(__AVX__)
|
||||
#define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 32
|
||||
#else
|
||||
#define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 16
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -651,7 +651,6 @@ public:
|
|||
*/
|
||||
|
||||
#include <experimental/__config>
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <functional>
|
||||
|
@ -665,241 +664,23 @@ _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD
|
|||
enum class _StorageKind {
|
||||
_Scalar,
|
||||
_Array,
|
||||
_VecExt,
|
||||
};
|
||||
|
||||
template <_StorageKind __kind, int _Np>
|
||||
struct __simd_abi {};
|
||||
|
||||
template <class _Tp, class _Abi>
|
||||
class __simd_storage {};
|
||||
struct __simd_storage_traits {};
|
||||
|
||||
template <class _Tp, int __num_element>
|
||||
class __simd_storage<_Tp, __simd_abi<_StorageKind::_Array, __num_element>> {
|
||||
std::array<_Tp, __num_element> __storage_;
|
||||
|
||||
template <class, class>
|
||||
friend struct simd;
|
||||
|
||||
template <class, class>
|
||||
friend struct simd_mask;
|
||||
|
||||
public:
|
||||
_Tp __get(size_t __index) const noexcept { return __storage_[__index]; };
|
||||
void __set(size_t __index, _Tp __val) noexcept {
|
||||
__storage_[__index] = __val;
|
||||
}
|
||||
struct __simd_storage_traits<_Tp,
|
||||
__simd_abi<_StorageKind::_Array, __num_element>> {
|
||||
using type = std::array<_Tp, __num_element>;
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
class __simd_storage<_Tp, __simd_abi<_StorageKind::_Scalar, 1>> {
|
||||
_Tp __storage_;
|
||||
|
||||
template <class, class>
|
||||
friend struct simd;
|
||||
|
||||
template <class, class>
|
||||
friend struct simd_mask;
|
||||
|
||||
public:
|
||||
_Tp __get(size_t __index) const noexcept { return (&__storage_)[__index]; };
|
||||
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) {
|
||||
return ((__val - 1) & __val) == 0 ? __val
|
||||
: __floor_pow_of_2((__val - 1) & __val);
|
||||
}
|
||||
|
||||
constexpr size_t __ceil_pow_of_2(size_t __val) {
|
||||
return __val == 1 ? 1 : __floor_pow_of_2(__val - 1) << 1;
|
||||
}
|
||||
|
||||
template <class _Tp, size_t __bytes>
|
||||
struct __vec_ext_traits {
|
||||
#if !defined(_LIBCPP_COMPILER_CLANG)
|
||||
typedef _Tp type __attribute__((vector_size(__ceil_pow_of_2(__bytes))));
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(_LIBCPP_COMPILER_CLANG)
|
||||
#define _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, _NUM_ELEMENT) \
|
||||
template <> \
|
||||
struct __vec_ext_traits<_TYPE, sizeof(_TYPE) * _NUM_ELEMENT> { \
|
||||
using type = \
|
||||
_TYPE __attribute__((vector_size(sizeof(_TYPE) * _NUM_ELEMENT))); \
|
||||
}
|
||||
|
||||
#define _LIBCPP_SPECIALIZE_VEC_EXT_32(_TYPE) \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 1); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 2); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 3); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 4); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 5); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 6); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 7); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 8); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 9); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 10); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 11); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 12); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 13); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 14); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 15); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 16); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 17); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 18); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 19); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 20); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 21); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 22); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 23); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 24); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 25); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 26); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 27); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 28); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 29); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 30); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 31); \
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 32);
|
||||
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(char);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(char16_t);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(char32_t);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(wchar_t);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(signed char);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(signed short);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(signed int);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(signed long);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(signed long long);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(unsigned char);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(unsigned short);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(unsigned int);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(unsigned long);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(unsigned long long);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(float);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(double);
|
||||
_LIBCPP_SPECIALIZE_VEC_EXT_32(long double);
|
||||
|
||||
#undef _LIBCPP_SPECIALIZE_VEC_EXT_32
|
||||
#undef _LIBCPP_SPECIALIZE_VEC_EXT
|
||||
#endif
|
||||
|
||||
template <class _Tp, int __num_element>
|
||||
class __simd_storage<_Tp, __simd_abi<_StorageKind::_VecExt, __num_element>> {
|
||||
using _StorageType =
|
||||
typename __vec_ext_traits<_Tp, sizeof(_Tp) * __num_element>::type;
|
||||
|
||||
_StorageType __storage_;
|
||||
|
||||
template <class, class>
|
||||
friend struct simd;
|
||||
|
||||
template <class, class>
|
||||
friend struct simd_mask;
|
||||
|
||||
public:
|
||||
_Tp __get(size_t __index) const noexcept { return __storage_[__index]; };
|
||||
void __set(size_t __index, _Tp __val) noexcept {
|
||||
__storage_[__index] = __val;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VECTOR_EXTENSION
|
||||
|
||||
template <class _Vp, class _Tp, class _Abi>
|
||||
class __simd_reference {
|
||||
static_assert(std::is_same<_Vp, _Tp>::value, "");
|
||||
|
||||
template <class, class>
|
||||
friend struct simd;
|
||||
|
||||
template <class, class>
|
||||
friend struct simd_mask;
|
||||
|
||||
__simd_storage<_Tp, _Abi>* __ptr_;
|
||||
size_t __index_;
|
||||
|
||||
__simd_reference(__simd_storage<_Tp, _Abi>* __ptr, size_t __index)
|
||||
: __ptr_(__ptr), __index_(__index) {}
|
||||
|
||||
__simd_reference(const __simd_reference&) = default;
|
||||
|
||||
public:
|
||||
__simd_reference() = delete;
|
||||
__simd_reference& operator=(const __simd_reference&) = delete;
|
||||
|
||||
operator _Vp() const { return __ptr_->__get(__index_); }
|
||||
|
||||
__simd_reference operator=(_Vp __value) && {
|
||||
__ptr_->__set(__index_, __value);
|
||||
return *this;
|
||||
}
|
||||
|
||||
__simd_reference operator++() && {
|
||||
return std::move(*this) = __ptr_->__get(__index_) + 1;
|
||||
}
|
||||
|
||||
_Vp operator++(int) && {
|
||||
auto __val = __ptr_->__get(__index_);
|
||||
__ptr_->__set(__index_, __val + 1);
|
||||
return __val;
|
||||
}
|
||||
|
||||
__simd_reference operator--() && {
|
||||
return std::move(*this) = __ptr_->__get(__index_) - 1;
|
||||
}
|
||||
|
||||
_Vp operator--(int) && {
|
||||
auto __val = __ptr_->__get(__index_);
|
||||
__ptr_->__set(__index_, __val - 1);
|
||||
return __val;
|
||||
}
|
||||
|
||||
__simd_reference operator+=(_Vp __value) && {
|
||||
return std::move(*this) = __ptr_->__get(__index_) + __value;
|
||||
}
|
||||
|
||||
__simd_reference operator-=(_Vp __value) && {
|
||||
return std::move(*this) = __ptr_->__get(__index_) - __value;
|
||||
}
|
||||
|
||||
__simd_reference operator*=(_Vp __value) && {
|
||||
return std::move(*this) = __ptr_->__get(__index_) * __value;
|
||||
}
|
||||
|
||||
__simd_reference operator/=(_Vp __value) && {
|
||||
return std::move(*this) = __ptr_->__get(__index_) / __value;
|
||||
}
|
||||
|
||||
__simd_reference operator%=(_Vp __value) && {
|
||||
return std::move(*this) = __ptr_->__get(__index_) % __value;
|
||||
}
|
||||
|
||||
__simd_reference operator>>=(_Vp __value) && {
|
||||
return std::move(*this) = __ptr_->__get(__index_) >> __value;
|
||||
}
|
||||
|
||||
__simd_reference operator<<=(_Vp __value) && {
|
||||
return std::move(*this) = __ptr_->__get(__index_) << __value;
|
||||
}
|
||||
|
||||
__simd_reference operator&=(_Vp __value) && {
|
||||
return std::move(*this) = __ptr_->__get(__index_) & __value;
|
||||
}
|
||||
|
||||
__simd_reference operator|=(_Vp __value) && {
|
||||
return std::move(*this) = __ptr_->__get(__index_) | __value;
|
||||
}
|
||||
|
||||
__simd_reference operator^=(_Vp __value) && {
|
||||
return std::move(*this) = __ptr_->__get(__index_) ^ __value;
|
||||
}
|
||||
struct __simd_storage_traits<_Tp, __simd_abi<_StorageKind::_Scalar, 1>> {
|
||||
using type = _Tp;
|
||||
};
|
||||
|
||||
template <class _To, class _From>
|
||||
|
@ -939,17 +720,6 @@ 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;
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
constexpr bool __vectorizable() {
|
||||
return std::is_arithmetic<_Tp>::value && !std::is_const<_Tp>::value &&
|
||||
!std::is_volatile<_Tp>::value && !std::is_same<_Tp, bool>::value;
|
||||
}
|
||||
|
||||
_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD
|
||||
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI
|
||||
|
||||
|
@ -958,21 +728,14 @@ using scalar = __simd_abi<_StorageKind::_Scalar, 1>;
|
|||
template <int _Np>
|
||||
using fixed_size = __simd_abi<_StorageKind::_Array, _Np>;
|
||||
|
||||
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VAR constexpr size_t max_fixed_size = 32;
|
||||
|
||||
_LIBCPP_INLINE_VAR constexpr int max_fixed_size = 32;
|
||||
#endif
|
||||
template <class _Tp>
|
||||
using compatible = fixed_size<16 / sizeof(_Tp)>;
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VECTOR_EXTENSION
|
||||
template <class _Tp>
|
||||
using native = __simd_abi<_StorageKind::_VecExt,
|
||||
_LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>;
|
||||
#else
|
||||
template <class _Tp>
|
||||
using native =
|
||||
fixed_size<_Tp, _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>;
|
||||
#endif // _LIBCPP_HAS_NO_VECTOR_EXTENSION
|
||||
using native = compatible<_Tp>;
|
||||
|
||||
_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD_ABI
|
||||
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD
|
||||
|
@ -986,10 +749,14 @@ struct element_aligned_tag {};
|
|||
struct vector_aligned_tag {};
|
||||
template <size_t>
|
||||
struct overaligned_tag {};
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
_LIBCPP_INLINE_VAR constexpr element_aligned_tag element_aligned{};
|
||||
_LIBCPP_INLINE_VAR constexpr vector_aligned_tag vector_aligned{};
|
||||
#if !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
|
||||
template <size_t _Np>
|
||||
_LIBCPP_INLINE_VAR constexpr overaligned_tag<_Np> overaligned{};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// traits [simd.traits]
|
||||
template <class _Tp>
|
||||
|
@ -1027,6 +794,7 @@ template <size_t _Align>
|
|||
struct is_simd_flag_type<overaligned_tag<_Align>>
|
||||
: std::integral_constant<bool, true> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
|
||||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VAR constexpr bool is_abi_tag_v = is_abi_tag<_Tp>::value;
|
||||
template <class _Tp>
|
||||
|
@ -1036,6 +804,7 @@ _LIBCPP_INLINE_VAR constexpr bool is_simd_mask_v = is_simd_mask<_Tp>::value;
|
|||
template <class _Tp>
|
||||
_LIBCPP_INLINE_VAR constexpr bool is_simd_flag_type_v =
|
||||
is_simd_flag_type<_Tp>::value;
|
||||
#endif
|
||||
template <class _Tp, size_t _Np>
|
||||
struct abi_for_size {
|
||||
using type = simd_abi::fixed_size<_Np>;
|
||||
|
@ -1055,16 +824,17 @@ struct simd_size<_Tp, __simd_abi<__kind, _Np>>
|
|||
"Element type should be vectorizable");
|
||||
};
|
||||
|
||||
// TODO: implement it.
|
||||
template <class _Tp, class _Up = typename _Tp::value_type>
|
||||
struct memory_alignment;
|
||||
|
||||
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
|
||||
template <class _Tp, class _Abi = simd_abi::compatible<_Tp>>
|
||||
_LIBCPP_INLINE_VAR constexpr size_t simd_size_v = simd_size<_Tp, _Abi>::value;
|
||||
|
||||
template <class _Tp, class _Up = typename _Tp::value_type>
|
||||
_LIBCPP_INLINE_VAR constexpr size_t memory_alignment_v =
|
||||
memory_alignment<_Tp, _Up>::value;
|
||||
#endif
|
||||
|
||||
// class template simd [simd.class]
|
||||
template <class _Tp>
|
||||
|
@ -1202,6 +972,11 @@ template <class _MaskType, class _Tp>
|
|||
class where_expression;
|
||||
|
||||
// masked assignment [simd.mask.where]
|
||||
template <class _Tp>
|
||||
struct __nodeduce {
|
||||
using type = _Tp;
|
||||
};
|
||||
|
||||
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;
|
||||
|
@ -1338,23 +1113,7 @@ public:
|
|||
// TODO: implement simd
|
||||
template <class _Tp, class _Abi>
|
||||
class simd {
|
||||
public:
|
||||
using value_type = _Tp;
|
||||
using reference = __simd_reference<_Tp, _Tp, _Abi>;
|
||||
using mask_type = simd_mask<_Tp, _Abi>;
|
||||
using abi_type = _Abi;
|
||||
|
||||
simd() = default;
|
||||
simd(const simd&) = default;
|
||||
simd& operator=(const simd&) = default;
|
||||
|
||||
static constexpr size_t size() noexcept {
|
||||
return simd_size<_Tp, _Abi>::value;
|
||||
}
|
||||
|
||||
private:
|
||||
__simd_storage<_Tp, _Abi> __s_;
|
||||
|
||||
template <class _Up>
|
||||
static constexpr bool __can_broadcast() {
|
||||
return (std::is_arithmetic<_Up>::value &&
|
||||
|
@ -1367,97 +1126,57 @@ private:
|
|||
std::is_unsigned<_Tp>::value);
|
||||
}
|
||||
|
||||
template <class _Generator, size_t... __indicies>
|
||||
static constexpr decltype(
|
||||
std::forward_as_tuple(std::declval<_Generator>()(
|
||||
std::integral_constant<size_t, __indicies>())...),
|
||||
bool())
|
||||
__can_generate(std::index_sequence<__indicies...>) {
|
||||
return !__variadic_sum<bool>(
|
||||
!__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:
|
||||
using value_type = _Tp;
|
||||
// TODO: this is strawman implementation. Turn it into a proxy type.
|
||||
using reference = _Tp&;
|
||||
using mask_type = simd_mask<_Tp, _Abi>;
|
||||
|
||||
using abi_type = _Abi;
|
||||
|
||||
static constexpr size_t size() noexcept {
|
||||
return simd_size<_Tp, _Abi>::value;
|
||||
}
|
||||
|
||||
simd() = default;
|
||||
|
||||
// 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]);
|
||||
}
|
||||
}
|
||||
simd(const simd<_Up, simd_abi::fixed_size<size()>>&) {}
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
simd(_Up&&);
|
||||
|
||||
// generator constructor
|
||||
// TODO: for now only check for the index 0. This is because C++11 doesn't
|
||||
// have index_sequence, and it's hard to check for all indicies without using
|
||||
// index_sequence.
|
||||
template <class _Generator,
|
||||
int = typename std::enable_if<
|
||||
__can_generate<_Generator>(std::make_index_sequence<size()>()),
|
||||
int>::type()>
|
||||
explicit simd(_Generator&& __g) {
|
||||
__generator_init(std::forward<_Generator>(__g),
|
||||
std::make_index_sequence<size()>());
|
||||
}
|
||||
int = decltype(simd(std::declval<_Generator>()(
|
||||
std::integral_constant<size_t, 0>())),
|
||||
int())()>
|
||||
explicit simd(_Generator&&);
|
||||
|
||||
// load constructor
|
||||
template <
|
||||
class _Up, class _Flags,
|
||||
class = typename std::enable_if<__vectorizable<_Up>()>::type,
|
||||
class = typename std::enable_if<is_simd_flag_type<_Flags>::value>::type>
|
||||
simd(const _Up* __buffer, _Flags) {
|
||||
// TODO: optimize for overaligned flags
|
||||
for (size_t __i = 0; __i < size(); __i++) {
|
||||
(*this)[__i] = static_cast<_Tp>(__buffer[__i]);
|
||||
}
|
||||
}
|
||||
template <class _Up, class _Flags>
|
||||
simd(const _Up*, _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());
|
||||
}
|
||||
void copy_from(const _Up*, _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 {
|
||||
// TODO: optimize for overaligned flags
|
||||
for (size_t __i = 0; __i < size(); __i++) {
|
||||
__buffer[__i] = static_cast<_Up>((*this)[__i]);
|
||||
}
|
||||
}
|
||||
void copy_to(_Up*, _Flags) const;
|
||||
|
||||
// scalar access [simd.subscr]
|
||||
reference operator[](size_t __i) { return reference(&__s_, __i); }
|
||||
|
||||
value_type operator[](size_t __i) const { return __s_.__get(__i); }
|
||||
reference operator[](size_t);
|
||||
value_type operator[](size_t) const;
|
||||
|
||||
// unary operators [simd.unary]
|
||||
simd& operator++();
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
|
||||
// <experimental/simd>
|
||||
//
|
||||
// [simd.abi]
|
||||
|
||||
#include <experimental/simd>
|
||||
#include <cstdint>
|
||||
|
||||
namespace ex = std::experimental::parallelism_v2;
|
||||
|
||||
constexpr inline int reg_width() {
|
||||
#if defined(__AVX__)
|
||||
return 32;
|
||||
#else
|
||||
return 16;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VECTOR_EXTENSION
|
||||
|
||||
static_assert(
|
||||
sizeof(ex::simd<char, ex::__simd_abi<ex::_StorageKind::_VecExt, 1>>) == 1,
|
||||
"");
|
||||
static_assert(
|
||||
sizeof(ex::simd<char, ex::__simd_abi<ex::_StorageKind::_VecExt, 2>>) == 2,
|
||||
"");
|
||||
static_assert(
|
||||
sizeof(ex::simd<char, ex::__simd_abi<ex::_StorageKind::_VecExt, 3>>) == 4,
|
||||
"");
|
||||
static_assert(
|
||||
sizeof(ex::simd<char, ex::__simd_abi<ex::_StorageKind::_VecExt, 12>>) == 16,
|
||||
"");
|
||||
static_assert(
|
||||
sizeof(ex::simd<int32_t, ex::__simd_abi<ex::_StorageKind::_VecExt, 3>>) ==
|
||||
16,
|
||||
"");
|
||||
static_assert(
|
||||
sizeof(ex::simd<int32_t, ex::__simd_abi<ex::_StorageKind::_VecExt, 5>>) ==
|
||||
32,
|
||||
"");
|
||||
static_assert(
|
||||
std::is_same<ex::simd_abi::native<int8_t>,
|
||||
ex::__simd_abi<ex::_StorageKind::_VecExt, reg_width()>>::value,
|
||||
"");
|
||||
#else
|
||||
static_assert(
|
||||
std::is_same<ex::simd_abi::native<int8_t>,
|
||||
ex::__simd_abi<ex::_StorageKind::_Array, reg_width()>>::value,
|
||||
"");
|
||||
|
||||
#endif
|
||||
|
||||
static_assert(std::is_same<ex::simd_abi::compatible<int8_t>,
|
||||
ex::__simd_abi<ex::_StorageKind::_Array, 16>>::value,
|
||||
"");
|
||||
|
||||
int main() {}
|
|
@ -1,217 +0,0 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
|
||||
// <experimental/simd>
|
||||
//
|
||||
// scalar access [simd.subscr]
|
||||
// reference operator[](size_t);
|
||||
// value_type operator[](size_t) const;
|
||||
|
||||
#include <experimental/simd>
|
||||
#include <cassert>
|
||||
#include <cstdint>
|
||||
|
||||
namespace ex = std::experimental::parallelism_v2;
|
||||
|
||||
template <typename SimdType>
|
||||
void test_access() {
|
||||
{
|
||||
SimdType a(42), b(4);
|
||||
static_assert(std::is_convertible<decltype(a[0]), int8_t>::value, "");
|
||||
|
||||
assert(a[0] == 42);
|
||||
assert(!a[0] == !42);
|
||||
assert(~a[0] == ~42);
|
||||
assert(+a[0] == +42);
|
||||
assert(-a[0] == -42);
|
||||
assert(a[0] + b[0] == 42 + 4);
|
||||
assert(a[0] - b[0] == 42 - 4);
|
||||
assert(a[0] * b[0] == 42 * 4);
|
||||
assert(a[0] / b[0] == 42 / 4);
|
||||
assert(a[0] % b[0] == 42 % 4);
|
||||
assert(a[0] << b[0] == (42 << 4));
|
||||
assert(a[0] >> b[0] == (42 >> 4));
|
||||
assert(a[0] < b[0] == false);
|
||||
assert(a[0] <= b[0] == false);
|
||||
assert(a[0] > b[0] == true);
|
||||
assert(a[0] >= b[0] == true);
|
||||
assert(a[0] == b[0] == false);
|
||||
assert(a[0] != b[0] == true);
|
||||
assert((a[0] & b[0]) == (42 & 4));
|
||||
assert((a[0] | b[0]) == (42 | 4));
|
||||
assert((a[0] ^ b[0]) == (42 ^ 4));
|
||||
assert((a[0] && b[0]) == true);
|
||||
assert((a[0] || b[0]) == true);
|
||||
|
||||
{
|
||||
auto c = a;
|
||||
++c[0];
|
||||
assert(c[0] == 42 + 1);
|
||||
assert(c[1] == 42);
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
auto ret = c[0]++;
|
||||
assert(ret == 42);
|
||||
assert(c[0] == 42 + 1);
|
||||
assert(c[1] == 42);
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
--c[0];
|
||||
assert(c[0] == 42 - 1);
|
||||
assert(c[1] == 42);
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
auto ret = c[0]--;
|
||||
assert(ret == 42);
|
||||
assert(c[0] == 42 - 1);
|
||||
assert(c[1] == 42);
|
||||
}
|
||||
|
||||
{
|
||||
auto c = a;
|
||||
c[0] += b[0];
|
||||
assert(c[0] == 42 + 4);
|
||||
assert(c[1] == 42);
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
c[0] -= b[0];
|
||||
assert(c[0] == 42 - 4);
|
||||
assert(c[1] == 42);
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
c[0] *= b[0];
|
||||
assert(c[0] == 42 * 4);
|
||||
assert(c[1] == 42);
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
c[0] /= b[0];
|
||||
assert(c[0] == 42 / 4);
|
||||
assert(c[1] == 42);
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
c[0] %= b[0];
|
||||
assert(c[0] == 42 % 4);
|
||||
assert(c[1] == 42);
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
c[0] >>= b[0];
|
||||
assert(c[0] == (42 >> 4));
|
||||
assert(c[1] == 42);
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
c[0] <<= b[0];
|
||||
assert(c[0] == (42 << 4));
|
||||
assert(c[1] == 42);
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
c[0] &= b[0];
|
||||
assert(c[0] == (42 & 4));
|
||||
assert(c[1] == 42);
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
c[0] |= b[0];
|
||||
assert(c[0] == (42 | 4));
|
||||
assert(c[1] == 42);
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
c[0] ^= b[0];
|
||||
assert(c[0] == (42 ^ 4));
|
||||
assert(c[1] == 42);
|
||||
}
|
||||
|
||||
{
|
||||
auto c = a;
|
||||
(void)(a[0] + (c[0] += a[0]));
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
(void)(a[0] + (c[0] -= a[0]));
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
(void)(a[0] + (c[0] *= a[0]));
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
(void)(a[0] + (c[0] /= a[0]));
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
(void)(a[0] + (c[0] %= a[0]));
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
(void)(a[0] + (c[0] >>= a[0]));
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
(void)(a[0] + (c[0] <<= a[0]));
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
(void)(a[0] + (c[0] &= a[0]));
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
(void)(a[0] + (c[0] |= a[0]));
|
||||
}
|
||||
{
|
||||
auto c = a;
|
||||
(void)(a[0] + (c[0] ^= a[0]));
|
||||
}
|
||||
}
|
||||
{
|
||||
const SimdType a(42);
|
||||
const SimdType b(4);
|
||||
static_assert(std::is_same<decltype(a[0]), int>::value, "");
|
||||
|
||||
assert(a[0] == 42);
|
||||
assert(!a[0] == !42);
|
||||
assert(~a[0] == ~42);
|
||||
assert(+a[0] == +42);
|
||||
assert(-a[0] == -42);
|
||||
assert(a[0] + b[0] == 42 + 4);
|
||||
assert(a[0] - b[0] == 42 - 4);
|
||||
assert(a[0] * b[0] == 42 * 4);
|
||||
assert(a[0] / b[0] == 42 / 4);
|
||||
assert(a[0] % b[0] == 42 % 4);
|
||||
assert(a[0] << b[0] == (42 << 4));
|
||||
assert(a[0] >> b[0] == (42 >> 4));
|
||||
assert(a[0] < b[0] == false);
|
||||
assert(a[0] <= b[0] == false);
|
||||
assert(a[0] > b[0] == true);
|
||||
assert(a[0] >= b[0] == true);
|
||||
assert(a[0] == b[0] == false);
|
||||
assert(a[0] != b[0] == true);
|
||||
assert((a[0] & b[0]) == (42 & 4));
|
||||
assert((a[0] | b[0]) == (42 | 4));
|
||||
assert((a[0] ^ b[0]) == (42 ^ 4));
|
||||
assert((a[0] && b[0]) == true);
|
||||
assert((a[0] || b[0]) == true);
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
test_access<ex::native_simd<int>>();
|
||||
test_access<ex::fixed_size_simd<int, 4>>();
|
||||
}
|
|
@ -7,40 +7,34 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <experimental/simd>
|
||||
//
|
||||
// [simd.casts]
|
||||
// template <class T, class U, class Abi> see below ex::simd_cast<(const
|
||||
// ex::simd<U, Abi>&);
|
||||
|
||||
// template <class T, class U, class Abi> see below simd_cast(const simd<U, Abi>&);
|
||||
#include <experimental/simd>
|
||||
#include <cstdint>
|
||||
|
||||
namespace ex = std::experimental::parallelism_v2;
|
||||
using namespace std::experimental::parallelism_v2;
|
||||
|
||||
static_assert(
|
||||
std::is_same<decltype(ex::simd_cast<int32_t>(ex::native_simd<int32_t>())),
|
||||
ex::native_simd<int32_t>>::value,
|
||||
"");
|
||||
|
||||
static_assert(std::is_same<decltype(ex::simd_cast<int64_t>(
|
||||
ex::fixed_size_simd<int32_t, 4>())),
|
||||
ex::fixed_size_simd<int64_t, 4>>::value,
|
||||
static_assert(std::is_same<decltype(simd_cast<int32_t>(native_simd<int32_t>())),
|
||||
native_simd<int32_t>>::value,
|
||||
"");
|
||||
|
||||
static_assert(
|
||||
std::is_same<decltype(ex::simd_cast<ex::fixed_size_simd<int64_t, 1>>(
|
||||
ex::simd<int32_t, ex::simd_abi::scalar>())),
|
||||
ex::fixed_size_simd<int64_t, 1>>::value,
|
||||
std::is_same<decltype(simd_cast<int64_t>(fixed_size_simd<int32_t, 4>())),
|
||||
fixed_size_simd<int64_t, 4>>::value,
|
||||
"");
|
||||
|
||||
static_assert(
|
||||
std::is_same<
|
||||
decltype(ex::simd_cast<ex::simd<int64_t, ex::simd_abi::scalar>>(
|
||||
ex::fixed_size_simd<int32_t, 1>())),
|
||||
ex::simd<int64_t, ex::simd_abi::scalar>>::value,
|
||||
static_assert(std::is_same<decltype(simd_cast<fixed_size_simd<int64_t, 1>>(
|
||||
simd<int32_t, simd_abi::scalar>())),
|
||||
fixed_size_simd<int64_t, 1>>::value,
|
||||
"");
|
||||
|
||||
static_assert(std::is_same<decltype(simd_cast<simd<int64_t, simd_abi::scalar>>(
|
||||
fixed_size_simd<int32_t, 1>())),
|
||||
simd<int64_t, simd_abi::scalar>>::value,
|
||||
"");
|
||||
|
||||
int main() {}
|
||||
|
|
|
@ -7,35 +7,32 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <experimental/simd>
|
||||
//
|
||||
// [simd.casts]
|
||||
// template <class T, class U, class Abi> see below ex::static_simd_cast<(const
|
||||
// ex::simd<U, Abi>&);
|
||||
// template <class T, class U, class Abi> see below static_simd_cast(const simd<U, Abi>&);
|
||||
|
||||
#include <experimental/simd>
|
||||
#include <cstdint>
|
||||
|
||||
namespace ex = std::experimental::parallelism_v2;
|
||||
using namespace std::experimental::parallelism_v2;
|
||||
|
||||
static_assert(
|
||||
std::is_same<decltype(ex::static_simd_cast<float>(ex::native_simd<int>())),
|
||||
ex::native_simd<float>>::value,
|
||||
std::is_same<decltype(static_simd_cast<float>(native_simd<int>())),
|
||||
native_simd<float>>::value,
|
||||
"");
|
||||
|
||||
static_assert(std::is_same<decltype(static_simd_cast<fixed_size_simd<float, 1>>(
|
||||
simd<int, simd_abi::scalar>())),
|
||||
fixed_size_simd<float, 1>>::value,
|
||||
"");
|
||||
|
||||
static_assert(
|
||||
std::is_same<decltype(ex::static_simd_cast<ex::fixed_size_simd<float, 1>>(
|
||||
ex::simd<int, ex::simd_abi::scalar>())),
|
||||
ex::fixed_size_simd<float, 1>>::value,
|
||||
"");
|
||||
|
||||
static_assert(
|
||||
std::is_same<
|
||||
decltype(ex::static_simd_cast<ex::simd<float, ex::simd_abi::scalar>>(
|
||||
ex::fixed_size_simd<int, 1>())),
|
||||
ex::simd<float, ex::simd_abi::scalar>>::value,
|
||||
std::is_same<decltype(static_simd_cast<simd<float, simd_abi::scalar>>(
|
||||
fixed_size_simd<int, 1>())),
|
||||
simd<float, simd_abi::scalar>>::value,
|
||||
"");
|
||||
|
||||
int main() {}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// See GCC PR63723.
|
||||
// UNSUPPORTED: gcc-4.9
|
||||
|
@ -20,19 +20,18 @@
|
|||
#include <cstdint>
|
||||
#include <experimental/simd>
|
||||
|
||||
namespace ex = std::experimental::parallelism_v2;
|
||||
using namespace std::experimental::parallelism_v2;
|
||||
|
||||
template <class T, class... Args>
|
||||
auto not_supported_native_simd_ctor(Args&&... args)
|
||||
-> decltype(ex::native_simd<T>(std::forward<Args>(args)...),
|
||||
void()) = delete;
|
||||
-> decltype(native_simd<T>(std::forward<Args>(args)...), void()) = delete;
|
||||
|
||||
template <class T>
|
||||
void not_supported_native_simd_ctor(...) {}
|
||||
|
||||
template <class T, class... Args>
|
||||
auto supported_native_simd_ctor(Args&&... args)
|
||||
-> decltype(ex::native_simd<T>(std::forward<Args>(args)...), void()) {}
|
||||
-> decltype(native_simd<T>(std::forward<Args>(args)...), void()) {}
|
||||
|
||||
template <class T>
|
||||
void supported_native_simd_ctor(...) = delete;
|
||||
|
@ -56,31 +55,4 @@ void compile_narrowing_conversion() {
|
|||
not_supported_native_simd_ctor<int>(3.);
|
||||
}
|
||||
|
||||
void compile_convertible() {
|
||||
struct ConvertibleToInt {
|
||||
operator int64_t() const;
|
||||
};
|
||||
supported_native_simd_ctor<int64_t>(ConvertibleToInt());
|
||||
|
||||
struct NotConvertibleToInt {};
|
||||
not_supported_native_simd_ctor<int64_t>(NotConvertibleToInt());
|
||||
}
|
||||
|
||||
void compile_unsigned() {
|
||||
not_supported_native_simd_ctor<int>(3u);
|
||||
supported_native_simd_ctor<uint16_t>(3u);
|
||||
}
|
||||
|
||||
template <typename SimdType>
|
||||
void test_broadcast() {
|
||||
SimdType a(3);
|
||||
for (size_t i = 0; i < a.size(); i++) {
|
||||
assert(a[i] == 3);
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
test_broadcast<ex::native_simd<int>>();
|
||||
test_broadcast<ex::fixed_size_simd<int, 4>>();
|
||||
test_broadcast<ex::fixed_size_simd<int, 15>>();
|
||||
}
|
||||
int main() {}
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
|
||||
// <experimental/simd>
|
||||
//
|
||||
// [simd.class]
|
||||
// simd() = default;
|
||||
|
||||
#include <cstdint>
|
||||
#include <experimental/simd>
|
||||
|
||||
namespace ex = std::experimental::parallelism_v2;
|
||||
|
||||
int main() {
|
||||
static_assert(ex::native_simd<int32_t>().size() > 0, "");
|
||||
static_assert(ex::fixed_size_simd<int32_t, 4>().size() == 4, "");
|
||||
static_assert(ex::fixed_size_simd<int32_t, 5>().size() == 5, "");
|
||||
static_assert(ex::fixed_size_simd<int32_t, 1>().size() == 1, "");
|
||||
static_assert(ex::fixed_size_simd<char, 32>().size() == 32, "");
|
||||
}
|
|
@ -7,7 +7,7 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// See GCC PR63723.
|
||||
// UNSUPPORTED: gcc-4.9
|
||||
|
@ -17,75 +17,30 @@
|
|||
// [simd.class]
|
||||
// template <class G> explicit simd(G&& gen);
|
||||
|
||||
#include <experimental/simd>
|
||||
#include <cstdint>
|
||||
#include <experimental/simd>
|
||||
|
||||
namespace ex = std::experimental::parallelism_v2;
|
||||
using namespace std::experimental::parallelism_v2;
|
||||
|
||||
template <class T, class... Args>
|
||||
auto not_supported_simd128_ctor(Args&&... args) -> decltype(
|
||||
ex::fixed_size_simd<T, 16 / sizeof(T)>(std::forward<Args>(args)...),
|
||||
void()) = delete;
|
||||
auto not_supported_native_simd_ctor(Args&&... args)
|
||||
-> decltype(native_simd<T>(std::forward<Args>(args)...), void()) = delete;
|
||||
|
||||
template <class T>
|
||||
void not_supported_simd128_ctor(...) {}
|
||||
void not_supported_native_simd_ctor(...) {}
|
||||
|
||||
template <class T, class... Args>
|
||||
auto supported_simd128_ctor(Args&&... args) -> decltype(
|
||||
ex::fixed_size_simd<T, 16 / sizeof(T)>(std::forward<Args>(args)...),
|
||||
void()) {}
|
||||
auto supported_native_simd_ctor(Args&&... args)
|
||||
-> decltype(native_simd<T>(std::forward<Args>(args)...), void()) {}
|
||||
|
||||
template <class T>
|
||||
void supported_simd128_ctor(...) = delete;
|
||||
|
||||
struct identity {
|
||||
template <size_t value>
|
||||
int operator()(std::integral_constant<size_t, value>) const {
|
||||
return value;
|
||||
}
|
||||
};
|
||||
void supported_native_simd_ctor(...) = delete;
|
||||
|
||||
void compile_generator() {
|
||||
supported_simd128_ctor<int>(identity());
|
||||
not_supported_simd128_ctor<int>([](int i) { return float(i); });
|
||||
not_supported_simd128_ctor<int>([](intptr_t i) { return (int*)(i); });
|
||||
not_supported_simd128_ctor<int>([](int* i) { return i; });
|
||||
supported_native_simd_ctor<int>([](int i) { return i; });
|
||||
not_supported_native_simd_ctor<int>([](int i) { return float(i); });
|
||||
not_supported_native_simd_ctor<int>([](intptr_t i) { return (int*)(i); });
|
||||
not_supported_native_simd_ctor<int>([](int* i) { return i; });
|
||||
}
|
||||
|
||||
struct limited_identity {
|
||||
template <size_t value>
|
||||
typename std::conditional<value <= 2, int32_t, int64_t>::type
|
||||
operator()(std::integral_constant<size_t, value>) const {
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
void compile_limited_identity() {
|
||||
supported_simd128_ctor<int64_t>(limited_identity());
|
||||
not_supported_simd128_ctor<int32_t>(limited_identity());
|
||||
}
|
||||
|
||||
template <typename SimdType>
|
||||
void test_generator() {
|
||||
{
|
||||
SimdType a([](int i) { return i; });
|
||||
assert(a[0] == 0);
|
||||
assert(a[1] == 1);
|
||||
assert(a[2] == 2);
|
||||
assert(a[3] == 3);
|
||||
}
|
||||
{
|
||||
SimdType a([](int i) { return 2 * i - 1; });
|
||||
assert(a[0] == -1);
|
||||
assert(a[1] == 1);
|
||||
assert(a[2] == 3);
|
||||
assert(a[3] == 5);
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
// TODO: adjust the tests when this assertion fails.
|
||||
assert(ex::native_simd<int32_t>::size() >= 4);
|
||||
test_generator<ex::native_simd<int32_t>>();
|
||||
test_generator<ex::fixed_size_simd<int32_t, 4>>();
|
||||
}
|
||||
int main() {}
|
||||
|
|
|
@ -1,118 +0,0 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
|
||||
// <experimental/simd>
|
||||
//
|
||||
// [simd.class]
|
||||
// template <class U, class Flags> simd(const U* mem, Flags f);
|
||||
|
||||
#include <cstdint>
|
||||
#include <experimental/simd>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace ex = std::experimental::parallelism_v2;
|
||||
|
||||
template <class T, class... Args>
|
||||
auto not_supported_native_simd_ctor(Args&&... args)
|
||||
-> decltype(ex::native_simd<T>(std::forward<Args>(args)...),
|
||||
void()) = delete;
|
||||
|
||||
template <class T>
|
||||
void not_supported_native_simd_ctor(...) {}
|
||||
|
||||
template <class T, class... Args>
|
||||
auto supported_native_simd_ctor(Args&&... args)
|
||||
-> decltype(ex::native_simd<T>(std::forward<Args>(args)...), void()) {}
|
||||
|
||||
template <class T>
|
||||
void supported_native_simd_ctor(...) = delete;
|
||||
|
||||
void compile_load_ctor() {
|
||||
supported_native_simd_ctor<int>((int*)nullptr, ex::element_aligned_tag());
|
||||
supported_native_simd_ctor<uint32_t>((int*)nullptr,
|
||||
ex::element_aligned_tag());
|
||||
supported_native_simd_ctor<double>((float*)nullptr,
|
||||
ex::element_aligned_tag());
|
||||
supported_native_simd_ctor<uint16_t>((unsigned int*)nullptr,
|
||||
ex::element_aligned_tag());
|
||||
supported_native_simd_ctor<uint32_t>((float*)nullptr,
|
||||
ex::element_aligned_tag());
|
||||
|
||||
not_supported_native_simd_ctor<int>((int*)nullptr, int());
|
||||
}
|
||||
|
||||
template <typename SimdType>
|
||||
void test_load_ctor() {
|
||||
alignas(32) int32_t buffer[] = {4, 3, 2, 1};
|
||||
{
|
||||
SimdType a(buffer, ex::element_aligned_tag());
|
||||
assert(a[0] == 4);
|
||||
assert(a[1] == 3);
|
||||
assert(a[2] == 2);
|
||||
assert(a[3] == 1);
|
||||
}
|
||||
{
|
||||
SimdType a(buffer, ex::vector_aligned_tag());
|
||||
assert(a[0] == 4);
|
||||
assert(a[1] == 3);
|
||||
assert(a[2] == 2);
|
||||
assert(a[3] == 1);
|
||||
}
|
||||
{
|
||||
SimdType a(buffer, ex::overaligned_tag<32>());
|
||||
assert(a[0] == 4);
|
||||
assert(a[1] == 3);
|
||||
assert(a[2] == 2);
|
||||
assert(a[3] == 1);
|
||||
}
|
||||
|
||||
{
|
||||
SimdType a(buffer, ex::element_aligned);
|
||||
assert(a[0] == 4);
|
||||
assert(a[1] == 3);
|
||||
assert(a[2] == 2);
|
||||
assert(a[3] == 1);
|
||||
}
|
||||
{
|
||||
SimdType a(buffer, ex::vector_aligned);
|
||||
assert(a[0] == 4);
|
||||
assert(a[1] == 3);
|
||||
assert(a[2] == 2);
|
||||
assert(a[3] == 1);
|
||||
}
|
||||
{
|
||||
SimdType a(buffer, ex::overaligned<32>);
|
||||
assert(a[0] == 4);
|
||||
assert(a[1] == 3);
|
||||
assert(a[2] == 2);
|
||||
assert(a[3] == 1);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename SimdType>
|
||||
void test_converting_load_ctor() {
|
||||
float buffer[] = {1., 2., 4., 8.};
|
||||
SimdType a(buffer, ex::element_aligned_tag());
|
||||
assert(a[0] == 1);
|
||||
assert(a[1] == 2);
|
||||
assert(a[2] == 4);
|
||||
assert(a[3] == 8);
|
||||
}
|
||||
|
||||
int main() {
|
||||
// TODO: adjust the tests when this assertion fails.
|
||||
assert(ex::native_simd<int32_t>::size() >= 4);
|
||||
test_load_ctor<ex::native_simd<int32_t>>();
|
||||
test_load_ctor<ex::fixed_size_simd<int32_t, 4>>();
|
||||
test_converting_load_ctor<ex::native_simd<int32_t>>();
|
||||
test_converting_load_ctor<ex::fixed_size_simd<int32_t, 4>>();
|
||||
}
|
|
@ -1,122 +0,0 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
|
||||
// <experimental/simd>
|
||||
//
|
||||
// loads [simd.load]
|
||||
// template <class U, class Flags> void copy_from(const U* mem, Flags f);
|
||||
|
||||
#include <experimental/simd>
|
||||
#include <cstdint>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace ex = std::experimental::parallelism_v2;
|
||||
|
||||
template <class T, class... Args>
|
||||
auto not_supported_load(Args&&... args) -> decltype(
|
||||
std::declval<ex::native_simd<T>>().copy_from(std::forward<Args>(args)...),
|
||||
void()) = delete;
|
||||
|
||||
template <class T>
|
||||
void not_supported_load(...) {}
|
||||
|
||||
template <class T, class... Args>
|
||||
auto supported_load(Args&&... args) -> decltype(
|
||||
std::declval<ex::native_simd<T>>().copy_from(std::forward<Args>(args)...),
|
||||
void()) {}
|
||||
|
||||
template <class T>
|
||||
void supported_load(...) = delete;
|
||||
|
||||
void compile_load() {
|
||||
supported_load<int>((int*)nullptr, ex::element_aligned_tag());
|
||||
supported_load<uint32_t>((int*)nullptr, ex::element_aligned_tag());
|
||||
supported_load<double>((float*)nullptr, ex::element_aligned_tag());
|
||||
supported_load<uint16_t>((unsigned int*)nullptr, ex::element_aligned_tag());
|
||||
supported_load<uint32_t>((float*)nullptr, ex::element_aligned_tag());
|
||||
|
||||
not_supported_load<int>((int*)nullptr, int());
|
||||
}
|
||||
|
||||
template <typename SimdType>
|
||||
void test_load() {
|
||||
alignas(32) int32_t buffer[] = {4, 3, 2, 1};
|
||||
{
|
||||
SimdType a;
|
||||
a.copy_from(buffer, ex::element_aligned_tag());
|
||||
assert(a[0] == 4);
|
||||
assert(a[1] == 3);
|
||||
assert(a[2] == 2);
|
||||
assert(a[3] == 1);
|
||||
}
|
||||
{
|
||||
SimdType a;
|
||||
a.copy_from(buffer, ex::vector_aligned_tag());
|
||||
assert(a[0] == 4);
|
||||
assert(a[1] == 3);
|
||||
assert(a[2] == 2);
|
||||
assert(a[3] == 1);
|
||||
}
|
||||
{
|
||||
SimdType a;
|
||||
a.copy_from(buffer, ex::overaligned_tag<32>());
|
||||
assert(a[0] == 4);
|
||||
assert(a[1] == 3);
|
||||
assert(a[2] == 2);
|
||||
assert(a[3] == 1);
|
||||
}
|
||||
|
||||
{
|
||||
SimdType a;
|
||||
a.copy_from(buffer, ex::element_aligned);
|
||||
assert(a[0] == 4);
|
||||
assert(a[1] == 3);
|
||||
assert(a[2] == 2);
|
||||
assert(a[3] == 1);
|
||||
}
|
||||
{
|
||||
SimdType a;
|
||||
a.copy_from(buffer, ex::vector_aligned);
|
||||
assert(a[0] == 4);
|
||||
assert(a[1] == 3);
|
||||
assert(a[2] == 2);
|
||||
assert(a[3] == 1);
|
||||
}
|
||||
{
|
||||
SimdType a;
|
||||
a.copy_from(buffer, ex::overaligned<32>);
|
||||
assert(a[0] == 4);
|
||||
assert(a[1] == 3);
|
||||
assert(a[2] == 2);
|
||||
assert(a[3] == 1);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename SimdType>
|
||||
void test_converting_load() {
|
||||
float buffer[] = {1., 2., 4., 8.};
|
||||
SimdType a;
|
||||
a.copy_from(buffer, ex::element_aligned_tag());
|
||||
assert(a[0] == 1);
|
||||
assert(a[1] == 2);
|
||||
assert(a[2] == 4);
|
||||
assert(a[3] == 8);
|
||||
}
|
||||
|
||||
int main() {
|
||||
// TODO: adjust the tests when this assertion fails.
|
||||
assert(ex::native_simd<int32_t>::size() >= 4);
|
||||
test_load<ex::native_simd<int32_t>>();
|
||||
test_load<ex::fixed_size_simd<int32_t, 4>>();
|
||||
test_converting_load<ex::native_simd<int32_t>>();
|
||||
test_converting_load<ex::fixed_size_simd<int32_t, 4>>();
|
||||
}
|
|
@ -1,95 +0,0 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
|
||||
// <experimental/simd>
|
||||
//
|
||||
// // stores [simd.store]
|
||||
// template <class U, class Flags> void copy_to(U* mem, Flags f) const;
|
||||
|
||||
#include <experimental/simd>
|
||||
#include <cstdint>
|
||||
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace ex = std::experimental::parallelism_v2;
|
||||
|
||||
template <typename SimdType>
|
||||
void test_store() {
|
||||
SimdType a([](int i) { return 4 - i; });
|
||||
{
|
||||
alignas(32) int32_t buffer[4] = {0};
|
||||
a.copy_to(buffer, ex::element_aligned_tag());
|
||||
assert(buffer[0] == 4);
|
||||
assert(buffer[1] == 3);
|
||||
assert(buffer[2] == 2);
|
||||
assert(buffer[3] == 1);
|
||||
}
|
||||
{
|
||||
alignas(32) int32_t buffer[4] = {0};
|
||||
a.copy_to(buffer, ex::vector_aligned_tag());
|
||||
assert(buffer[0] == 4);
|
||||
assert(buffer[1] == 3);
|
||||
assert(buffer[2] == 2);
|
||||
assert(buffer[3] == 1);
|
||||
}
|
||||
{
|
||||
alignas(32) int32_t buffer[4] = {0};
|
||||
a.copy_to(buffer, ex::overaligned_tag<32>());
|
||||
assert(buffer[0] == 4);
|
||||
assert(buffer[1] == 3);
|
||||
assert(buffer[2] == 2);
|
||||
assert(buffer[3] == 1);
|
||||
}
|
||||
|
||||
{
|
||||
alignas(32) int32_t buffer[4] = {0};
|
||||
a.copy_to(buffer, ex::element_aligned);
|
||||
assert(buffer[0] == 4);
|
||||
assert(buffer[1] == 3);
|
||||
assert(buffer[2] == 2);
|
||||
assert(buffer[3] == 1);
|
||||
}
|
||||
{
|
||||
alignas(32) int32_t buffer[4] = {0};
|
||||
a.copy_to(buffer, ex::vector_aligned);
|
||||
assert(buffer[0] == 4);
|
||||
assert(buffer[1] == 3);
|
||||
assert(buffer[2] == 2);
|
||||
assert(buffer[3] == 1);
|
||||
}
|
||||
{
|
||||
alignas(32) int32_t buffer[4] = {0};
|
||||
a.copy_to(buffer, ex::overaligned<32>);
|
||||
assert(buffer[0] == 4);
|
||||
assert(buffer[1] == 3);
|
||||
assert(buffer[2] == 2);
|
||||
assert(buffer[3] == 1);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename SimdType>
|
||||
void test_converting_store() {
|
||||
float buffer[4] = {0.};
|
||||
SimdType a([](int i) { return 1 << i; });
|
||||
a.copy_to(buffer, ex::element_aligned_tag());
|
||||
assert(buffer[0] == 1.);
|
||||
assert(buffer[1] == 2.);
|
||||
assert(buffer[2] == 4.);
|
||||
assert(buffer[3] == 8.);
|
||||
}
|
||||
|
||||
int main() {
|
||||
// TODO: adjust the tests when this assertion fails.
|
||||
test_store<ex::native_simd<int32_t>>();
|
||||
test_store<ex::fixed_size_simd<int32_t, 4>>();
|
||||
test_converting_store<ex::native_simd<int32_t>>();
|
||||
test_converting_store<ex::fixed_size_simd<int32_t, 4>>();
|
||||
}
|
|
@ -7,26 +7,24 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <experimental/simd>
|
||||
//
|
||||
// [simd.traits]
|
||||
// template <class T, size_t N> struct abi_for_size { using type = see below ;
|
||||
// }; template <class T, size_t N> using ex::abi_for_size_t = typename
|
||||
// ex::abi_for_size<T, N>::type;
|
||||
// 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;
|
||||
|
||||
#include <cstdint>
|
||||
#include <experimental/simd>
|
||||
|
||||
namespace ex = std::experimental::parallelism_v2;
|
||||
using namespace std::experimental::parallelism_v2;
|
||||
|
||||
static_assert(std::is_same<typename ex::abi_for_size<int, 4>::type,
|
||||
ex::simd_abi::fixed_size<4>>::value,
|
||||
static_assert(std::is_same<typename abi_for_size<int, 4>::type,
|
||||
simd_abi::fixed_size<4>>::value,
|
||||
"");
|
||||
|
||||
static_assert(std::is_same<ex::abi_for_size_t<int, 4>,
|
||||
ex::simd_abi::fixed_size<4>>::value,
|
||||
"");
|
||||
static_assert(
|
||||
std::is_same<abi_for_size_t<int, 4>, simd_abi::fixed_size<4>>::value, "");
|
||||
|
||||
int main() {}
|
||||
|
|
|
@ -7,107 +7,109 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <experimental/simd>
|
||||
//
|
||||
// [simd.traits]
|
||||
// template <class T> struct is_abi_tag;
|
||||
// template <class T> inline constexpr bool ex::is_abi_tag_v =
|
||||
// ex::is_abi_tag<T>::value;
|
||||
// template <class T> inline constexpr bool is_abi_tag_v = is_abi_tag<T>::value;
|
||||
|
||||
#include <cstdint>
|
||||
#include <experimental/simd>
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace ex = std::experimental::parallelism_v2;
|
||||
using namespace std::experimental::parallelism_v2;
|
||||
|
||||
struct UserType {};
|
||||
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::native<int8_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::native<int16_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::native<int32_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::native<int64_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::native<uint8_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::native<uint16_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::native<uint32_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::native<uint64_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::native<float>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::native<double>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::native<int8_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::native<int16_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::native<int32_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::native<int64_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::native<uint8_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::native<uint16_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::native<uint32_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::native<uint64_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::native<float>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::native<double>>::value, "");
|
||||
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::compatible<int8_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::compatible<int16_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::compatible<int32_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::compatible<int64_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::compatible<uint8_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::compatible<uint16_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::compatible<uint32_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::compatible<uint64_t>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::compatible<float>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::compatible<double>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::compatible<int8_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::compatible<int16_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::compatible<int32_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::compatible<int64_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::compatible<uint8_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::compatible<uint16_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::compatible<uint32_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::compatible<uint64_t>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::compatible<float>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::compatible<double>>::value, "");
|
||||
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::scalar>::value, "");
|
||||
static_assert(
|
||||
!std::is_same<ex::simd_abi::scalar, ex::simd_abi::fixed_size<1>>::value,
|
||||
static_assert( is_abi_tag<simd_abi::scalar>::value, "");
|
||||
static_assert(!std::is_same<simd_abi::scalar, simd_abi::fixed_size<1>>::value,
|
||||
"");
|
||||
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::fixed_size<1>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::fixed_size<2>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::fixed_size<3>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::fixed_size<4>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::fixed_size<5>>::value, "");
|
||||
static_assert(ex::is_abi_tag<ex::simd_abi::fixed_size<32>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::fixed_size<1>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::fixed_size<2>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::fixed_size<3>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::fixed_size<4>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::fixed_size<5>>::value, "");
|
||||
static_assert( is_abi_tag<simd_abi::fixed_size<32>>::value, "");
|
||||
|
||||
static_assert(!ex::is_abi_tag<void>::value, "");
|
||||
static_assert(!ex::is_abi_tag<int>::value, "");
|
||||
static_assert(!ex::is_abi_tag<float>::value, "");
|
||||
static_assert(!ex::is_abi_tag<UserType>::value, "");
|
||||
static_assert(!ex::is_abi_tag<ex::simd<int>>::value, "");
|
||||
static_assert(!ex::is_abi_tag<ex::simd<float>>::value, "");
|
||||
static_assert(!ex::is_abi_tag<ex::simd_mask<int>>::value, "");
|
||||
static_assert(!ex::is_abi_tag<ex::simd_mask<float>>::value, "");
|
||||
static_assert(!is_abi_tag<void>::value, "");
|
||||
static_assert(!is_abi_tag<int>::value, "");
|
||||
static_assert(!is_abi_tag<float>::value, "");
|
||||
static_assert(!is_abi_tag<UserType>::value, "");
|
||||
static_assert(!is_abi_tag<simd<int>>::value, "");
|
||||
static_assert(!is_abi_tag<simd<float>>::value, "");
|
||||
static_assert(!is_abi_tag<simd_mask<int>>::value, "");
|
||||
static_assert(!is_abi_tag<simd_mask<float>>::value, "");
|
||||
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::native<int8_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::native<int16_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::native<int32_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::native<int64_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::native<uint8_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::native<uint16_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::native<uint32_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::native<uint64_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::native<float>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::native<double>>, "");
|
||||
#if TEST_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && \
|
||||
!defined(_LIBCPP_HAS_NO_INLINE_VARIABLES)
|
||||
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<int8_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<int16_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<int32_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<int64_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<uint8_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<uint16_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<uint32_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<uint64_t>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<float>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::compatible<double>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::native<int8_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::native<int16_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::native<int32_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::native<int64_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::native<uint8_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::native<uint16_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::native<uint32_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::native<uint64_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::native<float>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::native<double>>, "");
|
||||
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::scalar>, "");
|
||||
static_assert(
|
||||
!std::is_same<ex::simd_abi::scalar, ex::simd_abi::fixed_size<1>>::value,
|
||||
static_assert( is_abi_tag_v<simd_abi::compatible<int8_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::compatible<int16_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::compatible<int32_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::compatible<int64_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::compatible<uint8_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::compatible<uint16_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::compatible<uint32_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::compatible<uint64_t>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::compatible<float>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::compatible<double>>, "");
|
||||
|
||||
static_assert( is_abi_tag_v<simd_abi::scalar>, "");
|
||||
static_assert(!std::is_same<simd_abi::scalar, simd_abi::fixed_size<1>>::value,
|
||||
"");
|
||||
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::fixed_size<1>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::fixed_size<2>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::fixed_size<3>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::fixed_size<4>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::fixed_size<5>>, "");
|
||||
static_assert(ex::is_abi_tag_v<ex::simd_abi::fixed_size<32>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::fixed_size<1>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::fixed_size<2>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::fixed_size<3>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::fixed_size<4>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::fixed_size<5>>, "");
|
||||
static_assert( is_abi_tag_v<simd_abi::fixed_size<32>>, "");
|
||||
|
||||
static_assert(!ex::is_abi_tag_v<void>, "");
|
||||
static_assert(!ex::is_abi_tag_v<int>, "");
|
||||
static_assert(!ex::is_abi_tag_v<float>, "");
|
||||
static_assert(!ex::is_abi_tag_v<UserType>, "");
|
||||
static_assert(!ex::is_abi_tag_v<ex::simd<int>>, "");
|
||||
static_assert(!ex::is_abi_tag_v<ex::simd<float>>, "");
|
||||
static_assert(!ex::is_abi_tag_v<ex::simd_mask<int>>, "");
|
||||
static_assert(!ex::is_abi_tag_v<ex::simd_mask<float>>, "");
|
||||
static_assert(!is_abi_tag_v<void>, "");
|
||||
static_assert(!is_abi_tag_v<int>, "");
|
||||
static_assert(!is_abi_tag_v<float>, "");
|
||||
static_assert(!is_abi_tag_v<UserType>, "");
|
||||
static_assert(!is_abi_tag_v<simd<int>>, "");
|
||||
static_assert(!is_abi_tag_v<simd<float>>, "");
|
||||
static_assert(!is_abi_tag_v<simd_mask<int>>, "");
|
||||
static_assert(!is_abi_tag_v<simd_mask<float>>, "");
|
||||
|
||||
#endif
|
||||
|
||||
int main() {}
|
||||
|
|
|
@ -7,123 +7,127 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <experimental/simd>
|
||||
//
|
||||
// [simd.traits]
|
||||
// template <class T> struct ex::is_simd;
|
||||
// template <class T> inline constexpr bool ex::is_simd_v =
|
||||
// ex::is_simd<T>::value;
|
||||
// template <class T> struct is_simd;
|
||||
// template <class T> inline constexpr bool is_simd_v = is_simd<T>::value;
|
||||
|
||||
#include <cstdint>
|
||||
#include <experimental/simd>
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace ex = std::experimental::parallelism_v2;
|
||||
using namespace std::experimental::parallelism_v2;
|
||||
|
||||
struct UserType {};
|
||||
|
||||
static_assert(ex::is_simd<ex::native_simd<int8_t>>::value, "");
|
||||
static_assert(ex::is_simd<ex::native_simd<int16_t>>::value, "");
|
||||
static_assert(ex::is_simd<ex::native_simd<int32_t>>::value, "");
|
||||
static_assert(ex::is_simd<ex::native_simd<int64_t>>::value, "");
|
||||
static_assert(ex::is_simd<ex::native_simd<uint8_t>>::value, "");
|
||||
static_assert(ex::is_simd<ex::native_simd<uint16_t>>::value, "");
|
||||
static_assert(ex::is_simd<ex::native_simd<uint32_t>>::value, "");
|
||||
static_assert(ex::is_simd<ex::native_simd<uint64_t>>::value, "");
|
||||
static_assert(ex::is_simd<ex::native_simd<float>>::value, "");
|
||||
static_assert(ex::is_simd<ex::native_simd<double>>::value, "");
|
||||
static_assert( is_simd<native_simd<int8_t>>::value, "");
|
||||
static_assert( is_simd<native_simd<int16_t>>::value, "");
|
||||
static_assert( is_simd<native_simd<int32_t>>::value, "");
|
||||
static_assert( is_simd<native_simd<int64_t>>::value, "");
|
||||
static_assert( is_simd<native_simd<uint8_t>>::value, "");
|
||||
static_assert( is_simd<native_simd<uint16_t>>::value, "");
|
||||
static_assert( is_simd<native_simd<uint32_t>>::value, "");
|
||||
static_assert( is_simd<native_simd<uint64_t>>::value, "");
|
||||
static_assert( is_simd<native_simd<float>>::value, "");
|
||||
static_assert( is_simd<native_simd<double>>::value, "");
|
||||
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<int8_t, 1>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<int16_t, 1>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<int32_t, 1>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<int64_t, 1>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<uint8_t, 1>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<uint16_t, 1>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<uint32_t, 1>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<uint64_t, 1>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<float, 1>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<double, 1>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<int8_t, 1>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<int16_t, 1>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<int32_t, 1>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<int64_t, 1>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<uint8_t, 1>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<uint16_t, 1>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<uint32_t, 1>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<uint64_t, 1>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<float, 1>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<double, 1>>::value, "");
|
||||
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<int8_t, 3>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<int16_t, 3>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<int32_t, 3>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<int64_t, 3>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<uint8_t, 3>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<uint16_t, 3>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<uint32_t, 3>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<uint64_t, 3>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<float, 3>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<double, 3>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<int8_t, 3>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<int16_t, 3>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<int32_t, 3>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<int64_t, 3>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<uint8_t, 3>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<uint16_t, 3>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<uint32_t, 3>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<uint64_t, 3>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<float, 3>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<double, 3>>::value, "");
|
||||
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<int8_t, 32>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<int16_t, 32>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<int32_t, 32>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<int64_t, 32>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<uint8_t, 32>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<uint16_t, 32>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<uint32_t, 32>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<uint64_t, 32>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<float, 32>>::value, "");
|
||||
static_assert(ex::is_simd<ex::fixed_size_simd<double, 32>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<int8_t, 32>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<int16_t, 32>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<int32_t, 32>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<int64_t, 32>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<uint8_t, 32>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<uint16_t, 32>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<uint32_t, 32>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<uint64_t, 32>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<float, 32>>::value, "");
|
||||
static_assert( is_simd<fixed_size_simd<double, 32>>::value, "");
|
||||
|
||||
static_assert(!ex::is_simd<void>::value, "");
|
||||
static_assert(!ex::is_simd<int>::value, "");
|
||||
static_assert(!ex::is_simd<float>::value, "");
|
||||
static_assert(!ex::is_simd<ex::simd_mask<int>>::value, "");
|
||||
static_assert(!ex::is_simd<ex::simd_mask<float>>::value, "");
|
||||
static_assert(!ex::is_simd<UserType>::value, "");
|
||||
static_assert(!is_simd<void>::value, "");
|
||||
static_assert(!is_simd<int>::value, "");
|
||||
static_assert(!is_simd<float>::value, "");
|
||||
static_assert(!is_simd<simd_mask<int>>::value, "");
|
||||
static_assert(!is_simd<simd_mask<float>>::value, "");
|
||||
static_assert(!is_simd<UserType>::value, "");
|
||||
|
||||
static_assert(ex::is_simd_v<ex::native_simd<int8_t>>, "");
|
||||
static_assert(ex::is_simd_v<ex::native_simd<int16_t>>, "");
|
||||
static_assert(ex::is_simd_v<ex::native_simd<int32_t>>, "");
|
||||
static_assert(ex::is_simd_v<ex::native_simd<int64_t>>, "");
|
||||
static_assert(ex::is_simd_v<ex::native_simd<uint8_t>>, "");
|
||||
static_assert(ex::is_simd_v<ex::native_simd<uint16_t>>, "");
|
||||
static_assert(ex::is_simd_v<ex::native_simd<uint32_t>>, "");
|
||||
static_assert(ex::is_simd_v<ex::native_simd<uint64_t>>, "");
|
||||
static_assert(ex::is_simd_v<ex::native_simd<float>>, "");
|
||||
static_assert(ex::is_simd_v<ex::native_simd<double>>, "");
|
||||
#if TEST_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && \
|
||||
!defined(_LIBCPP_HAS_NO_INLINE_VARIABLES)
|
||||
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<int8_t, 1>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<int16_t, 1>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<int32_t, 1>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<int64_t, 1>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<uint8_t, 1>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<uint16_t, 1>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<uint32_t, 1>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<uint64_t, 1>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<float, 1>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<double, 1>>, "");
|
||||
static_assert( is_simd_v<native_simd<int8_t>>, "");
|
||||
static_assert( is_simd_v<native_simd<int16_t>>, "");
|
||||
static_assert( is_simd_v<native_simd<int32_t>>, "");
|
||||
static_assert( is_simd_v<native_simd<int64_t>>, "");
|
||||
static_assert( is_simd_v<native_simd<uint8_t>>, "");
|
||||
static_assert( is_simd_v<native_simd<uint16_t>>, "");
|
||||
static_assert( is_simd_v<native_simd<uint32_t>>, "");
|
||||
static_assert( is_simd_v<native_simd<uint64_t>>, "");
|
||||
static_assert( is_simd_v<native_simd<float>>, "");
|
||||
static_assert( is_simd_v<native_simd<double>>, "");
|
||||
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<int8_t, 3>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<int16_t, 3>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<int32_t, 3>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<int64_t, 3>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<uint8_t, 3>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<uint16_t, 3>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<uint32_t, 3>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<uint64_t, 3>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<float, 3>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<double, 3>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<int8_t, 1>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<int16_t, 1>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<int32_t, 1>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<int64_t, 1>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<uint8_t, 1>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<uint16_t, 1>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<uint32_t, 1>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<uint64_t, 1>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<float, 1>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<double, 1>>, "");
|
||||
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<int8_t, 32>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<int16_t, 32>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<int32_t, 32>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<int64_t, 32>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<uint8_t, 32>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<uint16_t, 32>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<uint32_t, 32>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<uint64_t, 32>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<float, 32>>, "");
|
||||
static_assert(ex::is_simd_v<ex::fixed_size_simd<double, 32>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<int8_t, 3>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<int16_t, 3>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<int32_t, 3>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<int64_t, 3>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<uint8_t, 3>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<uint16_t, 3>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<uint32_t, 3>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<uint64_t, 3>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<float, 3>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<double, 3>>, "");
|
||||
|
||||
static_assert(!ex::is_simd_v<void>, "");
|
||||
static_assert(!ex::is_simd_v<int>, "");
|
||||
static_assert(!ex::is_simd_v<float>, "");
|
||||
static_assert(!ex::is_simd_v<ex::simd_mask<int>>, "");
|
||||
static_assert(!ex::is_simd_v<ex::simd_mask<float>>, "");
|
||||
static_assert(!ex::is_simd_v<UserType>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<int8_t, 32>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<int16_t, 32>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<int32_t, 32>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<int64_t, 32>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<uint8_t, 32>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<uint16_t, 32>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<uint32_t, 32>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<uint64_t, 32>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<float, 32>>, "");
|
||||
static_assert( is_simd_v<fixed_size_simd<double, 32>>, "");
|
||||
|
||||
static_assert(!is_simd_v<void>, "");
|
||||
static_assert(!is_simd_v<int>, "");
|
||||
static_assert(!is_simd_v<float>, "");
|
||||
static_assert(!is_simd_v<simd_mask<int>>, "");
|
||||
static_assert(!is_simd_v<simd_mask<float>>, "");
|
||||
static_assert(!is_simd_v<UserType>, "");
|
||||
|
||||
#endif
|
||||
|
||||
int main() {}
|
||||
|
|
|
@ -7,45 +7,49 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <experimental/simd>
|
||||
//
|
||||
// [simd.traits]
|
||||
// template <class T> struct is_simd_flag_type;
|
||||
// template <class T> inline constexpr bool ex::is_simd_flag_type_v =
|
||||
// ex::is_simd_flag_type<T>::value;
|
||||
// template <class T> inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<T>::value;
|
||||
|
||||
#include <cstdint>
|
||||
#include <experimental/simd>
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace ex = std::experimental::parallelism_v2;
|
||||
using namespace std::experimental::parallelism_v2;
|
||||
|
||||
struct UserType {};
|
||||
|
||||
static_assert(ex::is_simd_flag_type<ex::element_aligned_tag>::value, "");
|
||||
static_assert(ex::is_simd_flag_type<ex::vector_aligned_tag>::value, "");
|
||||
static_assert(ex::is_simd_flag_type<ex::overaligned_tag<16>>::value, "");
|
||||
static_assert(ex::is_simd_flag_type<ex::overaligned_tag<32>>::value, "");
|
||||
static_assert( is_simd_flag_type<element_aligned_tag>::value, "");
|
||||
static_assert( is_simd_flag_type<vector_aligned_tag>::value, "");
|
||||
static_assert( is_simd_flag_type<overaligned_tag<16>>::value, "");
|
||||
static_assert( is_simd_flag_type<overaligned_tag<32>>::value, "");
|
||||
|
||||
static_assert(!ex::is_simd_flag_type<void>::value, "");
|
||||
static_assert(!ex::is_simd_flag_type<int>::value, "");
|
||||
static_assert(!ex::is_simd_flag_type<float>::value, "");
|
||||
static_assert(!ex::is_simd_flag_type<UserType>::value, "");
|
||||
static_assert(!ex::is_simd_flag_type<ex::simd<int8_t>>::value, "");
|
||||
static_assert(!ex::is_simd_flag_type<ex::simd_mask<int8_t>>::value, "");
|
||||
static_assert(!is_simd_flag_type<void>::value, "");
|
||||
static_assert(!is_simd_flag_type<int>::value, "");
|
||||
static_assert(!is_simd_flag_type<float>::value, "");
|
||||
static_assert(!is_simd_flag_type<UserType>::value, "");
|
||||
static_assert(!is_simd_flag_type<simd<int8_t>>::value, "");
|
||||
static_assert(!is_simd_flag_type<simd_mask<int8_t>>::value, "");
|
||||
|
||||
static_assert(ex::is_simd_flag_type_v<ex::element_aligned_tag>, "");
|
||||
static_assert(ex::is_simd_flag_type_v<ex::vector_aligned_tag>, "");
|
||||
static_assert(ex::is_simd_flag_type_v<ex::overaligned_tag<16>>, "");
|
||||
static_assert(ex::is_simd_flag_type_v<ex::overaligned_tag<32>>, "");
|
||||
#if TEST_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && \
|
||||
!defined(_LIBCPP_HAS_NO_INLINE_VARIABLES)
|
||||
|
||||
static_assert(!ex::is_simd_flag_type_v<void>, "");
|
||||
static_assert(!ex::is_simd_flag_type_v<int>, "");
|
||||
static_assert(!ex::is_simd_flag_type_v<float>, "");
|
||||
static_assert(!ex::is_simd_flag_type_v<UserType>, "");
|
||||
static_assert(!ex::is_simd_flag_type_v<ex::simd<int8_t>>, "");
|
||||
static_assert(!ex::is_simd_flag_type_v<ex::simd_mask<int8_t>>, "");
|
||||
static_assert( is_simd_flag_type_v<element_aligned_tag>, "");
|
||||
static_assert( is_simd_flag_type_v<vector_aligned_tag>, "");
|
||||
static_assert( is_simd_flag_type_v<overaligned_tag<16>>, "");
|
||||
static_assert( is_simd_flag_type_v<overaligned_tag<32>>, "");
|
||||
|
||||
static_assert(!is_simd_flag_type_v<void>, "");
|
||||
static_assert(!is_simd_flag_type_v<int>, "");
|
||||
static_assert(!is_simd_flag_type_v<float>, "");
|
||||
static_assert(!is_simd_flag_type_v<UserType>, "");
|
||||
static_assert(!is_simd_flag_type_v<simd<int8_t>>, "");
|
||||
static_assert(!is_simd_flag_type_v<simd_mask<int8_t>>, "");
|
||||
|
||||
#endif
|
||||
|
||||
int main() {}
|
||||
|
|
|
@ -7,146 +7,127 @@
|
|||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++98, c++03, c++11, c++14
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// <experimental/simd>
|
||||
//
|
||||
// [simd.traits]
|
||||
// template <class T> struct ex::is_simd_mask;
|
||||
// template <class T> inline constexpr bool ex::is_simd_mask_v =
|
||||
// ex::is_simd_mask<T>::value;
|
||||
// template <class T> struct is_simd_mask;
|
||||
// template <class T> inline constexpr bool is_simd_mask_v = is_simd_mask<T>::value;
|
||||
|
||||
#include <cstdint>
|
||||
#include <experimental/simd>
|
||||
#include "test_macros.h"
|
||||
|
||||
namespace ex = std::experimental::parallelism_v2;
|
||||
using namespace std::experimental::parallelism_v2;
|
||||
|
||||
struct UserType {};
|
||||
|
||||
static_assert(ex::is_simd_mask<ex::native_simd_mask<int8_t>>::value, "");
|
||||
static_assert(ex::is_simd_mask<ex::native_simd_mask<int16_t>>::value, "");
|
||||
static_assert(ex::is_simd_mask<ex::native_simd_mask<int32_t>>::value, "");
|
||||
static_assert(ex::is_simd_mask<ex::native_simd_mask<int64_t>>::value, "");
|
||||
static_assert(ex::is_simd_mask<ex::native_simd_mask<uint8_t>>::value, "");
|
||||
static_assert(ex::is_simd_mask<ex::native_simd_mask<uint16_t>>::value, "");
|
||||
static_assert(ex::is_simd_mask<ex::native_simd_mask<uint32_t>>::value, "");
|
||||
static_assert(ex::is_simd_mask<ex::native_simd_mask<uint64_t>>::value, "");
|
||||
static_assert(ex::is_simd_mask<ex::native_simd_mask<float>>::value, "");
|
||||
static_assert(ex::is_simd_mask<ex::native_simd_mask<double>>::value, "");
|
||||
static_assert( is_simd_mask<native_simd_mask<int8_t>>::value, "");
|
||||
static_assert( is_simd_mask<native_simd_mask<int16_t>>::value, "");
|
||||
static_assert( is_simd_mask<native_simd_mask<int32_t>>::value, "");
|
||||
static_assert( is_simd_mask<native_simd_mask<int64_t>>::value, "");
|
||||
static_assert( is_simd_mask<native_simd_mask<uint8_t>>::value, "");
|
||||
static_assert( is_simd_mask<native_simd_mask<uint16_t>>::value, "");
|
||||
static_assert( is_simd_mask<native_simd_mask<uint32_t>>::value, "");
|
||||
static_assert( is_simd_mask<native_simd_mask<uint64_t>>::value, "");
|
||||
static_assert( is_simd_mask<native_simd_mask<float>>::value, "");
|
||||
static_assert( is_simd_mask<native_simd_mask<double>>::value, "");
|
||||
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int8_t, 1>>::value, "");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int16_t, 1>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int32_t, 1>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int64_t, 1>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint8_t, 1>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint16_t, 1>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint32_t, 1>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint64_t, 1>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<float, 1>>::value, "");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<double, 1>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<int8_t, 1>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<int16_t, 1>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<int32_t, 1>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<int64_t, 1>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<uint8_t, 1>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<uint16_t, 1>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<uint32_t, 1>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<uint64_t, 1>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<float, 1>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<double, 1>>::value, "");
|
||||
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int8_t, 3>>::value, "");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int16_t, 3>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int32_t, 3>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int64_t, 3>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint8_t, 3>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint16_t, 3>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint32_t, 3>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint64_t, 3>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<float, 3>>::value, "");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<double, 3>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<int8_t, 3>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<int16_t, 3>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<int32_t, 3>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<int64_t, 3>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<uint8_t, 3>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<uint16_t, 3>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<uint32_t, 3>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<uint64_t, 3>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<float, 3>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<double, 3>>::value, "");
|
||||
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int8_t, 32>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int16_t, 32>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int32_t, 32>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<int64_t, 32>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint8_t, 32>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint16_t, 32>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint32_t, 32>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<uint64_t, 32>>::value,
|
||||
"");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<float, 32>>::value, "");
|
||||
static_assert(ex::is_simd_mask<ex::fixed_size_simd_mask<double, 32>>::value,
|
||||
"");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<int8_t, 32>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<int16_t, 32>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<int32_t, 32>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<int64_t, 32>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<uint8_t, 32>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<uint16_t, 32>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<uint32_t, 32>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<uint64_t, 32>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<float, 32>>::value, "");
|
||||
static_assert( is_simd_mask<fixed_size_simd_mask<double, 32>>::value, "");
|
||||
|
||||
static_assert(!ex::is_simd_mask<void>::value, "");
|
||||
static_assert(!ex::is_simd_mask<int>::value, "");
|
||||
static_assert(!ex::is_simd_mask<float>::value, "");
|
||||
static_assert(!ex::is_simd_mask<ex::simd<int>>::value, "");
|
||||
static_assert(!ex::is_simd_mask<ex::simd<float>>::value, "");
|
||||
static_assert(!ex::is_simd_mask<UserType>::value, "");
|
||||
static_assert(!is_simd_mask<void>::value, "");
|
||||
static_assert(!is_simd_mask<int>::value, "");
|
||||
static_assert(!is_simd_mask<float>::value, "");
|
||||
static_assert(!is_simd_mask<simd<int>>::value, "");
|
||||
static_assert(!is_simd_mask<simd<float>>::value, "");
|
||||
static_assert(!is_simd_mask<UserType>::value, "");
|
||||
|
||||
static_assert(ex::is_simd_mask_v<ex::native_simd_mask<int8_t>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::native_simd_mask<int16_t>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::native_simd_mask<int32_t>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::native_simd_mask<int64_t>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::native_simd_mask<uint8_t>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::native_simd_mask<uint16_t>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::native_simd_mask<uint32_t>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::native_simd_mask<uint64_t>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::native_simd_mask<float>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::native_simd_mask<double>>, "");
|
||||
#if TEST_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && \
|
||||
!defined(_LIBCPP_HAS_NO_INLINE_VARIABLES)
|
||||
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int8_t, 1>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int16_t, 1>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int32_t, 1>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int64_t, 1>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint8_t, 1>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint16_t, 1>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint32_t, 1>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint64_t, 1>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<float, 1>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<double, 1>>, "");
|
||||
static_assert( is_simd_mask_v<native_simd_mask<int8_t>>, "");
|
||||
static_assert( is_simd_mask_v<native_simd_mask<int16_t>>, "");
|
||||
static_assert( is_simd_mask_v<native_simd_mask<int32_t>>, "");
|
||||
static_assert( is_simd_mask_v<native_simd_mask<int64_t>>, "");
|
||||
static_assert( is_simd_mask_v<native_simd_mask<uint8_t>>, "");
|
||||
static_assert( is_simd_mask_v<native_simd_mask<uint16_t>>, "");
|
||||
static_assert( is_simd_mask_v<native_simd_mask<uint32_t>>, "");
|
||||
static_assert( is_simd_mask_v<native_simd_mask<uint64_t>>, "");
|
||||
static_assert( is_simd_mask_v<native_simd_mask<float>>, "");
|
||||
static_assert( is_simd_mask_v<native_simd_mask<double>>, "");
|
||||
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int8_t, 3>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int16_t, 3>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int32_t, 3>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int64_t, 3>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint8_t, 3>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint16_t, 3>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint32_t, 3>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint64_t, 3>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<float, 3>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<double, 3>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<int8_t, 1>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<int16_t, 1>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<int32_t, 1>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<int64_t, 1>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<uint8_t, 1>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<uint16_t, 1>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<uint32_t, 1>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<uint64_t, 1>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<float, 1>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<double, 1>>, "");
|
||||
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int8_t, 32>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int16_t, 32>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int32_t, 32>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<int64_t, 32>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint8_t, 32>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint16_t, 32>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint32_t, 32>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<uint64_t, 32>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<float, 32>>, "");
|
||||
static_assert(ex::is_simd_mask_v<ex::fixed_size_simd_mask<double, 32>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<int8_t, 3>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<int16_t, 3>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<int32_t, 3>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<int64_t, 3>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<uint8_t, 3>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<uint16_t, 3>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<uint32_t, 3>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<uint64_t, 3>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<float, 3>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<double, 3>>, "");
|
||||
|
||||
static_assert(!ex::is_simd_mask_v<void>, "");
|
||||
static_assert(!ex::is_simd_mask_v<int>, "");
|
||||
static_assert(!ex::is_simd_mask_v<float>, "");
|
||||
static_assert(!ex::is_simd_mask_v<ex::simd<int>>, "");
|
||||
static_assert(!ex::is_simd_mask_v<ex::simd<float>>, "");
|
||||
static_assert(!ex::is_simd_mask_v<UserType>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<int8_t, 32>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<int16_t, 32>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<int32_t, 32>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<int64_t, 32>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<uint8_t, 32>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<uint16_t, 32>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<uint32_t, 32>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<uint64_t, 32>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<float, 32>>, "");
|
||||
static_assert( is_simd_mask_v<fixed_size_simd_mask<double, 32>>, "");
|
||||
|
||||
static_assert(!is_simd_mask_v<void>, "");
|
||||
static_assert(!is_simd_mask_v<int>, "");
|
||||
static_assert(!is_simd_mask_v<float>, "");
|
||||
static_assert(!is_simd_mask_v<simd<int>>, "");
|
||||
static_assert(!is_simd_mask_v<simd<float>>, "");
|
||||
static_assert(!is_simd_mask_v<UserType>, "");
|
||||
|
||||
#endif
|
||||
|
||||
int main() {}
|
||||
|
|
Loading…
Reference in New Issue