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 
45 
46 
47 namespace blaze {
48 
49 //=================================================================================================
50 //
51 // INTRINSIC ADDITION OPERATORS
52 //
53 //=================================================================================================
54 
55 //*************************************************************************************************
64 #if BLAZE_AVX2_MODE
65 inline sse_int8_t operator+( const sse_int8_t& a, const sse_int8_t& b )
66 {
67  return _mm256_add_epi8( a.value, b.value );
68 }
69 #elif BLAZE_SSE2_MODE
70 inline sse_int8_t operator+( const sse_int8_t& a, const sse_int8_t& b )
71 {
72  return _mm_add_epi8( a.value, b.value );
73 }
74 #endif
75 //*************************************************************************************************
76 
77 
78 //*************************************************************************************************
87 #if BLAZE_AVX2_MODE
88 inline sse_int16_t operator+( const sse_int16_t& a, const sse_int16_t& b )
89 {
90  return _mm256_add_epi16( a.value, b.value );
91 }
92 #elif BLAZE_SSE2_MODE
93 inline sse_int16_t operator+( const sse_int16_t& a, const sse_int16_t& b )
94 {
95  return _mm_add_epi16( a.value, b.value );
96 }
97 #endif
98 //*************************************************************************************************
99 
100 
101 //*************************************************************************************************
110 #if BLAZE_MIC_MODE
111 inline sse_int32_t operator+( const sse_int32_t& a, const sse_int32_t& b )
112 {
113  return _mm512_add_epi32( a.value, b.value );
114 }
115 #elif BLAZE_AVX2_MODE
116 inline sse_int32_t operator+( const sse_int32_t& a, const sse_int32_t& b )
117 {
118  return _mm256_add_epi32( a.value, b.value );
119 }
120 #elif BLAZE_SSE2_MODE
121 inline sse_int32_t operator+( const sse_int32_t& a, const sse_int32_t& b )
122 {
123  return _mm_add_epi32( a.value, b.value );
124 }
125 #endif
126 //*************************************************************************************************
127 
128 
129 //*************************************************************************************************
138 #if BLAZE_MIC_MODE
139 inline sse_int64_t operator+( const sse_int64_t& a, const sse_int64_t& b )
140 {
141  return _mm512_add_epi64( a.value, b.value );
142 }
143 #elif BLAZE_AVX2_MODE
144 inline sse_int64_t operator+( const sse_int64_t& a, const sse_int64_t& b )
145 {
146  return _mm256_add_epi64( a.value, b.value );
147 }
148 #elif BLAZE_SSE2_MODE
149 inline sse_int64_t operator+( const sse_int64_t& a, const sse_int64_t& b )
150 {
151  return _mm_add_epi64( a.value, b.value );
152 }
153 #endif
154 //*************************************************************************************************
155 
156 
157 //*************************************************************************************************
166 #if BLAZE_MIC_MODE
167 inline sse_float_t operator+( const sse_float_t& a, const sse_float_t& b )
168 {
169  return _mm512_add_ps( a.value, b.value );
170 }
171 #elif BLAZE_AVX_MODE
172 inline sse_float_t operator+( const sse_float_t& a, const sse_float_t& b )
173 {
174  return _mm256_add_ps( a.value, b.value );
175 }
176 #elif BLAZE_SSE_MODE
177 inline sse_float_t operator+( const sse_float_t& a, const sse_float_t& b )
178 {
179  return _mm_add_ps( a.value, b.value );
180 }
181 #endif
182 //*************************************************************************************************
183 
184 
185 //*************************************************************************************************
194 #if BLAZE_MIC_MODE
195 inline sse_double_t operator+( const sse_double_t& a, const sse_double_t& b )
196 {
197  return _mm512_add_pd( a.value, b.value );
198 }
199 #elif BLAZE_AVX_MODE
200 inline sse_double_t operator+( const sse_double_t& a, const sse_double_t& b )
201 {
202  return _mm256_add_pd( a.value, b.value );
203 }
204 #elif BLAZE_SSE2_MODE
205 inline sse_double_t operator+( const sse_double_t& a, const sse_double_t& b )
206 {
207  return _mm_add_pd( a.value, b.value );
208 }
209 #endif
210 //*************************************************************************************************
211 
212 
213 //*************************************************************************************************
222 #if BLAZE_MIC_MODE
223 inline sse_cfloat_t operator+( const sse_cfloat_t& a, const sse_cfloat_t& b )
224 {
225  return _mm512_add_ps( a.value, b.value );
226 }
227 #elif BLAZE_AVX_MODE
228 inline sse_cfloat_t operator+( const sse_cfloat_t& a, const sse_cfloat_t& b )
229 {
230  return _mm256_add_ps( a.value, b.value );
231 }
232 #elif BLAZE_SSE_MODE
233 inline sse_cfloat_t operator+( const sse_cfloat_t& a, const sse_cfloat_t& b )
234 {
235  return _mm_add_ps( a.value, b.value );
236 }
237 #endif
238 //*************************************************************************************************
239 
240 
241 //*************************************************************************************************
250 #if BLAZE_MIC_MODE
251 inline sse_cdouble_t operator+( const sse_cdouble_t& a, const sse_cdouble_t& b )
252 {
253  return _mm512_add_pd( a.value, b.value );
254 }
255 #elif BLAZE_AVX_MODE
256 inline sse_cdouble_t operator+( const sse_cdouble_t& a, const sse_cdouble_t& b )
257 {
258  return _mm256_add_pd( a.value, b.value );
259 }
260 #elif BLAZE_SSE2_MODE
261 inline sse_cdouble_t operator+( const sse_cdouble_t& a, const sse_cdouble_t& b )
262 {
263  return _mm_add_pd( a.value, b.value );
264 }
265 #endif
266 //*************************************************************************************************
267 
268 } // namespace blaze
269 
270 #endif
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.