1 // -*- C++ -*- 2 //===----------------------------------------------------------------------===// 3 // 4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 // See https://llvm.org/LICENSE.txt for license information. 6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H 11 #define _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H 12 13 #include <cstddef> 14 #include <experimental/__config> 15 16 #if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL) 17 18 _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL 19 inline namespace parallelism_v2 { 20 namespace simd_abi { 21 template <int> 22 struct __vec_ext; 23 struct __scalar; 24 25 using scalar = __scalar; 26 27 // TODO: make this platform dependent 28 template <int _Np> 29 using fixed_size = __vec_ext<_Np>; 30 31 template <class _Tp> 32 inline constexpr int max_fixed_size = 32; 33 34 // TODO: make this platform dependent 35 template <class _Tp> 36 using compatible = __vec_ext<16 / sizeof(_Tp)>; 37 38 // TODO: make this platform dependent 39 template <class _Tp> 40 using native = __vec_ext<_LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>; 41 42 // TODO: make this platform dependent 43 template <class _Tp, size_t _Np, class... _Abis> 44 struct deduce { 45 using type = fixed_size<_Np>; 46 }; 47 48 // TODO: make this platform dependent 49 template <class _Tp, size_t _Np, class... _Abis> 50 using deduce_t = typename deduce<_Tp, _Np, _Abis...>::type; 51 52 } // namespace simd_abi 53 54 template <class _Tp, class _Abi> 55 struct __simd_storage; 56 57 template <class _Tp, class _Abi> 58 struct __mask_storage; 59 60 template <class _Tp, class _Abi> 61 struct __simd_operations; 62 63 template <class _Tp, class _Abi> 64 struct __mask_operations; 65 66 struct element_aligned_tag; 67 struct vector_aligned_tag; 68 template <size_t> 69 struct overaligned_tag; 70 71 template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> 72 class simd; 73 74 template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> 75 class simd_mask; 76 77 } // namespace parallelism_v2 78 _LIBCPP_END_NAMESPACE_EXPERIMENTAL 79 80 #endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL) 81 #endif // _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H 82