28#ifndef VC_COMMON_TRIGONOMETRIC_H_
29#define VC_COMMON_TRIGONOMETRIC_H_
35__m128 _ZGVbN4v_sinf(__m128);
36__m128d _ZGVbN2v_sin(__m128d);
37__m128 _ZGVbN4v_cosf(__m128);
38__m128d _ZGVbN2v_cos(__m128d);
39__m256 _ZGVdN8v_sinf(__m256);
40__m256d _ZGVdN4v_sin(__m256d);
41__m256 _ZGVdN8v_cosf(__m256);
42__m256d _ZGVdN4v_cos(__m256d);
46namespace Vc_VERSIONED_NAMESPACE
50template<Vc::Implementation Impl>
struct MapImpl {
enum Dummy { Value = Impl }; };
51template<>
struct MapImpl<
Vc::
SSE42Impl> {
enum Dummy { Value = MapImpl<Vc::SSE41Impl>::Value }; };
53template<Vc::Implementation Impl>
using TrigonometricImplementation =
54 ImplementationT<MapImpl<Impl>::Value
55#if defined(Vc_IMPL_XOP) && defined(Vc_IMPL_FMA4)
64template<
typename Impl>
struct Trigonometric
66 template<
typename T>
static T Vc_VDECL
sin(
const T &_x);
67 template<
typename T>
static T Vc_VDECL
cos(
const T &_x);
68 template<
typename T>
static void Vc_VDECL
sincos(
const T &_x, T *_sin, T *_cos);
69 template<
typename T>
static T Vc_VDECL
asin (
const T &_x);
70 template<
typename T>
static T Vc_VDECL
atan (
const T &_x);
71 template<
typename T>
static T Vc_VDECL
atan2(
const T &y,
const T &x);
75#if defined Vc_IMPL_SSE || defined DOXYGEN
79template <
typename T,
typename Abi>
80using Trig = Common::Trigonometric<Detail::TrigonometricImplementation<
81 (std::is_same<Abi, VectorAbi::Sse>::value
87Vc_INTRINSIC __m128 sin_dispatch(__m128 x) { return ::_ZGVbN4v_sinf(x); }
88Vc_INTRINSIC __m128d sin_dispatch(__m128d x) { return ::_ZGVbN2v_sin (x); }
89Vc_INTRINSIC __m128 cos_dispatch(__m128 x) { return ::_ZGVbN4v_cosf(x); }
90Vc_INTRINSIC __m128d cos_dispatch(__m128d x) { return ::_ZGVbN2v_cos (x); }
92Vc_INTRINSIC __m256 sin_dispatch(__m256 x) { return ::_ZGVdN8v_sinf(x); }
93Vc_INTRINSIC __m256d sin_dispatch(__m256d x) { return ::_ZGVdN4v_sin (x); }
94Vc_INTRINSIC __m256 cos_dispatch(__m256 x) { return ::_ZGVdN8v_cosf(x); }
95Vc_INTRINSIC __m256d cos_dispatch(__m256d x) { return ::_ZGVdN4v_cos (x); }
98template <
typename T,
typename Abi>
99Vc_INTRINSIC Vector<T, detail::not_fixed_size_abi<Abi>>
sin(
const Vector<T, Abi> &x)
101 return sin_dispatch(x.data());
103template <
typename T,
typename Abi>
104Vc_INTRINSIC Vector<T, detail::not_fixed_size_abi<Abi>>
cos(
const Vector<T, Abi> &x)
106 return cos_dispatch(x.data());
133template <
typename T,
typename Abi>
150template <
typename T,
typename Abi>
167template <
typename T,
typename Abi>
182template <
typename T,
typename Abi>
198template <
typename T,
typename Abi>
216template <
typename T,
typename Abi>
218 Vector<T, detail::not_fixed_size_abi<Abi>> *
sin,
The main vector class for expressing data parallelism.
Vector< T, detail::not_fixed_size_abi< Abi > > cos(const Vector< T, Abi > &x)
Returns the cosine of all input values in x.
Vector< T, detail::not_fixed_size_abi< Abi > > sin(const Vector< T, Abi > &x)
Returns the sine of all input values in x.
Vector< T, detail::not_fixed_size_abi< Abi > > asin(const Vector< T, Abi > &x)
Returns the arcsine of all input values in x.
Vector< T, detail::not_fixed_size_abi< Abi > > atan(const Vector< T, Abi > &x)
Returns the arctangent of all input values in x.
void sincos(const Vector< T, Abi > &x, Vector< T, detail::not_fixed_size_abi< Abi > > *sin, Vector< T, Abi > *cos)
Vector< T, detail::not_fixed_size_abi< Abi > > atan2(const Vector< T, Abi > &y, const Vector< T, Abi > &x)
Returns the arctangent of all input values in x and y.
@ SSE42Impl
x86 SSE + SSE2 + SSE3 + SSSE3 + SSE4.1 + SSE4.2
@ ScalarImpl
uses only fundamental types
@ XopInstructions
Support for XOP instructions.
@ Fma4Instructions
Support for FMA4 instructions.
Vector Classes Namespace.