This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Add crc32 function to libiberty
- From: rridge at csclub dot uwaterloo dot ca (Ross Ridge)
- To: gcc at gcc dot gnu dot org
- Date: Fri, 24 Jul 2009 22:39:19 -0400 (EDT)
- Subject: Re: Add crc32 function to libiberty
DJ Delorie writes:
>I didn't reference the web site for the polynomial, just for background.
>To be honest, I'm not sure what the polynomial is. As the comments
>explain, the algorithm I used is precisely taken from gdb, in remote.c,
>and is intended to produce the same result. Does anybody on the gdb
>side know the polynomial or any other information?
Your code uses the (one and only) CRC-32 polynomial 0x04c11db7, so just
describing it as the "CRC-32" function should be sufficient documentation.
It's the same CRC function as used by PKZIP, Ethernet, and chksum.
It's not compatible with the Intel CRC32 instruction which uses the
CRC-32C polynomial (0x1EDC6F41).
Ross Ridge