22 #ifndef _BLAZE_MATH_INTRINSICS_LOAD_H_
23 #define _BLAZE_MATH_INTRINSICS_LOAD_H_
76 template<
typename T >
81 typedef sse_int16_t Type;
85 static inline Type
load(
const T* address )
88 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 32UL ),
"Invalid alignment detected" );
89 return _mm256_load_si256( reinterpret_cast<const __m256i*>( address ) );
91 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 16UL ),
"Invalid alignment detected" );
92 return _mm_load_si128( reinterpret_cast<const __m128i*>( address ) );
113 template<
typename T >
118 typedef sse_int32_t Type;
122 static inline Type
load(
const T* address )
125 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 64UL ),
"Invalid alignment detected" );
126 return _mm512_load_epi32( address );
127 #elif BLAZE_AVX2_MODE
128 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 32UL ),
"Invalid alignment detected" );
129 return _mm256_load_si256( reinterpret_cast<const __m256i*>( address ) );
130 #elif BLAZE_SSE2_MODE
131 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 16UL ),
"Invalid alignment detected" );
132 return _mm_load_si128( reinterpret_cast<const __m128i*>( address ) );
153 template<
typename T >
158 typedef sse_int64_t Type;
162 static inline Type
load(
const T* address )
165 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 64UL ),
"Invalid alignment detected" );
166 return _mm512_load_epi64( address );
167 #elif BLAZE_AVX2_MODE
168 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 32UL ),
"Invalid alignment detected" );
169 return _mm256_load_si256( reinterpret_cast<const __m256i*>( address ) );
170 #elif BLAZE_SSE2_MODE
171 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 16UL ),
"Invalid alignment detected" );
172 return _mm_load_si128( reinterpret_cast<const __m128i*>( address ) );
203 template<
typename T >
204 inline typename EnableIf< IsIntegral<T>, Load<T,sizeof(T)> >::Type::Type
222 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 64UL ),
"Invalid alignment detected" );
223 return _mm512_load_ps( address );
225 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 32UL ),
"Invalid alignment detected" );
226 return _mm256_load_ps( address );
228 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 16UL ),
"Invalid alignment detected" );
229 return _mm_load_ps( address );
247 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 64UL ),
"Invalid alignment detected" );
248 return _mm512_load_pd( address );
250 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 32UL ),
"Invalid alignment detected" );
251 return _mm256_load_pd( address );
252 #elif BLAZE_SSE2_MODE
253 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 16UL ),
"Invalid alignment detected" );
254 return _mm_load_pd( address );
272 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 32UL ),
"Invalid alignment detected" );
273 return _mm256_load_ps( reinterpret_cast<const float*>( address ) );
275 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 16UL ),
"Invalid alignment detected" );
276 return _mm_load_ps( reinterpret_cast<const float*>( address ) );
295 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 32UL ),
"Invalid alignment detected" );
296 return _mm256_load_pd( reinterpret_cast<const double*>( address ) );
297 #elif BLAZE_SSE2_MODE
298 BLAZE_INTERNAL_ASSERT( !( reinterpret_cast<size_t>( address ) % 16UL ),
"Invalid alignment detected" );
299 return _mm_load_pd( reinterpret_cast<const double*>( address ) );