brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.3 KiB · d9395ba Raw
89 lines · c
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-exception7//8//===----------------------------------------------------------------------===//9 10#ifndef _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H11#define _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H12 13#include <__config>14#include <__cstddef/size_t.h>15 16#if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)17 18// TODO: support more targets19#  if defined(__AVX__)20#    define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 3221#  else22#    define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 1623#  endif24 25_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL26inline namespace parallelism_v2 {27namespace simd_abi {28template <int>29struct __vec_ext;30struct __scalar;31 32using scalar = __scalar;33 34// TODO: make this platform dependent35template <int _Np>36using fixed_size = __vec_ext<_Np>;37 38template <class _Tp>39inline constexpr int max_fixed_size = 32;40 41// TODO: make this platform dependent42template <class _Tp>43using compatible = __vec_ext<16 / sizeof(_Tp)>;44 45// TODO: make this platform dependent46template <class _Tp>47using native = __vec_ext<_LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>;48 49// TODO: make this platform dependent50template <class _Tp, size_t _Np, class... _Abis>51struct deduce {52  using type _LIBCPP_NODEBUG = fixed_size<_Np>;53};54 55// TODO: make this platform dependent56template <class _Tp, size_t _Np, class... _Abis>57using deduce_t = typename deduce<_Tp, _Np, _Abis...>::type;58 59} // namespace simd_abi60 61template <class _Tp, class _Abi>62struct __simd_storage;63 64template <class _Tp, class _Abi>65struct __mask_storage;66 67template <class _Tp, class _Abi>68struct __simd_operations;69 70template <class _Tp, class _Abi>71struct __mask_operations;72 73struct element_aligned_tag;74struct vector_aligned_tag;75template <size_t>76struct overaligned_tag;77 78template <class _Tp, class _Abi = simd_abi::compatible<_Tp>>79class simd;80 81template <class _Tp, class _Abi = simd_abi::compatible<_Tp>>82class simd_mask;83 84} // namespace parallelism_v285_LIBCPP_END_NAMESPACE_EXPERIMENTAL86 87#endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)88#endif // _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H89