]>
Commit | Line | Data |
---|---|---|
f22341db | 1 | /* This file is part of the Vc library. |
2 | ||
3 | Copyright (C) 2010, 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_PREFETCHES_TCC | |
21 | #define VC_AVX_PREFETCHES_TCC | |
22 | ||
c017a39f | 23 | namespace AliRoot { |
f22341db | 24 | namespace Vc |
25 | { | |
26 | namespace Internal | |
27 | { | |
28 | ||
c017a39f | 29 | Vc_ALWAYS_INLINE void HelperImpl<Vc::AVXImpl>::prefetchForOneRead(const void *addr) |
f22341db | 30 | { |
31 | _mm_prefetch(static_cast<char *>(const_cast<void *>(addr)), _MM_HINT_NTA); | |
32 | } | |
c017a39f | 33 | Vc_ALWAYS_INLINE void HelperImpl<Vc::AVXImpl>::prefetchClose(const void *addr) |
f22341db | 34 | { |
35 | _mm_prefetch(static_cast<char *>(const_cast<void *>(addr)), _MM_HINT_T0); | |
36 | } | |
c017a39f | 37 | Vc_ALWAYS_INLINE void HelperImpl<Vc::AVXImpl>::prefetchMid(const void *addr) |
f22341db | 38 | { |
39 | _mm_prefetch(static_cast<char *>(const_cast<void *>(addr)), _MM_HINT_T1); | |
40 | } | |
c017a39f | 41 | Vc_ALWAYS_INLINE void HelperImpl<Vc::AVXImpl>::prefetchFar(const void *addr) |
f22341db | 42 | { |
43 | _mm_prefetch(static_cast<char *>(const_cast<void *>(addr)), _MM_HINT_T2); | |
44 | } | |
c017a39f | 45 | Vc_ALWAYS_INLINE void HelperImpl<Vc::AVXImpl>::prefetchForModify(const void *addr) |
f22341db | 46 | { |
47 | #ifdef __3dNOW__ | |
48 | _m_prefetchw(const_cast<void *>(addr)); | |
49 | #else | |
50 | _mm_prefetch(static_cast<char *>(const_cast<void *>(addr)), _MM_HINT_T0); | |
51 | #endif | |
52 | } | |
53 | ||
54 | } // namespace Internal | |
55 | } // namespace Vc | |
c017a39f | 56 | } // namespace AliRoot |
f22341db | 57 | |
58 | #endif // VC_AVX_PREFETCHES_TCC |