xref: /freebsd/contrib/llvm-project/libcxx/include/experimental/simd (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
10b57cec5SDimitry Andric// -*- C++ -*-
2349cc55cSDimitry Andric//===----------------------------------------------------------------------===//
30b57cec5SDimitry Andric//
40b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
50b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
60b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
70b57cec5SDimitry Andric//
80b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
9bdd1243dSDimitry Andric
100b57cec5SDimitry Andric#ifndef _LIBCPP_EXPERIMENTAL_SIMD
110b57cec5SDimitry Andric#define _LIBCPP_EXPERIMENTAL_SIMD
120b57cec5SDimitry Andric
130b57cec5SDimitry Andric/*
140b57cec5SDimitry Andric    experimental/simd synopsis
150b57cec5SDimitry Andric
160b57cec5SDimitry Andricnamespace std::experimental {
170b57cec5SDimitry Andricinline namespace parallelism_v2 {
180b57cec5SDimitry Andric  namespace simd_abi {
19*5f757f3fSDimitry Andric    using scalar = see below;
20*5f757f3fSDimitry Andric    template<int N> using fixed_size = see below;
21*5f757f3fSDimitry Andric    template<class T> inline constexpr int max_fixed_size = implementation-defined;
22*5f757f3fSDimitry Andric    template<class T> using compatible = implementation-defined;
23*5f757f3fSDimitry Andric    template<class T> using native = implementation-defined;
240b57cec5SDimitry Andric
25*5f757f3fSDimitry Andric    template<class T, size_t N, class... Abis> struct deduce { using type = see below; };
26*5f757f3fSDimitry Andric    template<class T, size_t N, class... Abis> using deduce_t =
27*5f757f3fSDimitry Andric      typename deduce<T, N, Abis...>::type;
28*5f757f3fSDimitry Andric  } // namespace simd_abi
290b57cec5SDimitry Andric
30*5f757f3fSDimitry Andric  // class template simd [simd.class]
31*5f757f3fSDimitry Andric  template <class T, class Abi = simd_abi::compatible<T>> class simd;
32*5f757f3fSDimitry Andric  template <class T> using native_simd = simd<T, simd_abi::native<T>>;
33*5f757f3fSDimitry Andric  template <class T, int N> using fixed_size_simd = simd<T, simd_abi::fixed_size<N>>;
340b57cec5SDimitry Andric
35*5f757f3fSDimitry Andric  // class template simd_mask [simd.mask.class]
36*5f757f3fSDimitry Andric  template <class T, class Abi = simd_abi::compatible<T>> class simd_mask;
37*5f757f3fSDimitry Andric  template <class T> using native_simd_mask = simd_mask<T, simd_abi::native<T>>;
38*5f757f3fSDimitry Andric  template <class T, int N> using fixed_size_simd_mask = simd_mask<T, simd_abi::fixed_size<N>>;
39*5f757f3fSDimitry Andric
40*5f757f3fSDimitry Andric  // memory alignment
410b57cec5SDimitry Andric  struct element_aligned_tag {};
420b57cec5SDimitry Andric  struct vector_aligned_tag {};
430b57cec5SDimitry Andric  template <size_t> struct overaligned_tag {};
440b57cec5SDimitry Andric  inline constexpr element_aligned_tag element_aligned{};
450b57cec5SDimitry Andric  inline constexpr vector_aligned_tag vector_aligned{};
460b57cec5SDimitry Andric  template <size_t N> inline constexpr overaligned_tag<N> overaligned{};
470b57cec5SDimitry Andric
480b57cec5SDimitry Andric  // traits [simd.traits]
490b57cec5SDimitry Andric  template<class T> struct is_abi_tag;
500b57cec5SDimitry Andric  template<class T> inline constexpr bool is_abi_tag_v = is_abi_tag<T>::value;
510b57cec5SDimitry Andric
520b57cec5SDimitry Andric  template <class T> struct is_simd;
530b57cec5SDimitry Andric  template <class T> inline constexpr bool is_simd_v = is_simd<T>::value;
540b57cec5SDimitry Andric
550b57cec5SDimitry Andric  template <class T> struct is_simd_mask;
560b57cec5SDimitry Andric  template <class T> inline constexpr bool is_simd_mask_v = is_simd_mask<T>::value;
570b57cec5SDimitry Andric
580b57cec5SDimitry Andric  template<class T> struct is_simd_flag_type;
590b57cec5SDimitry Andric  template<class T> inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<T>::value;
600b57cec5SDimitry Andric
610b57cec5SDimitry Andric  template<class T, class Abi = simd_abi::compatible<T>> struct simd_size;
620b57cec5SDimitry Andric  template<class T, class Abi = simd_abi::compatible<T>>
630b57cec5SDimitry Andric    inline constexpr size_t simd_size_v = simd_size<T,Abi>::value;
640b57cec5SDimitry Andric
650b57cec5SDimitry Andric  template<class T, class U = typename T::value_type> struct memory_alignment;
660b57cec5SDimitry Andric  template<class T, class U = typename T::value_type>
670b57cec5SDimitry Andric    inline constexpr size_t memory_alignment_v = memory_alignment<T,U>::value;
680b57cec5SDimitry Andric
69*5f757f3fSDimitry Andric} // namespace parallelism_v2
70*5f757f3fSDimitry Andric} // namespace std::experimental
710b57cec5SDimitry Andric
720b57cec5SDimitry Andric*/
730b57cec5SDimitry Andric
7481ad6265SDimitry Andric#include <__assert> // all public C++ headers provide the assertion handler
7581ad6265SDimitry Andric
760b57cec5SDimitry Andric#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
770b57cec5SDimitry Andric#  pragma GCC system_header
780b57cec5SDimitry Andric#endif
790b57cec5SDimitry Andric
80*5f757f3fSDimitry Andric#include <experimental/__config>
81*5f757f3fSDimitry Andric#include <experimental/__simd/abi_tag.h>
82*5f757f3fSDimitry Andric#include <experimental/__simd/aligned_tag.h>
83*5f757f3fSDimitry Andric#include <experimental/__simd/declaration.h>
84*5f757f3fSDimitry Andric#include <experimental/__simd/scalar.h>
85*5f757f3fSDimitry Andric#include <experimental/__simd/simd.h>
86*5f757f3fSDimitry Andric#include <experimental/__simd/simd_mask.h>
87*5f757f3fSDimitry Andric#include <experimental/__simd/traits.h>
88*5f757f3fSDimitry Andric#include <experimental/__simd/vec_ext.h>
89bdd1243dSDimitry Andric
900b57cec5SDimitry Andric#endif /* _LIBCPP_EXPERIMENTAL_SIMD */
91