
[libcxx] <experimental/simd> Add ABI tags, class template simd/simd_mask implementations. [libcxx] <experimental/simd> Add traits is_abi_tag[_v], is_simd[_v] and is_simd_mask[_v]. [libcxx] <experimental/simd> Add related tests. Reviewed By: #libc, philnik Differential Revision: https://reviews.llvm.org/D144362
41 lines
1.2 KiB
C++
41 lines
1.2 KiB
C++
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// UNSUPPORTED: c++03, c++11, c++14
|
|
|
|
// <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;
|
|
|
|
#include "../test_utils.h"
|
|
|
|
namespace ex = std::experimental::parallelism_v2;
|
|
|
|
template <class T, std::size_t>
|
|
struct CheckIsSimdMask {
|
|
template <class SimdAbi>
|
|
void operator()() {
|
|
static_assert(ex::is_simd_mask<ex::simd_mask<T, SimdAbi>>::value);
|
|
|
|
static_assert(!ex::is_simd_mask<T>::value);
|
|
static_assert(!ex::is_simd_mask<ex::simd<T, SimdAbi>>::value);
|
|
|
|
static_assert(ex::is_simd_mask_v<ex::simd_mask<T, SimdAbi>>);
|
|
|
|
static_assert(!ex::is_simd_mask_v<T>);
|
|
static_assert(!ex::is_simd_mask_v<ex::simd<T, SimdAbi>>);
|
|
}
|
|
};
|
|
|
|
int main(int, char**) {
|
|
test_all_simd_abi<CheckIsSimdMask>();
|
|
return 0;
|
|
}
|