Make test more lenient for custom clang version strings
[llvm-project.git] / libcxx / include / experimental / __simd / declaration.h
blob1b4fcf958516c98fa274e4099969873d4a7af34f
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 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H
11 #define _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H
13 #include <__config>
14 #include <__cstddef/size_t.h>
16 #if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
18 // TODO: support more targets
19 # if defined(__AVX__)
20 # define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 32
21 # else
22 # define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 16
23 # endif
25 _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
26 inline namespace parallelism_v2 {
27 namespace simd_abi {
28 template <int>
29 struct __vec_ext;
30 struct __scalar;
32 using scalar = __scalar;
34 // TODO: make this platform dependent
35 template <int _Np>
36 using fixed_size = __vec_ext<_Np>;
38 template <class _Tp>
39 inline constexpr int max_fixed_size = 32;
41 // TODO: make this platform dependent
42 template <class _Tp>
43 using compatible = __vec_ext<16 / sizeof(_Tp)>;
45 // TODO: make this platform dependent
46 template <class _Tp>
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>
51 struct deduce {
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;
75 template <size_t>
76 struct overaligned_tag;
78 template <class _Tp, class _Abi = simd_abi::compatible<_Tp>>
79 class simd;
81 template <class _Tp, class _Abi = simd_abi::compatible<_Tp>>
82 class simd_mask;
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