~ubuntu-branches/ubuntu/raring/vc/raring-proposed

« back to all changes in this revision

Viewing changes to sse/helperimpl.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-03-08 12:50:59 UTC
  • Revision ID: package-import@ubuntu.com-20130308125059-2vpu3hm02kgrqv96
Tags: upstream-0.7.0
ImportĀ upstreamĀ versionĀ 0.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  This file is part of the Vc library.
 
2
 
 
3
    Copyright (C) 2010-2011 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_SSE_DEINTERLEAVE_H
 
21
#define VC_SSE_DEINTERLEAVE_H
 
22
 
 
23
#include "macros.h"
 
24
 
 
25
namespace Vc
 
26
{
 
27
namespace Internal
 
28
{
 
29
 
 
30
template<> struct HelperImpl<Vc::SSE2Impl>
 
31
{
 
32
    typedef SSE::Vector<float> float_v;
 
33
    typedef SSE::Vector<SSE::float8> sfloat_v;
 
34
    typedef SSE::Vector<double> double_v;
 
35
    typedef SSE::Vector<int> int_v;
 
36
    typedef SSE::Vector<unsigned int> uint_v;
 
37
    typedef SSE::Vector<short> short_v;
 
38
    typedef SSE::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> static void deinterleave(sfloat_v &, sfloat_v &, const float *, A);
 
45
    template<typename A> static void deinterleave(sfloat_v &, sfloat_v &, const short *, A);
 
46
    template<typename A> static void deinterleave(sfloat_v &, sfloat_v &, const unsigned short *, A);
 
47
 
 
48
    template<typename A> static void deinterleave(double_v &, double_v &, const double *, A);
 
49
 
 
50
    template<typename A> static void deinterleave(int_v &, int_v &, const int *, A);
 
51
    template<typename A> static void deinterleave(int_v &, int_v &, const short *, A);
 
52
 
 
53
    template<typename A> static void deinterleave(uint_v &, uint_v &, const unsigned int *, A);
 
54
    template<typename A> static void deinterleave(uint_v &, uint_v &, const unsigned short *, A);
 
55
 
 
56
    template<typename A> static void deinterleave(short_v &, short_v &, const short *, A);
 
57
 
 
58
    template<typename A> static void deinterleave(ushort_v &, ushort_v &, const unsigned short *, A);
 
59
 
 
60
    static Vc_ALWAYS_INLINE_L void prefetchForOneRead(const void *addr) Vc_ALWAYS_INLINE_R;
 
61
    static Vc_ALWAYS_INLINE_L void prefetchForModify(const void *addr) Vc_ALWAYS_INLINE_R;
 
62
    static Vc_ALWAYS_INLINE_L void prefetchClose(const void *addr) Vc_ALWAYS_INLINE_R;
 
63
    static Vc_ALWAYS_INLINE_L void prefetchMid(const void *addr) Vc_ALWAYS_INLINE_R;
 
64
    static Vc_ALWAYS_INLINE_L void prefetchFar(const void *addr) Vc_ALWAYS_INLINE_R;
 
65
 
 
66
    template<Vc::MallocAlignment A>
 
67
    static Vc_ALWAYS_INLINE_L void *malloc(size_t n) Vc_ALWAYS_INLINE_R;
 
68
    static Vc_ALWAYS_INLINE_L void free(void *p) Vc_ALWAYS_INLINE_R;
 
69
};
 
70
 
 
71
template<> struct HelperImpl<SSE3Impl> : public HelperImpl<SSE2Impl> {};
 
72
template<> struct HelperImpl<SSSE3Impl> : public HelperImpl<SSE3Impl> {};
 
73
template<> struct HelperImpl<SSE41Impl> : public HelperImpl<SSSE3Impl> {};
 
74
template<> struct HelperImpl<SSE42Impl> : public HelperImpl<SSE41Impl> {};
 
75
 
 
76
 
 
77
} // namespace Internal
 
78
} // namespace Vc
 
79
 
 
80
#include "deinterleave.tcc"
 
81
#include "prefetches.tcc"
 
82
#include "helperimpl.tcc"
 
83
#include "undomacros.h"
 
84
 
 
85
#endif // VC_SSE_DEINTERLEAVE_H