Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:14:07

0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H
0011 #define _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H
0012 
0013 #include <__config>
0014 #include <__cstddef/size_t.h>
0015 
0016 #if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
0017 
0018 // TODO: support more targets
0019 #  if defined(__AVX__)
0020 #    define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 32
0021 #  else
0022 #    define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 16
0023 #  endif
0024 
0025 _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
0026 inline namespace parallelism_v2 {
0027 namespace simd_abi {
0028 template <int>
0029 struct __vec_ext;
0030 struct __scalar;
0031 
0032 using scalar = __scalar;
0033 
0034 // TODO: make this platform dependent
0035 template <int _Np>
0036 using fixed_size = __vec_ext<_Np>;
0037 
0038 template <class _Tp>
0039 inline constexpr int max_fixed_size = 32;
0040 
0041 // TODO: make this platform dependent
0042 template <class _Tp>
0043 using compatible = __vec_ext<16 / sizeof(_Tp)>;
0044 
0045 // TODO: make this platform dependent
0046 template <class _Tp>
0047 using native = __vec_ext<_LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>;
0048 
0049 // TODO: make this platform dependent
0050 template <class _Tp, size_t _Np, class... _Abis>
0051 struct deduce {
0052   using type = fixed_size<_Np>;
0053 };
0054 
0055 // TODO: make this platform dependent
0056 template <class _Tp, size_t _Np, class... _Abis>
0057 using deduce_t = typename deduce<_Tp, _Np, _Abis...>::type;
0058 
0059 } // namespace simd_abi
0060 
0061 template <class _Tp, class _Abi>
0062 struct __simd_storage;
0063 
0064 template <class _Tp, class _Abi>
0065 struct __mask_storage;
0066 
0067 template <class _Tp, class _Abi>
0068 struct __simd_operations;
0069 
0070 template <class _Tp, class _Abi>
0071 struct __mask_operations;
0072 
0073 struct element_aligned_tag;
0074 struct vector_aligned_tag;
0075 template <size_t>
0076 struct overaligned_tag;
0077 
0078 template <class _Tp, class _Abi = simd_abi::compatible<_Tp>>
0079 class simd;
0080 
0081 template <class _Tp, class _Abi = simd_abi::compatible<_Tp>>
0082 class simd_mask;
0083 
0084 } // namespace parallelism_v2
0085 _LIBCPP_END_NAMESPACE_EXPERIMENTAL
0086 
0087 #endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
0088 #endif // _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H