107 template <
typename string_type>
116 template <u
int32 VECTOR_WIDTH_T>
118 static uint2
range(
const string_type&
string)
121 return make_uint2( 0, rounded_length );
126 template <u
int32 VECTOR_WIDTH_T>
129 const string_type&
string,
135 for (
uint32 j = 0; j < VECTOR_WIDTH_T; ++j)
136 vector[j] =
string[offset + j];
142 static uint2
range(
const string_type&
string)
144 return range<VECTOR_WIDTH>( string );
151 const string_type&
string,
155 load<VECTOR_WIDTH>( string, offset, vector );
161 template <
typename string_type>
170 template <
typename string_type>
194 template <u
int32 VECTOR_WIDTH_T>
196 static uint2
range(
const char*
string)
198 const uint64 offset =
uint64(
string ) % VECTOR_WIDTH_T;
204 return aligned_begin < aligned_end ?
205 make_uint2( aligned_begin - offset, aligned_end - offset ) :
206 make_uint2( len, len );
211 template <u
int32 VECTOR_WIDTH_T>
218 const char* base_ptr =
string + offset;
219 vector_load<VECTOR_WIDTH_T>( base_ptr, vector );
225 static uint2
range(
const char*
string)
227 return range<VECTOR_WIDTH>( string );
238 load<VECTOR_WIDTH>( string, offset, vector );
248 template <
typename T,
typename IndexType>
259 template <u
int32 VECTOR_WIDTH_T>
261 static uint2
range(
const string_type&
string)
263 const uint64 offset = (
uint64(
string.base()) /
sizeof(T)) % VECTOR_WIDTH_T;
268 return aligned_begin < aligned_end ?
269 make_uint2( aligned_begin - offset, aligned_end - offset ) :
270 make_uint2(
string.size(),
string.size() );
275 template <u
int32 VECTOR_WIDTH_T>
278 const string_type&
string,
282 const T* base_ptr =
string.base() + offset;
283 vector_load<VECTOR_WIDTH_T>( base_ptr, vector );
289 static uint2
range(
const string_type&
string)
291 return range<VECTOR_WIDTH>( string );
298 const string_type&
string,
302 load<VECTOR_WIDTH>( string, offset, vector );
312 template <
typename InputStream,
typename Symbol, u
int32 SYMBOL_SIZE_T,
bool BIG_ENDIAN_T,
typename IndexType>
322 static const uint32 SYMBOL_SIZE = SYMBOL_SIZE_T;
323 static const uint32 SYMBOL_COUNT = 1u << SYMBOL_SIZE_T;
331 const index_type offset =
string.base().index();
336 return aligned_begin < aligned_end ?
337 make_uint2( aligned_begin - offset, aligned_end - offset ) :
338 make_uint2(
string.size(),
string.size() );
363 vector[j] = (word >> (SYMBOL_OFFSET - SYMBOL_SIZE * j)) & (SYMBOL_COUNT-1);
369 vector[j] = (word >> (SYMBOL_SIZE * j)) & (SYMBOL_COUNT-1);