Division.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_SIMD_DIVISION_H_
36 #define _BLAZE_MATH_SIMD_DIVISION_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/system/Inline.h>
46 
47 
48 namespace blaze {
49 
50 //=================================================================================================
51 //
52 // 32-BIT INTEGRAL SIMD TYPES
53 //
54 //=================================================================================================
55 
56 //*************************************************************************************************
66 BLAZE_ALWAYS_INLINE const SIMDint32
67  operator/( const SIMDint32& a, const SIMDint32& b ) noexcept
68 #if BLAZE_MIC_MODE
69 {
70  return _mm512_div_epi32( a.value, b.value );
71 }
72 #else
73 = delete;
74 #endif
75 //*************************************************************************************************
76 
77 
78 //*************************************************************************************************
88 BLAZE_ALWAYS_INLINE const SIMDcint32
89  operator/( const SIMDcint32& a, const SIMDint32& b ) noexcept
90 #if BLAZE_MIC_MODE
91 {
92  return _mm512_div_epi32( a.value, b.value );
93 }
94 #else
95 = delete;
96 #endif
97 //*************************************************************************************************
98 
99 
100 
101 
102 //=================================================================================================
103 //
104 // 64-BIT INTEGRAL SIMD TYPES
105 //
106 //=================================================================================================
107 
108 //*************************************************************************************************
118 BLAZE_ALWAYS_INLINE const SIMDint64
119  operator/( const SIMDint64& a, const SIMDint64& b ) noexcept
120 #if BLAZE_MIC_MODE
121 {
122  return _mm512_div_epi64( a.value, b.value );
123 }
124 #else
125 = delete;
126 #endif
127 //*************************************************************************************************
128 
129 
130 //*************************************************************************************************
140 BLAZE_ALWAYS_INLINE const SIMDcint64
141  operator/( const SIMDcint64& a, const SIMDint64& b ) noexcept
142 #if BLAZE_MIC_MODE
143 {
144  return _mm512_div_epi64( (~a).value, (~b).value );
145 }
146 #else
147 = delete;
148 #endif
149 //*************************************************************************************************
150 
151 
152 
153 
154 //=================================================================================================
155 //
156 // 32-BIT FLOATING POINT SIMD TYPES
157 //
158 //=================================================================================================
159 
160 //*************************************************************************************************
170 template< typename T1 // Type of the left-hand side operand
171  , typename T2 > // Type of the right-hand side operand
172 BLAZE_ALWAYS_INLINE const SIMDfloat
173  operator/( const SIMDf32<T1>& a, const SIMDf32<T2>& b ) noexcept
174 #if BLAZE_MIC_MODE
175 {
176  return _mm512_div_ps( (~a).eval().value, (~b).eval().value );
177 }
178 #elif BLAZE_AVX_MODE
179 {
180  return _mm256_div_ps( (~a).eval().value, (~b).eval().value );
181 }
182 #elif BLAZE_SSE_MODE
183 {
184  return _mm_div_ps( (~a).eval().value, (~b).eval().value );
185 }
186 #else
187 = delete;
188 #endif
189 //*************************************************************************************************
190 
191 
192 //*************************************************************************************************
202 BLAZE_ALWAYS_INLINE const SIMDcfloat
203  operator/( const SIMDcfloat& a, const SIMDfloat& b ) noexcept
204 #if BLAZE_MIC_MODE
205 {
206  return _mm512_div_ps( a.value, b.value );
207 }
208 #elif BLAZE_AVX_MODE
209 {
210  return _mm256_div_ps( a.value, b.value );
211 }
212 #elif BLAZE_SSE_MODE
213 {
214  return _mm_div_ps( a.value, b.value );
215 }
216 #else
217 = delete;
218 #endif
219 //*************************************************************************************************
220 
221 
222 
223 
224 //=================================================================================================
225 //
226 // 64-BIT FLOATING POINT SIMD TYPES
227 //
228 //=================================================================================================
229 
230 //*************************************************************************************************
240 template< typename T1 // Type of the left-hand side operand
241  , typename T2 > // Type of the right-hand side operand
242 BLAZE_ALWAYS_INLINE const SIMDdouble
243  operator/( const SIMDf64<T1>& a, const SIMDf64<T2>& b ) noexcept
244 #if BLAZE_MIC_MODE
245 {
246  return _mm512_div_pd( (~a).eval().value, (~b).eval().value );
247 }
248 #elif BLAZE_AVX_MODE
249 {
250  return _mm256_div_pd( (~a).eval().value, (~b).eval().value );
251 }
252 #elif BLAZE_SSE2_MODE
253 {
254  return _mm_div_pd( (~a).eval().value, (~b).eval().value );
255 }
256 #else
257 = delete;
258 #endif
259 //*************************************************************************************************
260 
261 
262 //*************************************************************************************************
272 BLAZE_ALWAYS_INLINE const SIMDcdouble
273  operator/( const SIMDcdouble& a, const SIMDdouble& b ) noexcept
274 #if BLAZE_MIC_MODE
275 {
276  return _mm512_div_pd( a.value, b.value );
277 }
278 #elif BLAZE_AVX_MODE
279 {
280  return _mm256_div_pd( a.value, b.value );
281 }
282 #elif BLAZE_SSE2_MODE
283 {
284  return _mm_div_pd( a.value, b.value );
285 }
286 #else
287 = delete;
288 #endif
289 //*************************************************************************************************
290 
291 } // namespace blaze
292 
293 #endif
const EnableIf_< IsNumeric< T2 >, DivExprTrait_< T1, T2 > > operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:966
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the basic SIMD types.
const DMatEvalExpr< MT, SO > eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:705
System settings for the SSE mode.
System settings for the inline keywords.