/* This file is part of the Vc library. Copyright (C) 2009-2012 Matthias Kretz Vc is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Vc is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Vc. If not, see . */ #ifndef VC_AVX_CONST_H #define VC_AVX_CONST_H #include #include "const_data.h" #include "macros.h" namespace ROOT { namespace Vc { namespace AVX { template class Vector; template struct IndexesFromZeroData; template<> struct IndexesFromZeroData { static Vc_ALWAYS_INLINE Vc_CONST const int *address() { return reinterpret_cast(&_IndexesFromZero32[0]); } }; template<> struct IndexesFromZeroData { static Vc_ALWAYS_INLINE Vc_CONST const unsigned int *address() { return &_IndexesFromZero32[0]; } }; template<> struct IndexesFromZeroData { static Vc_ALWAYS_INLINE Vc_CONST const short *address() { return reinterpret_cast(&_IndexesFromZero16[0]); } }; template<> struct IndexesFromZeroData { static Vc_ALWAYS_INLINE Vc_CONST const unsigned short *address() { return &_IndexesFromZero16[0]; } }; template<> struct IndexesFromZeroData { static Vc_ALWAYS_INLINE Vc_CONST const signed char *address() { return reinterpret_cast(&_IndexesFromZero8[0]); } }; template<> struct IndexesFromZeroData { static Vc_ALWAYS_INLINE Vc_CONST const char *address() { return reinterpret_cast(&_IndexesFromZero8[0]); } }; template<> struct IndexesFromZeroData { static Vc_ALWAYS_INLINE Vc_CONST const unsigned char *address() { return &_IndexesFromZero8[0]; } }; template struct Const { typedef Vector<_T> V; typedef typename V::EntryType T; typedef typename V::Mask M; static Vc_ALWAYS_INLINE Vc_CONST V _pi_4() { return V(c_trig::data[0]); } static Vc_ALWAYS_INLINE Vc_CONST V _pi_4_hi() { return V(c_trig::data[1]); } static Vc_ALWAYS_INLINE Vc_CONST V _pi_4_rem1() { return V(c_trig::data[2]); } static Vc_ALWAYS_INLINE Vc_CONST V _pi_4_rem2() { return V(c_trig::data[3]); } static Vc_ALWAYS_INLINE Vc_CONST V _1_16() { return V(c_trig::data[4]); } static Vc_ALWAYS_INLINE Vc_CONST V _16() { return V(c_trig::data[5]); } static Vc_ALWAYS_INLINE Vc_CONST V cosCoeff(int i) { return V(c_trig::data[( 8 + i)]); } static Vc_ALWAYS_INLINE Vc_CONST V sinCoeff(int i) { return V(c_trig::data[(14 + i)]); } static Vc_ALWAYS_INLINE Vc_CONST V atanP(int i) { return V(c_trig::data[(24 + i)]); } static Vc_ALWAYS_INLINE Vc_CONST V atanQ(int i) { return V(c_trig::data[(29 + i)]); } static Vc_ALWAYS_INLINE Vc_CONST V atanThrsHi() { return V(c_trig::data[34]); } static Vc_ALWAYS_INLINE Vc_CONST V atanThrsLo() { return V(c_trig::data[35]); } static Vc_ALWAYS_INLINE Vc_CONST V _pi_2_rem() { return V(c_trig::data[36]); } static Vc_ALWAYS_INLINE Vc_CONST V lossThreshold() { return V(c_trig::data[20]); } static Vc_ALWAYS_INLINE Vc_CONST V _4_pi() { return V(c_trig::data[21]); } static Vc_ALWAYS_INLINE Vc_CONST V _pi_2() { return V(c_trig::data[22]); } static Vc_ALWAYS_INLINE Vc_CONST V _pi() { return V(c_trig::data[23]); } static Vc_ALWAYS_INLINE Vc_CONST V asinCoeff0(int i) { return V(c_trig::data[(40 + i)]); } static Vc_ALWAYS_INLINE Vc_CONST V asinCoeff1(int i) { return V(c_trig::data[(45 + i)]); } static Vc_ALWAYS_INLINE Vc_CONST V asinCoeff2(int i) { return V(c_trig::data[(49 + i)]); } static Vc_ALWAYS_INLINE Vc_CONST V asinCoeff3(int i) { return V(c_trig::data[(55 + i)]); } static Vc_ALWAYS_INLINE Vc_CONST V smallAsinInput() { return V(c_trig::data[37]); } static Vc_ALWAYS_INLINE Vc_CONST V largeAsinInput() { return V(c_trig::data[38]); } static Vc_ALWAYS_INLINE Vc_CONST M exponentMask() { return M(V(c_log::d(1)).data()); } static Vc_ALWAYS_INLINE Vc_CONST V _1_2() { return V(c_log::d(18)); } static Vc_ALWAYS_INLINE Vc_CONST V _1_sqrt2() { return V(c_log::d(15)); } static Vc_ALWAYS_INLINE Vc_CONST V P(int i) { return V(c_log::d(2 + i)); } static Vc_ALWAYS_INLINE Vc_CONST V Q(int i) { return V(c_log::d(8 + i)); } static Vc_ALWAYS_INLINE Vc_CONST V min() { return V(c_log::d(14)); } static Vc_ALWAYS_INLINE Vc_CONST V ln2_small() { return V(c_log::d(17)); } static Vc_ALWAYS_INLINE Vc_CONST V ln2_large() { return V(c_log::d(16)); } static Vc_ALWAYS_INLINE Vc_CONST V neginf() { return V(c_log::d(13)); } static Vc_ALWAYS_INLINE Vc_CONST V log10_e() { return V(c_log::d(19)); } static Vc_ALWAYS_INLINE Vc_CONST V log2_e() { return V(c_log::d(20)); } static Vc_ALWAYS_INLINE_L Vc_CONST_L V highMask() Vc_ALWAYS_INLINE_R Vc_CONST_R; }; template<> Vc_ALWAYS_INLINE Vc_CONST Vector Const::highMask() { return _mm256_broadcast_ss(reinterpret_cast(&c_general::highMaskFloat)); } template<> Vc_ALWAYS_INLINE Vc_CONST Vector Const::highMask() { return _mm256_broadcast_sd(reinterpret_cast(&c_general::highMaskDouble)); } template<> Vc_ALWAYS_INLINE Vc_CONST Vector Const::highMask() { return _mm256_broadcast_ss(reinterpret_cast(&c_general::highMaskFloat)); } } // namespace AVX } // namespace Vc } // namespace ROOT #include "undomacros.h" #endif // VC_AVX_CONST_H