Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Vc/avx/types.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*  This file is part of the Vc library. {{{
0002 Copyright © 2009-2015 Matthias Kretz <kretz@kde.org>
0003 
0004 Redistribution and use in source and binary forms, with or without
0005 modification, are permitted provided that the following conditions are met:
0006     * Redistributions of source code must retain the above copyright
0007       notice, this list of conditions and the following disclaimer.
0008     * Redistributions in binary form must reproduce the above copyright
0009       notice, this list of conditions and the following disclaimer in the
0010       documentation and/or other materials provided with the distribution.
0011     * Neither the names of contributing organizations nor the
0012       names of its contributors may be used to endorse or promote products
0013       derived from this software without specific prior written permission.
0014 
0015 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
0016 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
0017 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
0018 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
0019 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
0020 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
0021 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
0022 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0023 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0024 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0025 
0026 }}}*/
0027 
0028 #ifndef VC_AVX_TYPES_H_
0029 #define VC_AVX_TYPES_H_
0030 
0031 #include "../sse/types.h"
0032 #include "../traits/type_traits.h"
0033 #include "macros.h"
0034 
0035 #ifdef Vc_DEFAULT_IMPL_AVX2
0036 #define Vc_DOUBLE_V_SIZE 4
0037 #define Vc_FLOAT_V_SIZE 8
0038 #define Vc_INT_V_SIZE 8
0039 #define Vc_UINT_V_SIZE 8
0040 #define Vc_SHORT_V_SIZE 16
0041 #define Vc_USHORT_V_SIZE 16
0042 #elif defined Vc_DEFAULT_IMPL_AVX
0043 #define Vc_DOUBLE_V_SIZE 4
0044 #define Vc_FLOAT_V_SIZE 8
0045 #define Vc_INT_V_SIZE 4
0046 #define Vc_UINT_V_SIZE 4
0047 #define Vc_SHORT_V_SIZE 8
0048 #define Vc_USHORT_V_SIZE 8
0049 #endif
0050 
0051 namespace Vc_VERSIONED_NAMESPACE
0052 {
0053 namespace AVX
0054 {
0055 template <typename T> using Vector = Vc::Vector<T, VectorAbi::Avx1Abi<T>>;
0056 typedef Vector<double>         double_v;
0057 typedef Vector<float>           float_v;
0058 typedef Vector<int>               int_v;
0059 typedef Vector<unsigned int>     uint_v;
0060 typedef Vector<short>           short_v;
0061 typedef Vector<unsigned short> ushort_v;
0062 
0063 template <typename T> using Mask = Vc::Mask<T, VectorAbi::Avx1Abi<T>>;
0064 typedef Mask<double>         double_m;
0065 typedef Mask<float>           float_m;
0066 typedef Mask<int>               int_m;
0067 typedef Mask<unsigned int>     uint_m;
0068 typedef Mask<short>           short_m;
0069 typedef Mask<unsigned short> ushort_m;
0070 
0071 template <typename T> struct Const;
0072 
0073 template <typename T> struct is_vector : public std::false_type {};
0074 template <typename T> struct is_vector<Vector<T>> : public std::true_type {};
0075 template <typename T> struct is_mask : public std::false_type {};
0076 template <typename T> struct is_mask<Mask<T>> : public std::true_type {};
0077 }  // namespace AVX
0078 
0079 namespace AVX2
0080 {
0081 template <typename T> using Vector = Vc::Vector<T, VectorAbi::Avx>;
0082 using double_v = Vector<double>;
0083 using  float_v = Vector< float>;
0084 using    int_v = Vector<   int>;
0085 using   uint_v = Vector<  uint>;
0086 using  short_v = Vector< short>;
0087 using ushort_v = Vector<ushort>;
0088 
0089 template <typename T> using Mask = Vc::Mask<T, VectorAbi::Avx>;
0090 using double_m = Mask<double>;
0091 using  float_m = Mask< float>;
0092 using  llong_m = Mask< llong>;
0093 using ullong_m = Mask<ullong>;
0094 using   long_m = Mask<  long>;
0095 using  ulong_m = Mask< ulong>;
0096 using    int_m = Mask<   int>;
0097 using   uint_m = Mask<  uint>;
0098 using  short_m = Mask< short>;
0099 using ushort_m = Mask<ushort>;
0100 using  schar_m = Mask< schar>;
0101 using  uchar_m = Mask< uchar>;
0102 
0103 template <typename T> struct is_vector : public std::false_type {};
0104 template <typename T> struct is_vector<Vector<T>> : public std::true_type {};
0105 template <typename T> struct is_mask : public std::false_type {};
0106 template <typename T> struct is_mask<Mask<T>> : public std::true_type {};
0107 }  // namespace AVX2
0108 
0109 namespace Traits
0110 {
0111 template <class T> struct
0112 is_simd_vector_internal<Vector<T, VectorAbi::Avx>>
0113   : public is_valid_vector_argument<T> {};
0114 
0115 template<typename T> struct is_simd_mask_internal<Mask<T, VectorAbi::Avx>>
0116   : public std::true_type {};
0117 }  // namespace Traits
0118 }  // namespace Vc
0119 
0120 #endif // VC_AVX_TYPES_H_