1 /* This file is part of the Vc library. {{{
3 Copyright (C) 2012 Matthias Kretz <kretz@kde.org>
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.
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.
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/>.
20 #ifndef VC_AVX_CONST_DATA_H
21 #define VC_AVX_CONST_DATA_H
30 ALIGN(64) extern const unsigned int _IndexesFromZero32[8];
31 ALIGN(16) extern const unsigned short _IndexesFromZero16[8];
32 ALIGN(16) extern const unsigned char _IndexesFromZero8[16];
34 struct STRUCT_ALIGN1(64) c_general
36 static const float oneFloat;
37 static const unsigned int absMaskFloat[2];
38 static const unsigned int signMaskFloat[2];
39 static const unsigned int highMaskFloat;
40 static const unsigned short minShort[2];
41 static const unsigned short one16[2];
42 static const float _2power31;
43 static const double oneDouble;
44 static const unsigned long long frexpMask;
45 static const unsigned long long highMaskDouble;
48 template<typename T> struct c_trig
50 ALIGN(64) static const T data[];
53 template<typename T> struct c_log
55 typedef float floatAlias Vc_MAY_ALIAS;
56 static Vc_ALWAYS_INLINE float d(int i) { return *reinterpret_cast<const floatAlias *>(&data[i]); }
57 ALIGN(64) static const unsigned int data[];
60 template<> struct c_log<double>
62 enum VectorSize { Size = 16 / sizeof(double) };
63 typedef double doubleAlias Vc_MAY_ALIAS;
64 static Vc_ALWAYS_INLINE double d(int i) { return *reinterpret_cast<const doubleAlias *>(&data[i]); }
65 ALIGN(64) static const unsigned long long data[];
70 } // namespace AliRoot
72 #include "undomacros.h"
74 #endif // VC_AVX_CONST_DATA_H