Blaze 3.9
Hypot.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_SIMD_HYPOT_H_
36#define _BLAZE_MATH_SIMD_HYPOT_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//*************************************************************************************************
72template< typename T > // Type of the operand
73BLAZE_ALWAYS_INLINE const SIMDfloat hypot( const SIMDf32<T>& a, const SIMDf32<T>& b ) noexcept
74#if BLAZE_SVML_MODE
75# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
76{
77 return _mm512_hypot_ps( (*a).eval().value, (*b).eval().value );
78}
79# elif BLAZE_AVX_MODE
80{
81 return _mm256_hypot_ps( (*a).eval().value, (*b).eval().value );
82}
83# elif BLAZE_SSE_MODE
84{
85 return _mm_hypot_ps( (*a).eval().value, (*b).eval().value );
86}
87# endif
88#elif BLAZE_SLEEF_MODE
89# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
90{
91 return Sleef_hypotf16_u05avx512f( (*a).eval().value, (*b).eval().value );
92}
93# elif BLAZE_AVX2_MODE
94{
95 return Sleef_hypotf8_u05avx2( (*a).eval().value, (*b).eval().value );
96}
97# elif BLAZE_AVX_MODE
98{
99 return Sleef_hypotf8_u05avx( (*a).eval().value, (*b).eval().value );
100}
101# elif BLAZE_SSE_MODE
102{
103 return Sleef_hypotf4_u05( (*a).eval().value, (*b).eval().value );
104}
105# endif
106#else
107= delete;
108#endif
109//*************************************************************************************************
110
111
112
113
114//=================================================================================================
115//
116// 64-BIT FLOATING POINT SIMD TYPES
117//
118//=================================================================================================
119
120//*************************************************************************************************
133template< typename T > // Type of the operand
134BLAZE_ALWAYS_INLINE const SIMDdouble hypot( const SIMDf64<T>& a, const SIMDf64<T>& b ) noexcept
135#if BLAZE_SVML_MODE
136# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
137{
138 return _mm512_hypot_pd( (*a).eval().value, (*b).eval().value );
139}
140# elif BLAZE_AVX_MODE
141{
142 return _mm256_hypot_pd( (*a).eval().value, (*b).eval().value );
143}
144# elif BLAZE_SSE_MODE
145{
146 return _mm_hypot_pd( (*a).eval().value, (*b).eval().value );
147}
148# endif
149#elif BLAZE_SLEEF_MODE
150# if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
151{
152 return Sleef_hypotd8_u05avx512f( (*a).eval().value, (*b).eval().value );
153}
154# elif BLAZE_AVX2_MODE
155{
156 return Sleef_hypotd4_u05avx2( (*a).eval().value, (*b).eval().value );
157}
158# elif BLAZE_AVX_MODE
159{
160 return Sleef_hypotd4_u05avx( (*a).eval().value, (*b).eval().value );
161}
162# elif BLAZE_SSE_MODE
163{
164 return Sleef_hypotd2_u05( (*a).eval().value, (*b).eval().value );
165}
166# endif
167#else
168= delete;
169#endif
170//*************************************************************************************************
171
172} // namespace blaze
173
174#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 hypot(const SIMDf64< T > &a, const SIMDf64< T > &b) noexcept=delete
Computes the length of the hypotenous of a right triangle of a vector of double precision floating po...
#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.