All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Multiplication.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_MATH_INTRINSICS_MULTIPLICATION_H_
23 #define _BLAZE_MATH_INTRINSICS_MULTIPLICATION_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
32 
33 
34 namespace blaze {
35 
36 //=================================================================================================
37 //
38 // INTRINSIC MULTIPLICATION OPERATORS
39 //
40 //=================================================================================================
41 
42 //*************************************************************************************************
51 #if BLAZE_SSE2_MODE
52 inline sse_int16_t operator*( const sse_int16_t& a, const sse_int16_t& b )
53 {
54  return _mm_mullo_epi16( a.value, b.value );
55 }
56 #endif
57 //*************************************************************************************************
58 
59 
60 //*************************************************************************************************
69 #if BLAZE_MIC_MODE
70 inline sse_int32_t operator*( const sse_int32_t& a, const sse_int32_t& b )
71 {
72  return _mm512_mullo_epi32( a.value, b.value );
73 }
74 #elif BLAZE_SSE4_MODE
75 inline sse_int32_t operator*( const sse_int32_t& a, const sse_int32_t& b )
76 {
77  return _mm_mullo_epi32( a.value, b.value );
78 }
79 #endif
80 //*************************************************************************************************
81 
82 
83 //*************************************************************************************************
92 #if BLAZE_MIC_MODE
93 inline sse_float_t operator*( const sse_float_t& a, const sse_float_t& b )
94 {
95  return _mm512_mul_ps( a.value, b.value );
96 }
97 #elif BLAZE_AVX_MODE
98 inline sse_float_t operator*( const sse_float_t& a, const sse_float_t& b )
99 {
100  return _mm256_mul_ps( a.value, b.value );
101 }
102 #elif BLAZE_SSE_MODE
103 inline sse_float_t operator*( const sse_float_t& a, const sse_float_t& b )
104 {
105  return _mm_mul_ps( a.value, b.value );
106 }
107 #endif
108 //*************************************************************************************************
109 
110 
111 //*************************************************************************************************
120 #if BLAZE_MIC_MODE
121 inline sse_double_t operator*( const sse_double_t& a, const sse_double_t& b )
122 {
123  return _mm512_mul_pd( a.value, b.value );
124 }
125 #elif BLAZE_AVX_MODE
126 inline sse_double_t operator*( const sse_double_t& a, const sse_double_t& b )
127 {
128  return _mm256_mul_pd( a.value, b.value );
129 }
130 #elif BLAZE_SSE2_MODE
131 inline sse_double_t operator*( const sse_double_t& a, const sse_double_t& b )
132 {
133  return _mm_mul_pd( a.value, b.value );
134 }
135 #endif
136 //*************************************************************************************************
137 
138 } // namespace blaze
139 
140 #endif