]> git.uio.no Git - u/mrichter/AliRoot.git/blob - Vc/include/Vc/sse/limits.h
update to Vc 0.7.3-dev
[u/mrichter/AliRoot.git] / Vc / include / Vc / sse / limits.h
1 /*  This file is part of the Vc library.
2
3     Copyright (C) 2009 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_LIMITS_H
21 #define VC_SSE_LIMITS_H
22
23 #include "intrinsics.h"
24 #include "types.h"
25 #include "macros.h"
26
27 namespace std
28 {
29 template<> struct numeric_limits< ::AliRoot::Vc::SSE::ushort_v> : public numeric_limits<unsigned short>
30 {
31     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::ushort_v max()           _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::_mm_setallone_si128(); }
32     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::ushort_v min()           _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::ushort_v::Zero(); }
33     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::ushort_v lowest()        _VC_NOEXCEPT { return min(); }
34     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::ushort_v epsilon()       _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::ushort_v::Zero(); }
35     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::ushort_v round_error()   _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::ushort_v::Zero(); }
36     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::ushort_v infinity()      _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::ushort_v::Zero(); }
37     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::ushort_v quiet_NaN()     _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::ushort_v::Zero(); }
38     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::ushort_v signaling_NaN() _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::ushort_v::Zero(); }
39     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::ushort_v denorm_min()    _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::ushort_v::Zero(); }
40 };
41 template<> struct numeric_limits< ::AliRoot::Vc::SSE::short_v> : public numeric_limits<short>
42 {
43     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::short_v max()           _VC_NOEXCEPT { return _mm_srli_epi16(::AliRoot::Vc::SSE::_mm_setallone_si128(), 1); }
44     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::short_v min()           _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::_mm_setmin_epi16(); }
45     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::short_v lowest()        _VC_NOEXCEPT { return min(); }
46     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::short_v epsilon()       _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::short_v::Zero(); }
47     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::short_v round_error()   _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::short_v::Zero(); }
48     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::short_v infinity()      _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::short_v::Zero(); }
49     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::short_v quiet_NaN()     _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::short_v::Zero(); }
50     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::short_v signaling_NaN() _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::short_v::Zero(); }
51     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::short_v denorm_min()    _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::short_v::Zero(); }
52 };
53 template<> struct numeric_limits< ::AliRoot::Vc::SSE::uint_v> : public numeric_limits<unsigned int>
54 {
55     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::uint_v max()           _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::_mm_setallone_si128(); }
56     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::uint_v min()           _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::uint_v::Zero(); }
57     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::uint_v lowest()        _VC_NOEXCEPT { return min(); }
58     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::uint_v epsilon()       _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::uint_v::Zero(); }
59     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::uint_v round_error()   _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::uint_v::Zero(); }
60     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::uint_v infinity()      _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::uint_v::Zero(); }
61     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::uint_v quiet_NaN()     _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::uint_v::Zero(); }
62     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::uint_v signaling_NaN() _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::uint_v::Zero(); }
63     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::uint_v denorm_min()    _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::uint_v::Zero(); }
64 };
65 template<> struct numeric_limits< ::AliRoot::Vc::SSE::int_v> : public numeric_limits<int>
66 {
67     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::int_v max()           _VC_NOEXCEPT { return _mm_srli_epi32(::AliRoot::Vc::SSE::_mm_setallone_si128(), 1); }
68     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::int_v min()           _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::_mm_setmin_epi32(); }
69     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::int_v lowest()        _VC_NOEXCEPT { return min(); }
70     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::int_v epsilon()       _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::int_v::Zero(); }
71     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::int_v round_error()   _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::int_v::Zero(); }
72     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::int_v infinity()      _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::int_v::Zero(); }
73     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::int_v quiet_NaN()     _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::int_v::Zero(); }
74     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::int_v signaling_NaN() _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::int_v::Zero(); }
75     static Vc_INTRINSIC Vc_CONST ::AliRoot::Vc::SSE::int_v denorm_min()    _VC_NOEXCEPT { return ::AliRoot::Vc::SSE::int_v::Zero(); }
76 };
77 } // namespace std
78
79 #include "undomacros.h"
80
81 #endif // VC_SSE_LIMITS_H