All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Subtraction.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_MATH_INTRINSICS_SUBTRACTION_H_
23 #define _BLAZE_MATH_INTRINSICS_SUBTRACTION_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
32 
33 
34 namespace blaze {
35 
36 //=================================================================================================
37 //
38 // INTRINSIC SUBTRACTION OPERATORS
39 //
40 //=================================================================================================
41 
42 //*************************************************************************************************
51 #if BLAZE_AVX2_MODE
52 inline sse_int8_t operator-( const sse_int8_t& a, const sse_int8_t& b )
53 {
54  return _mm256_sub_epi8( a.value, b.value );
55 }
56 #elif BLAZE_SSE2_MODE
57 inline sse_int8_t operator-( const sse_int8_t& a, const sse_int8_t& b )
58 {
59  return _mm_sub_epi8( a.value, b.value );
60 }
61 #endif
62 //*************************************************************************************************
63 
64 
65 //*************************************************************************************************
74 #if BLAZE_AVX2_MODE
75 inline sse_int16_t operator-( const sse_int16_t& a, const sse_int16_t& b )
76 {
77  return _mm256_sub_epi16( a.value, b.value );
78 }
79 #elif BLAZE_SSE2_MODE
80 inline sse_int16_t operator-( const sse_int16_t& a, const sse_int16_t& b )
81 {
82  return _mm_sub_epi16( a.value, b.value );
83 }
84 #endif
85 //*************************************************************************************************
86 
87 
88 //*************************************************************************************************
97 #if BLAZE_MIC_MODE
98 inline sse_int64_t operator-( const sse_int32_t& a, const sse_int32_t& b )
99 {
100  return _mm512_sub_epi32( a.value, b.value );
101 }
102 #elif BLAZE_AVX2_MODE
103 inline sse_int32_t operator-( const sse_int32_t& a, const sse_int32_t& b )
104 {
105  return _mm256_sub_epi32( a.value, b.value );
106 }
107 #elif BLAZE_SSE2_MODE
108 inline sse_int32_t operator-( const sse_int32_t& a, const sse_int32_t& b )
109 {
110  return _mm_sub_epi32( a.value, b.value );
111 }
112 #endif
113 //*************************************************************************************************
114 
115 
116 //*************************************************************************************************
125 #if BLAZE_AVX2_MODE
126 inline sse_int64_t operator-( const sse_int64_t& a, const sse_int64_t& b )
127 {
128  return _mm256_sub_epi64( a.value, b.value );
129 }
130 #elif BLAZE_SSE2_MODE
131 inline sse_int64_t operator-( const sse_int64_t& a, const sse_int64_t& b )
132 {
133  return _mm_sub_epi64( a.value, b.value );
134 }
135 #endif
136 //*************************************************************************************************
137 
138 
139 //*************************************************************************************************
148 #if BLAZE_MIC_MODE
149 inline sse_float_t operator-( const sse_float_t& a, const sse_float_t& b )
150 {
151  return _mm512_sub_ps( a.value, b.value );
152 }
153 #elif BLAZE_AVX_MODE
154 inline sse_float_t operator-( const sse_float_t& a, const sse_float_t& b )
155 {
156  return _mm256_sub_ps( a.value, b.value );
157 }
158 #elif BLAZE_SSE_MODE
159 inline sse_float_t operator-( const sse_float_t& a, const sse_float_t& b )
160 {
161  return _mm_sub_ps( a.value, b.value );
162 }
163 #endif
164 //*************************************************************************************************
165 
166 
167 //*************************************************************************************************
176 #if BLAZE_MIC_MODE
177 inline sse_double_t operator-( const sse_double_t& a, const sse_double_t& b )
178 {
179  return _mm512_sub_pd( a.value, b.value );
180 }
181 #elif BLAZE_AVX_MODE
182 inline sse_double_t operator-( const sse_double_t& a, const sse_double_t& b )
183 {
184  return _mm256_sub_pd( a.value, b.value );
185 }
186 #elif BLAZE_SSE2_MODE
187 inline sse_double_t operator-( const sse_double_t& a, const sse_double_t& b )
188 {
189  return _mm_sub_pd( a.value, b.value );
190 }
191 #endif
192 //*************************************************************************************************
193 
194 
195 //*************************************************************************************************
204 #if BLAZE_AVX_MODE
205 inline sse_cfloat_t operator-( const sse_cfloat_t& a, const sse_cfloat_t& b )
206 {
207  return _mm256_sub_ps( a.value, b.value );
208 }
209 #elif BLAZE_SSE_MODE
210 inline sse_cfloat_t operator-( const sse_cfloat_t& a, const sse_cfloat_t& b )
211 {
212  return _mm_sub_ps( a.value, b.value );
213 }
214 #endif
215 //*************************************************************************************************
216 
217 
218 //*************************************************************************************************
227 #if BLAZE_AVX_MODE
228 inline sse_cdouble_t operator-( const sse_cdouble_t& a, const sse_cdouble_t& b )
229 {
230  return _mm256_sub_pd( a.value, b.value );
231 }
232 #elif BLAZE_SSE2_MODE
233 inline sse_cdouble_t operator-( const sse_cdouble_t& a, const sse_cdouble_t& b )
234 {
235  return _mm_sub_pd( a.value, b.value );
236 }
237 #endif
238 //*************************************************************************************************
239 
240 } // namespace blaze
241 
242 #endif