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

Function HashLen33to64Batch

tensorflow/core/lib/hash/hash.cc:448–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446}
447
448inline void HashLen33to64Batch(const char** data, uint64_t* h_out, size_t len) {
449 __m512i k2_batch = _mm512_set1_epi64(k2);
450 __m512i factor_2_batch = _mm512_set1_epi64(2);
451 __m512i factor_len_batch = _mm512_set1_epi64(len);
452 __m512i mul = _mm512_mullo_epi64_hand(factor_len_batch, factor_2_batch);
453 mul = _mm512_add_epi64(mul, k2_batch);
454 __m512i a = Fetch64Batch(data, 0);
455 a = _mm512_mullo_epi64_hand(a, k2_batch);
456 __m512i b = Fetch64Batch(data, 8);
457 __m512i c = Fetch64Batch(data, len-8);
458 c = _mm512_mullo_epi64_hand(c, mul);
459 __m512i d = Fetch64Batch(data, len-16);
460 d = _mm512_mullo_epi64_hand(d, k2_batch);
461 __m512i r1 = Rotate64Batch(_mm512_add_epi64(a, b), 43);
462 __m512i r2 = Rotate64Batch(c, 30);
463 __m512i y = _mm512_add_epi64(r1, r2);
464 y = _mm512_add_epi64(y, d);
465 r2 = Rotate64Batch(_mm512_add_epi64(b, k2_batch), 18);
466 r2 = _mm512_add_epi64(r2, a);
467 r2 = _mm512_add_epi64(r2, c);
468 __m512i z = HashLen16Batch(y, r2, mul);
469 __m512i e = Fetch64Batch(data, 16);
470 e = _mm512_mullo_epi64_hand(e, mul);
471 __m512i f = Fetch64Batch(data, 24);
472 __m512i g = Fetch64Batch(data, len - 32);
473 g = _mm512_add_epi64(g, y);
474 g = _mm512_mullo_epi64_hand(g, mul);
475 __m512i h = Fetch64Batch(data, len - 24);
476 h = _mm512_add_epi64(h, z);
477 h = _mm512_mullo_epi64_hand(h, mul);
478
479 r1 = Rotate64Batch(_mm512_add_epi64(e, f), 43);
480 r2 = Rotate64Batch(g, 30);
481 r1 = _mm512_add_epi64(r1, r2);
482 r1 = _mm512_add_epi64(r1, h);
483 r2 = Rotate64Batch(_mm512_add_epi64(f, a), 18);
484 r2 = _mm512_add_epi64(r2, e);
485 r2 = _mm512_add_epi64(r2, g);
486
487 __m512i ret = HashLen16Batch(r1, r2, mul);
488 _mm512_storeu_si512((void*)h_out, ret);
489}
490
491inline void Hash64AVX_512_Impl(const char*& data, size_t& n, uint64& h,
492 const uint64& m, const int& r) {

Callers 1

Hash64Farm_Batch512Function · 0.85

Calls 4

_mm512_mullo_epi64_handFunction · 0.85
Fetch64BatchFunction · 0.85
Rotate64BatchFunction · 0.85
HashLen16BatchFunction · 0.85

Tested by

no test coverage detected