memcpy: hide some memory latencies
[nova-simd.git] / vec.hpp
blob9f33441b879864776007bb27aa3979d773e78c58
1 // generic vector class
2 //
3 // Copyright (C) 2010 Tim Blechmann
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; see the file COPYING. If not, write to
17 // the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 // Boston, MA 02111-1307, USA.
20 #ifndef VEC_HPP
21 #define VEC_HPP
23 #include "vec/vec_generic.hpp"
25 #ifdef __ARM_NEON__
26 # include "vec/vec_neon.hpp"
27 #endif
29 #ifdef __ALTIVEC__
30 # include "vec/vec_altivec.hpp"
31 #endif
33 #ifdef __AVX__
34 # include "vec/vec_avx_float.hpp"
35 #elif defined(__SSE__)
36 # include "vec/vec_sse.hpp"
37 #endif
39 #ifdef __AVX__
40 # include "vec/vec_avx_double.hpp"
41 #elif defined(__SSE2__)
42 # include "vec/vec_sse2.hpp"
43 #endif
45 namespace nova
48 template <typename T>
49 T max_(T const & left, T const & right)
51 return std::max(left, right);
54 template <typename T>
55 T min_(T const & left, T const & right)
57 return std::min(left, right);
62 #endif /* VEC_HPP */