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::static_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::static_simd_cast<float>(ex::native_simd<int>())), 24 ex::native_simd<float>>::value, 25 ""); 26 27 static_assert( 28 std::is_same<decltype(ex::static_simd_cast<ex::fixed_size_simd<float, 1>>( 29 ex::simd<int, ex::simd_abi::scalar>())), 30 ex::fixed_size_simd<float, 1>>::value, 31 ""); 32 33 static_assert( 34 std::is_same< 35 decltype(ex::static_simd_cast<ex::simd<float, ex::simd_abi::scalar>>( 36 ex::fixed_size_simd<int, 1>())), 37 ex::simd<float, ex::simd_abi::scalar>>::value, 38 ""); 39 40 int main(int, char**) { 41 return 0; 42 } 43