universal_crc

universal_crc is a utility for generating optimized ANSI C code for CRC calculation.
Download

universal_crc Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Danjel McGougan
  • Publisher web site:
  • http://mcgougan.se/universal_crc/

universal_crc Tags


universal_crc Description

universal_crc is a utility for generating optimized ANSI C code for CRC calculation. universal_crc is a utility for generating optimized ANSI C code for CRC calculation. It is licensed under the GPL.Compile it using "gcc -O2 -o universal_crc universal_crc.c".Usage: universal_crc < parameters >Parameters: -b < bits > | --bits=< bits > Number of bits in the CRC register, 1-64 is supported Mandatory parameter -p < polynomial > | --poly=< polynomial > CRC polynomial value; Coefficient of x^0 is bit 0 (LSB) of this value Coefficient of x^1 is bit 1 of this value, etc. Coefficient of x^< bits > is implied 1 Bit-reversed automatically if -r is used Mandatory parameter -i < init > | --init=< init > Initial value of the CRC register Not bit-reversed even if -r is used Default 0 if not specified -x < xor > | --xor=< xor > Value that is XORed to the final CRC register value Not bit-reversed even if -r is used Default 0 if not specified -r | --reverse Bit-reverse the CRC register (LSB is shifted out and MSB in) This also means that message bits are processed LSB first Default is not to reverse -n | --non-direct Shift in message bits into the CRC register and augment the message. This is equivalent to the direct method of not augmenting the message and XORing the message bits with the bits shifted out of the CRC register, but the initial CRC register value needs to be converted (if it is non-zero) for compatibility. Default is direct mode. -a < algorithm > | --algorithm=< algorithm > CRC algorithm to use: bit standard bit-at-a-time algorithm (default, smallest cache footprint) tab standard table-driven algorithm (256 table entries) tabi table-driven algorithm, independent lookups (1024 entries) good for superscalar cores inspired by crc32 algorithm in zlib originally by Rodney Brown tabiw table-driven algorithm, independent lookups, word-at-a-time same as tabi but reads 32 bits at a time from memory --crc-type=< type > Use < type > as the unsigned integer type to hold the CRC value --tab-type=< type > Use < type > as the unsigned integer type to hold the CRC table entries --test Generate test codeExample output:universal_crc -b 32 -p 0x04c11db7 -i 0xffffffff -x 0xffffffff -r -a tabiPerformance:Here are some example performance numbers of the generated CRC code when running on an AMD Athlon 64 in 32-bit mode.The CRC code was compiled using gcc 3.4.4 and flags "-O3 -march=athlon64".bits algo cycles/byte---- ---- ----------- 5 bit 34.00 8 bit 33.9713 bit 57.0016 bit 33.0023 bit 58.0032 bit 34.0049 bit 85.0064 bit 86.00 5 tab 6.56 8 tab 6.5613 tab 8.0016 tab 8.0023 tab 7.0032 tab 7.0049 tab 11.0064 tab 11.01 5 tabi 2.19 8 tabi 2.1913 tabi 2.9416 tabi 2.4723 tabi 3.2532 tabi 3.2549 tabi 10.5364 tabi 10.53 5 tabiw 2.01 8 tabiw 2.0113 tabiw 2.3116 tabiw 2.3123 tabiw 2.1032 tabiw 2.1049 tabiw 6.2164 tabiw 6.21


universal_crc Related Software