ATLAS Offline Software
Loading...
Searching...
No Matches
CxxUtils::CRCTable Class Reference

Precomputed tables and constants for the CRC calculation. More...

Collaboration diagram for CxxUtils::CRCTable:

Public Member Functions

 CRCTable (uint64_t p, uint64_t initial=0xffffffffffffffff)
 Initialize the CRC tables and constants.

Public Attributes

uint64_t m_initial
 Initial CRC value.
uint64_t m_table [256]
 Lookup table for bytewise CRC calculation.

Detailed Description

Precomputed tables and constants for the CRC calculation.

Definition at line 464 of file crc64.cxx.

Constructor & Destructor Documentation

◆ CRCTable()

CxxUtils::CRCTable::CRCTable ( uint64_t p,
uint64_t initial = 0xffffffffffffffff )

Initialize the CRC tables and constants.

Parameters
pPolynomial for the CRC. A 1 in the 2^64 bit is implied.

Definition at line 495 of file crc64.cxx.

496{
498
499 uint64_t prev = bit_reflect (p);
500 for (int i = 0; i < 256; i++)
501 {
502 uint64_t r = i;
503 for (int j = 0; j < 8; j++)
504 {
505 if (r & 1)
506 r = (r >> 1) ^ prev;
507 else
508 r >>= 1;
509 }
510 m_table[i] = r;
511 }
512
513#if ATH_CRC64_VEC
514 const uint64_t k1 = bit_reflect (exp_mod (128+64, p)) << 1;
515 const uint64_t k2 = bit_reflect (exp_mod (128, p)) << 1;
516 const uint64_t mu = (bit_reflect (exp129_div (p)) << 1) | 1;
517 const uint64_t prev65 = (bit_reflect (p) << 1) | 1;
518 v2du a = {k1, k2};
519 m_fold_constants = reinterpret_cast<v2di>(a);
520 v2du b = { mu, prev65 };
521 m_barrett_constants = reinterpret_cast<v2di>(b);
522#endif
523}
static Double_t a
uint64_t m_initial
Initial CRC value.
Definition crc64.cxx:475
uint64_t m_table[256]
Lookup table for bytewise CRC calculation.
Definition crc64.cxx:478
int r
Definition globals.cxx:22
@ initial
this is just the initial step we do, nothing really happens here
Definition ManagerStep.h:45

Member Data Documentation

◆ m_initial

uint64_t CxxUtils::CRCTable::m_initial

Initial CRC value.

Definition at line 475 of file crc64.cxx.

◆ m_table

uint64_t CxxUtils::CRCTable::m_table[256]

Lookup table for bytewise CRC calculation.

Definition at line 478 of file crc64.cxx.


The documentation for this class was generated from the following file: