ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
const_data.h
Go to the documentation of this file.
1 /* This file is part of the Vc library. {{{
2 
3  Copyright (C) 2012 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_CONST_DATA_H
21 #define VC_AVX_CONST_DATA_H
22 
23 #include "macros.h"
24 namespace ROOT {
25 namespace Vc
26 {
27 namespace AVX
28 {
29 
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];
33 
34 struct STRUCT_ALIGN1(64) c_general
35 {
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;
46 } STRUCT_ALIGN2(64);
47 
48 template<typename T> struct c_trig
49 {
50  ALIGN(64) static const T data[];
51 };
52 
53 template<typename T> struct c_log
54 {
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[];
58 };
59 
60 template<> struct c_log<double>
61 {
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[];
66 };
67 
68 } // namespace AVX
69 } // namespace Vc
70 } // namespace ROOT
71 
72 #include "undomacros.h"
73 
74 #endif // VC_AVX_CONST_DATA_H
Small helper to encapsulate whether to return the value pointed to by the iterator or its address...
const char * Size
Definition: TXMLSetup.cxx:56
struct STRUCT_ALIGN1(64) c_general
Definition: const_data.h:34
float floatAlias Vc_MAY_ALIAS
Definition: const_data.h:55
TTree * T
#define AVX
Definition: global.h:90
ALIGN(64) static const T data[]
ALIGN(64) static const unsigned int data[]
#define Vc_ALWAYS_INLINE
Definition: macros.h:130
static Vc_ALWAYS_INLINE float d(int i)
Definition: const_data.h:56
ALIGN(64) extern const unsigned int _IndexesFromZero32[8]
static Vc_ALWAYS_INLINE double d(int i)
Definition: const_data.h:64
double doubleAlias Vc_MAY_ALIAS
Definition: const_data.h:63