All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Addition.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_INTRINSICS_ADDITION_H_
36 #define _BLAZE_MATH_INTRINSICS_ADDITION_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/system/Inline.h>
46 
47 
48 namespace blaze {
49 
50 //=================================================================================================
51 //
52 // INTRINSIC ADDITION OPERATORS
53 //
54 //=================================================================================================
55 
56 //*************************************************************************************************
65 #if BLAZE_AVX2_MODE
66 BLAZE_ALWAYS_INLINE sse_int8_t operator+( const sse_int8_t& a, const sse_int8_t& b )
67 {
68  return _mm256_add_epi8( a.value, b.value );
69 }
70 #elif BLAZE_SSE2_MODE
71 BLAZE_ALWAYS_INLINE sse_int8_t operator+( const sse_int8_t& a, const sse_int8_t& b )
72 {
73  return _mm_add_epi8( a.value, b.value );
74 }
75 #endif
76 //*************************************************************************************************
77 
78 
79 //*************************************************************************************************
88 #if BLAZE_AVX2_MODE
89 BLAZE_ALWAYS_INLINE sse_int16_t operator+( const sse_int16_t& a, const sse_int16_t& b )
90 {
91  return _mm256_add_epi16( a.value, b.value );
92 }
93 #elif BLAZE_SSE2_MODE
94 BLAZE_ALWAYS_INLINE sse_int16_t operator+( const sse_int16_t& a, const sse_int16_t& b )
95 {
96  return _mm_add_epi16( a.value, b.value );
97 }
98 #endif
99 //*************************************************************************************************
100 
101 
102 //*************************************************************************************************
111 #if BLAZE_MIC_MODE
112 BLAZE_ALWAYS_INLINE sse_int32_t operator+( const sse_int32_t& a, const sse_int32_t& b )
113 {
114  return _mm512_add_epi32( a.value, b.value );
115 }
116 #elif BLAZE_AVX2_MODE
117 BLAZE_ALWAYS_INLINE sse_int32_t operator+( const sse_int32_t& a, const sse_int32_t& b )
118 {
119  return _mm256_add_epi32( a.value, b.value );
120 }
121 #elif BLAZE_SSE2_MODE
122 BLAZE_ALWAYS_INLINE sse_int32_t operator+( const sse_int32_t& a, const sse_int32_t& b )
123 {
124  return _mm_add_epi32( a.value, b.value );
125 }
126 #endif
127 //*************************************************************************************************
128 
129 
130 //*************************************************************************************************
139 #if BLAZE_MIC_MODE
140 BLAZE_ALWAYS_INLINE sse_int64_t operator+( const sse_int64_t& a, const sse_int64_t& b )
141 {
142  return _mm512_add_epi64( a.value, b.value );
143 }
144 #elif BLAZE_AVX2_MODE
145 BLAZE_ALWAYS_INLINE sse_int64_t operator+( const sse_int64_t& a, const sse_int64_t& b )
146 {
147  return _mm256_add_epi64( a.value, b.value );
148 }
149 #elif BLAZE_SSE2_MODE
150 BLAZE_ALWAYS_INLINE sse_int64_t operator+( const sse_int64_t& a, const sse_int64_t& b )
151 {
152  return _mm_add_epi64( a.value, b.value );
153 }
154 #endif
155 //*************************************************************************************************
156 
157 
158 //*************************************************************************************************
167 #if BLAZE_MIC_MODE
168 BLAZE_ALWAYS_INLINE sse_float_t operator+( const sse_float_t& a, const sse_float_t& b )
169 {
170  return _mm512_add_ps( a.value, b.value );
171 }
172 #elif BLAZE_AVX_MODE
173 BLAZE_ALWAYS_INLINE sse_float_t operator+( const sse_float_t& a, const sse_float_t& b )
174 {
175  return _mm256_add_ps( a.value, b.value );
176 }
177 #elif BLAZE_SSE_MODE
178 BLAZE_ALWAYS_INLINE sse_float_t operator+( const sse_float_t& a, const sse_float_t& b )
179 {
180  return _mm_add_ps( a.value, b.value );
181 }
182 #endif
183 //*************************************************************************************************
184 
185 
186 //*************************************************************************************************
195 #if BLAZE_MIC_MODE
196 BLAZE_ALWAYS_INLINE sse_double_t operator+( const sse_double_t& a, const sse_double_t& b )
197 {
198  return _mm512_add_pd( a.value, b.value );
199 }
200 #elif BLAZE_AVX_MODE
201 BLAZE_ALWAYS_INLINE sse_double_t operator+( const sse_double_t& a, const sse_double_t& b )
202 {
203  return _mm256_add_pd( a.value, b.value );
204 }
205 #elif BLAZE_SSE2_MODE
206 BLAZE_ALWAYS_INLINE sse_double_t operator+( const sse_double_t& a, const sse_double_t& b )
207 {
208  return _mm_add_pd( a.value, b.value );
209 }
210 #endif
211 //*************************************************************************************************
212 
213 
214 //*************************************************************************************************
223 #if BLAZE_MIC_MODE
224 BLAZE_ALWAYS_INLINE sse_cfloat_t operator+( const sse_cfloat_t& a, const sse_cfloat_t& b )
225 {
226  return _mm512_add_ps( a.value, b.value );
227 }
228 #elif BLAZE_AVX_MODE
229 BLAZE_ALWAYS_INLINE sse_cfloat_t operator+( const sse_cfloat_t& a, const sse_cfloat_t& b )
230 {
231  return _mm256_add_ps( a.value, b.value );
232 }
233 #elif BLAZE_SSE_MODE
234 BLAZE_ALWAYS_INLINE sse_cfloat_t operator+( const sse_cfloat_t& a, const sse_cfloat_t& b )
235 {
236  return _mm_add_ps( a.value, b.value );
237 }
238 #endif
239 //*************************************************************************************************
240 
241 
242 //*************************************************************************************************
251 #if BLAZE_MIC_MODE
252 BLAZE_ALWAYS_INLINE sse_cdouble_t operator+( const sse_cdouble_t& a, const sse_cdouble_t& b )
253 {
254  return _mm512_add_pd( a.value, b.value );
255 }
256 #elif BLAZE_AVX_MODE
257 BLAZE_ALWAYS_INLINE sse_cdouble_t operator+( const sse_cdouble_t& a, const sse_cdouble_t& b )
258 {
259  return _mm256_add_pd( a.value, b.value );
260 }
261 #elif BLAZE_SSE2_MODE
262 BLAZE_ALWAYS_INLINE sse_cdouble_t operator+( const sse_cdouble_t& a, const sse_cdouble_t& b )
263 {
264  return _mm_add_pd( a.value, b.value );
265 }
266 #endif
267 //*************************************************************************************************
268 
269 } // namespace blaze
270 
271 #endif
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
const DenseIterator< Type > operator+(const DenseIterator< Type > &it, ptrdiff_t inc)
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:556
Header file for the basic intrinsic types.
System settings for the SSE mode.
System settings for the inline keywords.