Warning: This file is not a C or C++ file. It does not have highlighting.

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
10#ifndef _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H
11#define _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H
12
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 targets
19# if defined(__AVX__)
20# define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 32
21# else
22# define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 16
23# endif
24
25_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
26inline namespace parallelism_v2 {
27namespace simd_abi {
28template <int>
29struct __vec_ext;
30struct __scalar;
31
32using scalar = __scalar;
33
34// TODO: make this platform dependent
35template <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 dependent
42template <class _Tp>
43using compatible = __vec_ext<16 / sizeof(_Tp)>;
44
45// TODO: make this platform dependent
46template <class _Tp>
47using native = __vec_ext<_LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>;
48
49// TODO: make this platform dependent
50template <class _Tp, size_t _Np, class... _Abis>
51struct deduce {
52 using type _LIBCPP_NODEBUG = fixed_size<_Np>;
53};
54
55// TODO: make this platform dependent
56template <class _Tp, size_t _Np, class... _Abis>
57using deduce_t = typename deduce<_Tp, _Np, _Abis...>::type;
58
59} // namespace simd_abi
60
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_v2
85_LIBCPP_END_NAMESPACE_EXPERIMENTAL
86
87#endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
88#endif // _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H
89

Warning: This file is not a C or C++ file. It does not have highlighting.

source code of libcxx/include/experimental/__simd/declaration.h