• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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, c++11, c++14
11 
12 // <experimental/simd>
13 //
14 // [simd.casts]
15 // template <class T, class U, class Abi> see below ex::simd_cast<(const
16 // ex::simd<U, Abi>&);
17 
18 #include <experimental/simd>
19 #include <cstdint>
20 
21 namespace ex = std::experimental::parallelism_v2;
22 
23 static_assert(
24     std::is_same<decltype(ex::simd_cast<int32_t>(ex::native_simd<int32_t>())),
25                  ex::native_simd<int32_t>>::value,
26     "");
27 
28 static_assert(std::is_same<decltype(ex::simd_cast<int64_t>(
29                                ex::fixed_size_simd<int32_t, 4>())),
30                            ex::fixed_size_simd<int64_t, 4>>::value,
31               "");
32 
33 static_assert(
34     std::is_same<decltype(ex::simd_cast<ex::fixed_size_simd<int64_t, 1>>(
35                      ex::simd<int32_t, ex::simd_abi::scalar>())),
36                  ex::fixed_size_simd<int64_t, 1>>::value,
37     "");
38 
39 static_assert(
40     std::is_same<
41         decltype(ex::simd_cast<ex::simd<int64_t, ex::simd_abi::scalar>>(
42             ex::fixed_size_simd<int32_t, 1>())),
43         ex::simd<int64_t, ex::simd_abi::scalar>>::value,
44     "");
45 
main()46 int main() {}
47