22 #ifndef _BLAZE_MATH_INTRINSICS_STREAM_H_
23 #define _BLAZE_MATH_INTRINSICS_STREAM_H_
75 template<
typename T >
80 typedef sse_int16_t Type;
84 static inline void stream( T* address,
const Type& value )
87 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 32UL ),
"Invalid alignment detected" );
88 _mm256_stream_si256( reinterpret_cast<__m256i*>( address ), value.value );
90 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 16UL ),
"Invalid alignment detected" );
91 _mm_stream_si128( reinterpret_cast<__m128i*>( address ), value.value );
93 *address = value.value;
112 template<
typename T >
117 typedef sse_int32_t Type;
121 static inline void stream( T* address,
const Type& value )
124 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 64UL ),
"Invalid alignment detected" );
125 _mm512_store_epi32( address, value.value );
126 #elif BLAZE_AVX2_MODE
127 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 32UL ),
"Invalid alignment detected" );
128 _mm256_stream_si256( reinterpret_cast<__m256i*>( address ), value.value );
129 #elif BLAZE_SSE2_MODE
130 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 16UL ),
"Invalid alignment detected" );
131 _mm_stream_si128( reinterpret_cast<__m128i*>( address ), value.value );
133 *address = value.value;
152 template<
typename T >
157 typedef sse_int64_t Type;
161 static inline void stream( T* address,
const Type& value )
164 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 64UL ),
"Invalid alignment detected" );
165 _mm512_store_epi64( address, value.value );
166 #elif BLAZE_AVX2_MODE
167 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 32UL ),
"Invalid alignment detected" );
168 _mm256_stream_si256( reinterpret_cast<__m256i*>( address ), value.value );
169 #elif BLAZE_SSE2_MODE
170 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 16UL ),
"Invalid alignment detected" );
171 _mm_stream_si128( reinterpret_cast<__m128i*>( address ), value.value );
173 *address = value.value;
203 template<
typename T >
204 inline typename EnableIf< IsIntegral<T> >::Type
205 stream( T* address,
const typename Stream<T,
sizeof(T)>::Type& value )
223 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 64UL ),
"Invalid alignment detected" );
224 _mm512_storenr_ps( address, value.value );
226 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 32UL ),
"Invalid alignment detected" );
227 _mm256_stream_ps( address, value.value );
229 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 16UL ),
"Invalid alignment detected" );
230 _mm_stream_ps( address, value.value );
232 *address = value.value;
249 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 64UL ),
"Invalid alignment detected" );
250 _mm512_storenr_pd( address, value.value );
252 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 32UL ),
"Invalid alignment detected" );
253 _mm256_stream_pd( address, value.value );
254 #elif BLAZE_SSE2_MODE
255 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 16UL ),
"Invalid alignment detected" );
256 _mm_stream_pd( address, value.value );
258 *address = value.value;
275 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 32UL ),
"Invalid alignment detected" );
276 _mm256_stream_ps( reinterpret_cast<float*>( address ), value.value );
278 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 16UL ),
"Invalid alignment detected" );
279 _mm_stream_ps( reinterpret_cast<float*>( address ), value.value );
281 *address = value.value;
299 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 32UL ),
"Invalid alignment detected" );
300 _mm256_stream_pd( reinterpret_cast<double*>( address ), value.value );
301 #elif BLAZE_SSE2_MODE
302 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 16UL ),
"Invalid alignment detected" );
303 _mm_stream_pd( reinterpret_cast<double*>( address ), value.value );
305 *address = value.value;