declaration.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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_DECLARATION_H
  10. #define _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H
  11. #include <cstddef>
  12. #include <experimental/__config>
  13. #if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
  14. _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
  15. inline namespace parallelism_v2 {
  16. namespace simd_abi {
  17. template <int>
  18. struct __vec_ext;
  19. struct __scalar;
  20. using scalar = __scalar;
  21. // TODO: make this platform dependent
  22. template <int _Np>
  23. using fixed_size = __vec_ext<_Np>;
  24. template <class _Tp>
  25. inline constexpr int max_fixed_size = 32;
  26. // TODO: make this platform dependent
  27. template <class _Tp>
  28. using compatible = __vec_ext<16 / sizeof(_Tp)>;
  29. // TODO: make this platform dependent
  30. template <class _Tp>
  31. using native = __vec_ext<_LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>;
  32. // TODO: make this platform dependent
  33. template <class _Tp, size_t _Np, class... _Abis>
  34. struct deduce {
  35. using type = fixed_size<_Np>;
  36. };
  37. // TODO: make this platform dependent
  38. template <class _Tp, size_t _Np, class... _Abis>
  39. using deduce_t = typename deduce<_Tp, _Np, _Abis...>::type;
  40. } // namespace simd_abi
  41. template <class _Tp, class _Abi>
  42. struct __simd_storage;
  43. template <class _Tp, class _Abi>
  44. struct __mask_storage;
  45. template <class _Tp, class _Abi>
  46. struct __simd_operations;
  47. template <class _Tp, class _Abi>
  48. struct __mask_operations;
  49. struct element_aligned_tag;
  50. struct vector_aligned_tag;
  51. template <size_t>
  52. struct overaligned_tag;
  53. template <class _Tp, class _Abi = simd_abi::compatible<_Tp>>
  54. class simd;
  55. template <class _Tp, class _Abi = simd_abi::compatible<_Tp>>
  56. class simd_mask;
  57. } // namespace parallelism_v2
  58. _LIBCPP_END_NAMESPACE_EXPERIMENTAL
  59. #endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
  60. #endif // _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H