simd 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. #ifndef _LIBCPP_EXPERIMENTAL_SIMD
  10. #define _LIBCPP_EXPERIMENTAL_SIMD
  11. /*
  12. experimental/simd synopsis
  13. namespace std::experimental {
  14. inline namespace parallelism_v2 {
  15. namespace simd_abi {
  16. using scalar = see below;
  17. template<int N> using fixed_size = see below;
  18. template<class T> inline constexpr int max_fixed_size = implementation-defined;
  19. template<class T> using compatible = implementation-defined;
  20. template<class T> using native = implementation-defined;
  21. template<class T, size_t N, class... Abis> struct deduce { using type = see below; };
  22. template<class T, size_t N, class... Abis> using deduce_t =
  23. typename deduce<T, N, Abis...>::type;
  24. } // namespace simd_abi
  25. // class template simd [simd.class]
  26. template <class T, class Abi = simd_abi::compatible<T>> class simd;
  27. template <class T> using native_simd = simd<T, simd_abi::native<T>>;
  28. template <class T, int N> using fixed_size_simd = simd<T, simd_abi::fixed_size<N>>;
  29. // class template simd_mask [simd.mask.class]
  30. template <class T, class Abi = simd_abi::compatible<T>> class simd_mask;
  31. template <class T> using native_simd_mask = simd_mask<T, simd_abi::native<T>>;
  32. template <class T, int N> using fixed_size_simd_mask = simd_mask<T, simd_abi::fixed_size<N>>;
  33. // memory alignment
  34. struct element_aligned_tag {};
  35. struct vector_aligned_tag {};
  36. template <size_t> struct overaligned_tag {};
  37. inline constexpr element_aligned_tag element_aligned{};
  38. inline constexpr vector_aligned_tag vector_aligned{};
  39. template <size_t N> inline constexpr overaligned_tag<N> overaligned{};
  40. // traits [simd.traits]
  41. template<class T> struct is_abi_tag;
  42. template<class T> inline constexpr bool is_abi_tag_v = is_abi_tag<T>::value;
  43. template <class T> struct is_simd;
  44. template <class T> inline constexpr bool is_simd_v = is_simd<T>::value;
  45. template <class T> struct is_simd_mask;
  46. template <class T> inline constexpr bool is_simd_mask_v = is_simd_mask<T>::value;
  47. template<class T> struct is_simd_flag_type;
  48. template<class T> inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<T>::value;
  49. template<class T, class Abi = simd_abi::compatible<T>> struct simd_size;
  50. template<class T, class Abi = simd_abi::compatible<T>>
  51. inline constexpr size_t simd_size_v = simd_size<T,Abi>::value;
  52. template<class T, class U = typename T::value_type> struct memory_alignment;
  53. template<class T, class U = typename T::value_type>
  54. inline constexpr size_t memory_alignment_v = memory_alignment<T,U>::value;
  55. } // namespace parallelism_v2
  56. } // namespace std::experimental
  57. */
  58. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  59. # pragma GCC system_header
  60. #endif
  61. #include <experimental/__config>
  62. #include <experimental/__simd/aligned_tag.h>
  63. #include <experimental/__simd/declaration.h>
  64. #include <experimental/__simd/scalar.h>
  65. #include <experimental/__simd/simd.h>
  66. #include <experimental/__simd/simd_mask.h>
  67. #include <experimental/__simd/traits.h>
  68. #include <experimental/__simd/vec_ext.h>
  69. #endif /* _LIBCPP_EXPERIMENTAL_SIMD */