MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Hash64AVX_128_Impl

Function Hash64AVX_128_Impl

tensorflow/core/lib/hash/hash.cc:263–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263inline void Hash64AVX_128_Impl(const char*& data, size_t& n, uint64& h,
264 const uint64& m, const int& r) {
265 __m128i m_pack = _mm_set_epi64x(m, m);
266 __m128i k;
267 __m128i k_tmp;
268
269 // unrolling by using __m128i
270 while (n >= 16) {
271 k = _mm_loadu_si128((const __m128i*)data);
272 if (!port::kLittleEndian) {
273 // change from BigEdian to LittleEdian
274 swap_int64_128(k);
275 }
276 data += 16;
277 n -= 16;
278
279 k = _mm_mullo_epi64_hand(k, m_pack);
280 k_tmp = _mm_srli_epi64(k, r);
281 k = _mm_xor_si128(k, k_tmp);
282 k = _mm_mullo_epi64_hand(k, m_pack);
283 h ^= (uint64)_mm_extract_epi64(k, 0);
284 h *= m;
285 h ^= (uint64)_mm_extract_epi64(k, 1);
286 h *= m;
287 }
288}
289
290// for batch-vectorized kernels in farmhash.h
291// Some primes between 2^63 and 2^64 for various uses.

Callers 1

Hash64V3Function · 0.85

Calls 2

swap_int64_128Function · 0.85
_mm_mullo_epi64_handFunction · 0.85

Tested by

no test coverage detected