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 // 8-BIT INTEGRAL SIMD TYPES
53 //
54 //=================================================================================================
55 
56 //*************************************************************************************************
66 BLAZE_ALWAYS_INLINE const SIMDint8
67  operator/( const SIMDint8& a, const SIMDint8& b ) noexcept
68 #if BLAZE_SVML_MODE && BLAZE_AVX512BW_MODE
69 {
70  return _mm512_div_epi8( a.value, b.value );
71 }
72 #else
73 = delete;
74 #endif
75 //*************************************************************************************************
76 
77 
78 //*************************************************************************************************
88 BLAZE_ALWAYS_INLINE const SIMDcint8
89  operator/( const SIMDcint8& a, const SIMDint8& b ) noexcept
90 #if BLAZE_SVML_MODE && BLAZE_AVX512BW_MODE
91 {
92  return _mm512_div_epi8( a.value, b.value );
93 }
94 #else
95 = delete;
96 #endif
97 //*************************************************************************************************
98 
99 
100 
101 
102 //=================================================================================================
103 //
104 // 16-BIT INTEGRAL SIMD TYPES
105 //
106 //=================================================================================================
107 
108 //*************************************************************************************************
118 BLAZE_ALWAYS_INLINE const SIMDint16
119  operator/( const SIMDint16& a, const SIMDint16& b ) noexcept
120 #if BLAZE_SVML_MODE && BLAZE_AVX512BW_MODE
121 {
122  return _mm512_div_epi16( a.value, b.value );
123 }
124 #else
125 = delete;
126 #endif
127 //*************************************************************************************************
128 
129 
130 //*************************************************************************************************
140 BLAZE_ALWAYS_INLINE const SIMDcint16
141  operator/( const SIMDcint16& a, const SIMDint16& b ) noexcept
142 #if BLAZE_SVML_MODE && BLAZE_AVX512BW_MODE
143 {
144  return _mm512_div_epi16( a.value, b.value );
145 }
146 #else
147 = delete;
148 #endif
149 //*************************************************************************************************
150 
151 
152 
153 
154 //=================================================================================================
155 //
156 // 32-BIT INTEGRAL SIMD TYPES
157 //
158 //=================================================================================================
159 
160 //*************************************************************************************************
170 BLAZE_ALWAYS_INLINE const SIMDint32
171  operator/( const SIMDint32& a, const SIMDint32& b ) noexcept
172 #if BLAZE_SVML_MODE && ( BLAZE_AVX512F_MODE || BLAZE_MIC_MODE )
173 {
174  return _mm512_div_epi32( a.value, b.value );
175 }
176 #else
177 = delete;
178 #endif
179 //*************************************************************************************************
180 
181 
182 //*************************************************************************************************
192 BLAZE_ALWAYS_INLINE const SIMDcint32
193  operator/( const SIMDcint32& a, const SIMDint32& b ) noexcept
194 #if BLAZE_SVML_MODE && ( BLAZE_AVX512F_MODE || BLAZE_MIC_MODE )
195 {
196  return _mm512_div_epi32( a.value, b.value );
197 }
198 #else
199 = delete;
200 #endif
201 //*************************************************************************************************
202 
203 
204 
205 
206 //=================================================================================================
207 //
208 // 64-BIT INTEGRAL SIMD TYPES
209 //
210 //=================================================================================================
211 
212 //*************************************************************************************************
222 BLAZE_ALWAYS_INLINE const SIMDint64
223  operator/( const SIMDint64& a, const SIMDint64& b ) noexcept
224 #if BLAZE_SVML_MODE && ( BLAZE_AVX512F_MODE || BLAZE_MIC_MODE )
225 {
226  return _mm512_div_epi64( a.value, b.value );
227 }
228 #else
229 = delete;
230 #endif
231 //*************************************************************************************************
232 
233 
234 //*************************************************************************************************
244 BLAZE_ALWAYS_INLINE const SIMDcint64
245  operator/( const SIMDcint64& a, const SIMDint64& b ) noexcept
246 #if BLAZE_SVML_MODE && ( BLAZE_AVX512F_MODE || BLAZE_MIC_MODE )
247 {
248  return _mm512_div_epi64( (~a).value, (~b).value );
249 }
250 #else
251 = delete;
252 #endif
253 //*************************************************************************************************
254 
255 
256 
257 
258 //=================================================================================================
259 //
260 // 32-BIT FLOATING POINT SIMD TYPES
261 //
262 //=================================================================================================
263 
264 //*************************************************************************************************
274 template< typename T1 // Type of the left-hand side operand
275  , typename T2 > // Type of the right-hand side operand
276 BLAZE_ALWAYS_INLINE const SIMDfloat
277  operator/( const SIMDf32<T1>& a, const SIMDf32<T2>& b ) noexcept
278 #if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
279 {
280  return _mm512_div_ps( (~a).eval().value, (~b).eval().value );
281 }
282 #elif BLAZE_AVX_MODE
283 {
284  return _mm256_div_ps( (~a).eval().value, (~b).eval().value );
285 }
286 #elif BLAZE_SSE_MODE
287 {
288  return _mm_div_ps( (~a).eval().value, (~b).eval().value );
289 }
290 #else
291 = delete;
292 #endif
293 //*************************************************************************************************
294 
295 
296 //*************************************************************************************************
306 BLAZE_ALWAYS_INLINE const SIMDcfloat
307  operator/( const SIMDcfloat& a, const SIMDfloat& b ) noexcept
308 #if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
309 {
310  return _mm512_div_ps( a.value, b.value );
311 }
312 #elif BLAZE_AVX_MODE
313 {
314  return _mm256_div_ps( a.value, b.value );
315 }
316 #elif BLAZE_SSE_MODE
317 {
318  return _mm_div_ps( a.value, b.value );
319 }
320 #else
321 = delete;
322 #endif
323 //*************************************************************************************************
324 
325 
326 
327 
328 //=================================================================================================
329 //
330 // 64-BIT FLOATING POINT SIMD TYPES
331 //
332 //=================================================================================================
333 
334 //*************************************************************************************************
344 template< typename T1 // Type of the left-hand side operand
345  , typename T2 > // Type of the right-hand side operand
346 BLAZE_ALWAYS_INLINE const SIMDdouble
347  operator/( const SIMDf64<T1>& a, const SIMDf64<T2>& b ) noexcept
348 #if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
349 {
350  return _mm512_div_pd( (~a).eval().value, (~b).eval().value );
351 }
352 #elif BLAZE_AVX_MODE
353 {
354  return _mm256_div_pd( (~a).eval().value, (~b).eval().value );
355 }
356 #elif BLAZE_SSE2_MODE
357 {
358  return _mm_div_pd( (~a).eval().value, (~b).eval().value );
359 }
360 #else
361 = delete;
362 #endif
363 //*************************************************************************************************
364 
365 
366 //*************************************************************************************************
376 BLAZE_ALWAYS_INLINE const SIMDcdouble
377  operator/( const SIMDcdouble& a, const SIMDdouble& b ) noexcept
378 #if BLAZE_AVX512F_MODE || BLAZE_MIC_MODE
379 {
380  return _mm512_div_pd( a.value, b.value );
381 }
382 #elif BLAZE_AVX_MODE
383 {
384  return _mm256_div_pd( a.value, b.value );
385 }
386 #elif BLAZE_SSE2_MODE
387 {
388  return _mm_div_pd( a.value, b.value );
389 }
390 #else
391 = delete;
392 #endif
393 //*************************************************************************************************
394 
395 } // namespace blaze
396 
397 #endif
decltype(auto) operator/(const DenseMatrix< MT, SO > &mat, ST scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:1073
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
decltype(auto) eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:797
Header file for the basic SIMD types.
System settings for the SSE mode.
System settings for the inline keywords.