1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // UNSUPPORTED: c++98, c++03, c++11, c++14
10 
11 // <experimental/simd>
12 //
13 // [simd.casts]
14 // template <class T, class U, class Abi> see below ex::simd_cast<(const
15 // ex::simd<U, Abi>&);
16 
17 #include <experimental/simd>
18 #include <cstdint>
19 
20 namespace ex = std::experimental::parallelism_v2;
21 
22 static_assert(
23     std::is_same<decltype(ex::simd_cast<int32_t>(ex::native_simd<int32_t>())),
24                  ex::native_simd<int32_t>>::value,
25     "");
26 
27 static_assert(std::is_same<decltype(ex::simd_cast<int64_t>(
28                                ex::fixed_size_simd<int32_t, 4>())),
29                            ex::fixed_size_simd<int64_t, 4>>::value,
30               "");
31 
32 static_assert(
33     std::is_same<decltype(ex::simd_cast<ex::fixed_size_simd<int64_t, 1>>(
34                      ex::simd<int32_t, ex::simd_abi::scalar>())),
35                  ex::fixed_size_simd<int64_t, 1>>::value,
36     "");
37 
38 static_assert(
39     std::is_same<
40         decltype(ex::simd_cast<ex::simd<int64_t, ex::simd_abi::scalar>>(
41             ex::fixed_size_simd<int32_t, 1>())),
42         ex::simd<int64_t, ex::simd_abi::scalar>>::value,
43     "");
44 
45 int main(int, char**) {
46   return 0;
47 }
48