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
11 #define _LIBCPP_EXPERIMENTAL_SIMD
14 experimental/simd synopsis
16 namespace std::experimental {
17 inline namespace parallelism_v2 {
19 using scalar = see below;
20 template<int N> using fixed_size = see below;
21 template<class T> inline constexpr int max_fixed_size = implementation-defined;
22 template<class T> using compatible = implementation-defined;
23 template<class T> using native = implementation-defined;
25 template<class T, size_t N, class... Abis> struct deduce { using type = see below; };
26 template<class T, size_t N, class... Abis> using deduce_t =
27 typename deduce<T, N, Abis...>::type;
28 } // namespace simd_abi
30 // class template simd [simd.class]
31 template <class T, class Abi = simd_abi::compatible<T>> class simd;
32 template <class T> using native_simd = simd<T, simd_abi::native<T>>;
33 template <class T, int N> using fixed_size_simd = simd<T, simd_abi::fixed_size<N>>;
35 // class template simd_mask [simd.mask.class]
36 template <class T, class Abi = simd_abi::compatible<T>> class simd_mask;
37 template <class T> using native_simd_mask = simd_mask<T, simd_abi::native<T>>;
38 template <class T, int N> using fixed_size_simd_mask = simd_mask<T, simd_abi::fixed_size<N>>;
41 struct element_aligned_tag {};
42 struct vector_aligned_tag {};
43 template <size_t> struct overaligned_tag {};
44 inline constexpr element_aligned_tag element_aligned{};
45 inline constexpr vector_aligned_tag vector_aligned{};
46 template <size_t N> inline constexpr overaligned_tag<N> overaligned{};
48 // traits [simd.traits]
49 template<class T> struct is_abi_tag;
50 template<class T> inline constexpr bool is_abi_tag_v = is_abi_tag<T>::value;
52 template <class T> struct is_simd;
53 template <class T> inline constexpr bool is_simd_v = is_simd<T>::value;
55 template <class T> struct is_simd_mask;
56 template <class T> inline constexpr bool is_simd_mask_v = is_simd_mask<T>::value;
58 template<class T> struct is_simd_flag_type;
59 template<class T> inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<T>::value;
61 template<class T, class Abi = simd_abi::compatible<T>> struct simd_size;
62 template<class T, class Abi = simd_abi::compatible<T>>
63 inline constexpr size_t simd_size_v = simd_size<T,Abi>::value;
65 template<class T, class U = typename T::value_type> struct memory_alignment;
66 template<class T, class U = typename T::value_type>
67 inline constexpr size_t memory_alignment_v = memory_alignment<T,U>::value;
69 } // namespace parallelism_v2
70 } // namespace std::experimental
74 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
75 # pragma GCC system_header
81 # include <experimental/__simd/aligned_tag.h>
82 # include <experimental/__simd/declaration.h>
83 # include <experimental/__simd/reference.h>
84 # include <experimental/__simd/scalar.h>
85 # include <experimental/__simd/simd.h>
86 # include <experimental/__simd/simd_mask.h>
87 # include <experimental/__simd/traits.h>
88 # include <experimental/__simd/vec_ext.h>
90 # if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
95 #endif /* _LIBCPP_EXPERIMENTAL_SIMD */