]> git.uio.no Git - u/mrichter/AliRoot.git/blame - Vc/include/Vc/avx/helperimpl.h
Vc package added (version 0.6.79-dev)
[u/mrichter/AliRoot.git] / Vc / include / Vc / avx / helperimpl.h
CommitLineData
f22341db 1/* This file is part of the Vc library.
2
3 Copyright (C) 2011-2012 Matthias Kretz <kretz@kde.org>
4
5 Vc is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation, either version 3 of
8 the License, or (at your option) any later version.
9
10 Vc is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with Vc. If not, see <http://www.gnu.org/licenses/>.
17
18*/
19
20#ifndef VC_AVX_HELPERIMPL_H
21#define VC_AVX_HELPERIMPL_H
22
23#include "macros.h"
24
25namespace Vc
26{
27namespace Internal
28{
29
30template<> struct HelperImpl<Vc::AVXImpl>
31{
32 typedef AVX::Vector<float> float_v;
33 typedef AVX::Vector<sfloat> sfloat_v;
34 typedef AVX::Vector<double> double_v;
35 typedef AVX::Vector<int> int_v;
36 typedef AVX::Vector<unsigned int> uint_v;
37 typedef AVX::Vector<short> short_v;
38 typedef AVX::Vector<unsigned short> ushort_v;
39
40 template<typename A> static void deinterleave(float_v &, float_v &, const float *, A);
41 template<typename A> static void deinterleave(float_v &, float_v &, const short *, A);
42 template<typename A> static void deinterleave(float_v &, float_v &, const unsigned short *, A);
43
44 template<typename A, typename MemT> static void deinterleave(sfloat_v &, sfloat_v &, const MemT *, A);
45
46 template<typename A> static void deinterleave(double_v &, double_v &, const double *, A);
47
48 template<typename A> static void deinterleave(int_v &, int_v &, const int *, A);
49 template<typename A> static void deinterleave(int_v &, int_v &, const short *, A);
50
51 template<typename A> static void deinterleave(uint_v &, uint_v &, const unsigned int *, A);
52 template<typename A> static void deinterleave(uint_v &, uint_v &, const unsigned short *, A);
53
54 template<typename A> static void deinterleave(short_v &, short_v &, const short *, A);
55
56 template<typename A> static void deinterleave(ushort_v &, ushort_v &, const unsigned short *, A);
57
58 template<typename V, typename M, typename A>
59 static inline void deinterleave(V &VC_RESTRICT a, V &VC_RESTRICT b,
60 V &VC_RESTRICT c, const M *VC_RESTRICT memory, A align);
61
62 template<typename V, typename M, typename A>
63 static inline void deinterleave(V &VC_RESTRICT a, V &VC_RESTRICT b,
64 V &VC_RESTRICT c, V &VC_RESTRICT d,
65 const M *VC_RESTRICT memory, A align);
66
67 template<typename V, typename M, typename A>
68 static inline void deinterleave(V &VC_RESTRICT a, V &VC_RESTRICT b,
69 V &VC_RESTRICT c, V &VC_RESTRICT d, V &VC_RESTRICT e,
70 const M *VC_RESTRICT memory, A align);
71
72 template<typename V, typename M, typename A>
73 static inline void deinterleave(V &VC_RESTRICT a, V &VC_RESTRICT b,
74 V &VC_RESTRICT c, V &VC_RESTRICT d, V &VC_RESTRICT e,
75 V &VC_RESTRICT f, const M *VC_RESTRICT memory, A align);
76
77 template<typename V, typename M, typename A>
78 static inline void deinterleave(V &VC_RESTRICT a, V &VC_RESTRICT b,
79 V &VC_RESTRICT c, V &VC_RESTRICT d, V &VC_RESTRICT e,
80 V &VC_RESTRICT f, V &VC_RESTRICT g, V &VC_RESTRICT h,
81 const M *VC_RESTRICT memory, A align);
82
83 static inline void ALWAYS_INLINE_L prefetchForOneRead(const void *addr) ALWAYS_INLINE_R;
84 static inline void ALWAYS_INLINE_L prefetchForModify(const void *addr) ALWAYS_INLINE_R;
85 static inline void ALWAYS_INLINE_L prefetchClose(const void *addr) ALWAYS_INLINE_R;
86 static inline void ALWAYS_INLINE_L prefetchMid(const void *addr) ALWAYS_INLINE_R;
87 static inline void ALWAYS_INLINE_L prefetchFar(const void *addr) ALWAYS_INLINE_R;
88
89 template<Vc::MallocAlignment A>
90 static inline ALWAYS_INLINE_L void *malloc(size_t n) ALWAYS_INLINE_R;
91 static inline ALWAYS_INLINE_L void free(void *p) ALWAYS_INLINE_R;
92};
93
94} // namespace Internal
95} // namespace Vc
96
97#include "undomacros.h"
98#include "deinterleave.tcc"
99#include "prefetches.tcc"
100#include "helperimpl.tcc"
101
102#endif // VC_AVX_HELPERIMPL_H