2 //===----------------------------------------------------------------------===//
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
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H
11 #define _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H
14 #include <__cstddef/size_t.h>
16 #if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
18 // TODO: support more targets
20 # define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 32
22 # define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 16
25 _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
26 inline namespace parallelism_v2
{
32 using scalar
= __scalar
;
34 // TODO: make this platform dependent
36 using fixed_size
= __vec_ext
<_Np
>;
39 inline constexpr int max_fixed_size
= 32;
41 // TODO: make this platform dependent
43 using compatible
= __vec_ext
<16 / sizeof(_Tp
)>;
45 // TODO: make this platform dependent
47 using native
= __vec_ext
<_LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES
/ sizeof(_Tp
)>;
49 // TODO: make this platform dependent
50 template <class _Tp
, size_t _Np
, class... _Abis
>
52 using type
= fixed_size
<_Np
>;
55 // TODO: make this platform dependent
56 template <class _Tp
, size_t _Np
, class... _Abis
>
57 using deduce_t
= typename deduce
<_Tp
, _Np
, _Abis
...>::type
;
59 } // namespace simd_abi
61 template <class _Tp
, class _Abi
>
62 struct __simd_storage
;
64 template <class _Tp
, class _Abi
>
65 struct __mask_storage
;
67 template <class _Tp
, class _Abi
>
68 struct __simd_operations
;
70 template <class _Tp
, class _Abi
>
71 struct __mask_operations
;
73 struct element_aligned_tag
;
74 struct vector_aligned_tag
;
76 struct overaligned_tag
;
78 template <class _Tp
, class _Abi
= simd_abi::compatible
<_Tp
>>
81 template <class _Tp
, class _Abi
= simd_abi::compatible
<_Tp
>>
84 } // namespace parallelism_v2
85 _LIBCPP_END_NAMESPACE_EXPERIMENTAL
87 #endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
88 #endif // _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H