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