Blaze 3.9
Pow.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_SIMD_POW_H_
36#define _BLAZE_MATH_SIMD_POW_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#if BLAZE_SLEEF_MODE
44# include <sleef.h>
45#endif
47#include <blaze/system/Inline.h>
49
50
51namespace blaze {
52
53//=================================================================================================
54//
55// 32-BIT FLOATING POINT SIMD TYPES
56//
57//=================================================================================================
58
59//*************************************************************************************************
69template< typename T1 // Type of the left-hand side operand
70 , typename T2 > // Type of the right-hand side operand
71BLAZE_ALWAYS_INLINE const SIMDfloat pow( const SIMDf32<T1>& a, const SIMDf32<T2>& b ) noexcept
72#if BLAZE_SVML_MODE
73# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
74{
75 return _mm512_pow_ps( (*a).eval().value, (*b).eval().value );
76}
77# elif BLAZE_AVX_MODE
78{
79 return _mm256_pow_ps( (*a).eval().value, (*b).eval().value );
80}
81# elif BLAZE_SSE_MODE
82{
83 return _mm_pow_ps( (*a).eval().value, (*b).eval().value );
84}
85# endif
86#elif BLAZE_SLEEF_MODE
87# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
88{
89 return Sleef_powf16_u10( (*a).eval().value, (*b).eval().value );
90}
91# elif BLAZE_AVX_MODE
92{
93 return Sleef_powf8_u10( (*a).eval().value, (*b).eval().value );
94}
95# elif BLAZE_SSE_MODE
96{
97 return Sleef_powf4_u10( (*a).eval().value, (*b).eval().value );
98}
99# endif
100#else
101= delete;
102#endif
103//*************************************************************************************************
104
105
106
107
108//=================================================================================================
109//
110// 64-BIT FLOATING POINT SIMD TYPES
111//
112//=================================================================================================
113
114//*************************************************************************************************
124template< typename T1 // Type of the left-hand side operand
125 , typename T2 > // Type of the right-hand side operand
126BLAZE_ALWAYS_INLINE const SIMDdouble pow( const SIMDf64<T1>& a, const SIMDf64<T2>& b ) noexcept
127#if BLAZE_SVML_MODE
128# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
129{
130 return _mm512_pow_pd( (*a).eval().value, (*b).eval().value );
131}
132# elif BLAZE_AVX_MODE
133{
134 return _mm256_pow_pd( (*a).eval().value, (*b).eval().value );
135}
136# elif BLAZE_SSE_MODE
137{
138 return _mm_pow_pd( (*a).eval().value, (*b).eval().value );
139}
140# endif
141#elif BLAZE_SLEEF_MODE
142# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
143{
144 return Sleef_powd8_u10( (*a).eval().value, (*b).eval().value );
145}
146# elif BLAZE_AVX_MODE
147{
148 return Sleef_powd4_u10( (*a).eval().value, (*b).eval().value );
149}
150# elif BLAZE_SSE_MODE
151{
152 return Sleef_powd2_u10( (*a).eval().value, (*b).eval().value );
153}
154# endif
155#else
156= delete;
157#endif
158//*************************************************************************************************
159
160} // namespace blaze
161
162#endif
Header file for the basic SIMD types.
SIMD type for 64-bit double precision floating point data values.
SIMD type for 32-bit single precision floating point data values.
BLAZE_ALWAYS_INLINE const SIMDdouble pow(const SIMDf64< T1 > &a, const SIMDf64< T2 > &b) noexcept=delete
Computes the exponential value of a vector of double precision floating point values.
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
System settings for the inline keywords.
System settings for the SSE mode.