ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
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. More...
 

Public Attributes

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

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 {
497  m_initial = initial;
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 }

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:
beamspotman.r
def r
Definition: beamspotman.py:676
CxxUtils::CRCTable::m_table
uint64_t m_table[256]
Lookup table for bytewise CRC calculation.
Definition: crc64.cxx:478
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::Detail::ManagerStep::initial
@ initial
this is just the initial step we do, nothing really happens here
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
a
TList * a
Definition: liststreamerinfos.cxx:10
CxxUtils::CRCTable::m_initial
uint64_t m_initial
Initial CRC value.
Definition: crc64.cxx:475
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53