ROOT  6.06/09
Reference Guide
limits.h
Go to the documentation of this file.
1 /* This file is part of the Vc library.
2 
3  Copyright (C) 2009-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_AVX_LIMITS_H
21 #define VC_AVX_LIMITS_H
22 
23 #include "intrinsics.h"
24 #include "types.h"
25 
26 namespace std
27 {
28 #define _VC_NUM_LIM(T, _max, _min) \
29 template<> struct numeric_limits< ::ROOT::Vc::AVX::Vector<T> > : public numeric_limits<T> \
30 { \
31  static Vc_INTRINSIC Vc_CONST ::ROOT::Vc::AVX::Vector<T> max() _VC_NOEXCEPT { return _max; } \
32  static Vc_INTRINSIC Vc_CONST ::ROOT::Vc::AVX::Vector<T> min() _VC_NOEXCEPT { return _min; } \
33  static Vc_INTRINSIC Vc_CONST ::ROOT::Vc::AVX::Vector<T> lowest() _VC_NOEXCEPT { return min(); } \
34  static Vc_INTRINSIC Vc_CONST ::ROOT::Vc::AVX::Vector<T> epsilon() _VC_NOEXCEPT { return ::ROOT::Vc::AVX::Vector<T>::Zero(); } \
35  static Vc_INTRINSIC Vc_CONST ::ROOT::Vc::AVX::Vector<T> round_error() _VC_NOEXCEPT { return ::ROOT::Vc::AVX::Vector<T>::Zero(); } \
36  static Vc_INTRINSIC Vc_CONST ::ROOT::Vc::AVX::Vector<T> infinity() _VC_NOEXCEPT { return ::ROOT::Vc::AVX::Vector<T>::Zero(); } \
37  static Vc_INTRINSIC Vc_CONST ::ROOT::Vc::AVX::Vector<T> quiet_NaN() _VC_NOEXCEPT { return ::ROOT::Vc::AVX::Vector<T>::Zero(); } \
38  static Vc_INTRINSIC Vc_CONST ::ROOT::Vc::AVX::Vector<T> signaling_NaN() _VC_NOEXCEPT { return ::ROOT::Vc::AVX::Vector<T>::Zero(); } \
39  static Vc_INTRINSIC Vc_CONST ::ROOT::Vc::AVX::Vector<T> denorm_min() _VC_NOEXCEPT { return ::ROOT::Vc::AVX::Vector<T>::Zero(); } \
40 }
41 
42 #ifndef VC_IMPL_AVX2
43 namespace {
44  using ::ROOT::Vc::AVX::_mm256_srli_epi32;
45 }
46 #endif
47 _VC_NUM_LIM(unsigned short, ::ROOT::Vc::AVX::_mm_setallone_si128(), _mm_setzero_si128());
49 _VC_NUM_LIM( unsigned int, ::ROOT::Vc::AVX::_mm256_setallone_si256(), _mm256_setzero_si256());
51 #undef _VC_NUM_LIM
52 
53 } // namespace std
54 
55 #endif // VC_AVX_LIMITS_H
static Vc_INTRINSIC m256i Vc_CONST _mm256_setmin_epi32()
Definition: intrinsics.h:210
static Vc_INTRINSIC m128i Vc_CONST _mm_setallone_si128()
Definition: intrinsics.h:165
static Vc_INTRINSIC m128i Vc_CONST _mm_setmin_epi16()
Definition: intrinsics.h:207
STL namespace.
#define _VC_NUM_LIM(T, _max, _min)
Definition: limits.h:28
static Vc_INTRINSIC m256i Vc_CONST _mm256_setallone_si256()
Definition: intrinsics.h:184