/* 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_COMMON_TRIGONOMETRIC_H #define VC_COMMON_TRIGONOMETRIC_H #ifndef VC__USE_NAMESPACE #error "Do not include Vc/common/trigonometric.h outside of Vc itself" #endif #include "macros.h" namespace ROOT { namespace Vc { namespace { using Vc::VC__USE_NAMESPACE::Vector; } // namespace namespace Internal { template struct MapImpl { enum Dummy { Value = Impl }; }; template<> struct MapImpl { enum Dummy { Value = MapImpl::Value }; }; typedef ImplementationT::Value #if defined(VC_IMPL_XOP) && defined(VC_IMPL_FMA4) + Vc::XopInstructions + Vc::Fma4Instructions #endif > TrigonometricImplementation; } // namespace Internal template struct Trigonometric { template static Vector sin(const Vector &_x); template static Vector cos(const Vector &_x); template static void sincos(const Vector &_x, Vector *_sin, Vector *_cos); template static Vector asin (const Vector &_x); template static Vector atan (const Vector &_x); template static Vector atan2(const Vector &y, const Vector &x); }; namespace VC__USE_NAMESPACE #undef VC__USE_NAMESPACE { template static Vc_ALWAYS_INLINE Vc_PURE Vector sin(const Vector &_x) { return Vc::Trigonometric::sin(_x); } template static Vc_ALWAYS_INLINE Vc_PURE Vector cos(const Vector &_x) { return Vc::Trigonometric::cos(_x); } template static Vc_ALWAYS_INLINE void sincos(const Vector &_x, Vector *_sin, Vector *_cos) { Vc::Trigonometric::sincos(_x, _sin, _cos); } template static Vc_ALWAYS_INLINE Vc_PURE Vector asin (const Vector &_x) { return Vc::Trigonometric::asin(_x); } template static Vc_ALWAYS_INLINE Vc_PURE Vector atan (const Vector &_x) { return Vc::Trigonometric::atan(_x); } template static Vc_ALWAYS_INLINE Vc_PURE Vector atan2(const Vector &y, const Vector &x) { return Vc::Trigonometric::atan2(y, x); } } // namespace VC__USE_NAMESPACE } // namespace Vc } // namespace ROOT #include "undomacros.h" #endif // VC_COMMON_TRIGONOMETRIC_H