Blaze 3.9
Log.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_SIMD_LOG_H_
36#define _BLAZE_MATH_SIMD_LOG_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//*************************************************************************************************
68template< typename T > // Type of the operand
69BLAZE_ALWAYS_INLINE const SIMDfloat log( const SIMDf32<T>& a ) noexcept
70#if BLAZE_SVML_MODE
71# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
72{
73 return _mm512_log_ps( (*a).eval().value );
74}
75# elif BLAZE_AVX_MODE
76{
77 return _mm256_log_ps( (*a).eval().value );
78}
79# elif BLAZE_SSE_MODE
80{
81 return _mm_log_ps( (*a).eval().value );
82}
83# endif
84#elif BLAZE_SLEEF_MODE
85# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
86{
87 return Sleef_logf16_u35( (*a).eval().value );
88}
89# elif BLAZE_AVX_MODE
90{
91 return Sleef_logf8_u35( (*a).eval().value );
92}
93# elif BLAZE_SSE_MODE
94{
95 return Sleef_logf4_u35( (*a).eval().value );
96}
97# endif
98#else
99= delete;
100#endif
101//*************************************************************************************************
102
103
104
105
106//=================================================================================================
107//
108// 64-BIT FLOATING POINT SIMD TYPES
109//
110//=================================================================================================
111
112//*************************************************************************************************
121template< typename T > // Type of the operand
122BLAZE_ALWAYS_INLINE const SIMDdouble log( const SIMDf64<T>& a ) noexcept
123#if BLAZE_SVML_MODE
124# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
125{
126 return _mm512_log_pd( (*a).eval().value );
127}
128# elif BLAZE_AVX_MODE
129{
130 return _mm256_log_pd( (*a).eval().value );
131}
132# elif BLAZE_SSE_MODE
133{
134 return _mm_log_pd( (*a).eval().value );
135}
136# endif
137#elif BLAZE_SLEEF_MODE
138# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
139{
140 return Sleef_logd8_u35( (*a).eval().value );
141}
142# elif BLAZE_AVX_MODE
143{
144 return Sleef_logd4_u35( (*a).eval().value );
145}
146# elif BLAZE_SSE_MODE
147{
148 return Sleef_logd2_u35( (*a).eval().value );
149}
150# endif
151#else
152= delete;
153#endif
154//*************************************************************************************************
155
156} // namespace blaze
157
158#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 log(const SIMDf64< T > &a) noexcept=delete
Computes the natural logarithm for 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.