1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // UNSUPPORTED: c++98, c++03
11 
12 // <experimental/simd>
13 //
14 // [simd.casts]
15 // template <class T, class U, class Abi> see below simd_cast(const simd<U, Abi>&);
16 #include <experimental/simd>
17 #include <cstdint>
18 
19 using namespace std::experimental::parallelism_v2;
20 
21 static_assert(std::is_same<decltype(simd_cast<int32_t>(native_simd<int32_t>())),
22                            native_simd<int32_t>>::value,
23               "");
24 
25 static_assert(
26     std::is_same<decltype(simd_cast<int64_t>(fixed_size_simd<int32_t, 4>())),
27                  fixed_size_simd<int64_t, 4>>::value,
28     "");
29 
30 static_assert(std::is_same<decltype(simd_cast<fixed_size_simd<int64_t, 1>>(
31                                simd<int32_t, simd_abi::scalar>())),
32                            fixed_size_simd<int64_t, 1>>::value,
33               "");
34 
35 static_assert(std::is_same<decltype(simd_cast<simd<int64_t, simd_abi::scalar>>(
36                                fixed_size_simd<int32_t, 1>())),
37                            simd<int64_t, simd_abi::scalar>>::value,
38               "");
39 
40 int main() {}
41