From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19641 invoked by alias); 25 Jul 2009 20:11:28 -0000 Received: (qmail 19624 invoked by uid 22791); 25 Jul 2009 20:11:27 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SARE_MILLIONSOF X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 25 Jul 2009 20:11:21 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 9067713037; Sat, 25 Jul 2009 13:11:19 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost3.vmware.com (Postfix) with ESMTP id 86604CDA47; Sat, 25 Jul 2009 13:11:19 -0700 (PDT) Message-ID: <4A6B6551.3050105@vmware.com> Date: Sat, 25 Jul 2009 20:51:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Michael Snyder CC: Eli Zaretskii , Ian Lance Taylor , Jim Blandy , "dj@redhat.com" , "gcc-patches@gcc.gnu.org" , "gdb-patches@sourceware.org" Subject: Re: Add crc32 function to libiberty References: <200907242331.n6ONVqSl003646@greed.delorie.com> <83fxcl4491.fsf@gnu.org> <4A6B5BDD.80602@vmware.com> In-Reply-To: <4A6B5BDD.80602@vmware.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00627.txt.bz2 Michael Snyder wrote: > Eli Zaretskii wrote: >>> Cc: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org >>> From: Ian Lance Taylor >>> Date: Fri, 24 Jul 2009 17:40:09 -0700 >>> >>> Does anybody on the gdb side know the polynomial or any other >>> information? >> AFAICS, this was introduced by Jim Blandy. Jim, are can you help us >> here? > > There may be some confusion here. At least I'm confused. > > Jim added gnu_debuglink_crc32() to utils.c in 2003 (to be used > by symfile.c), but I added static ulong crc32() to remote.c some > time around 1997-1998 (argh, there's no changelog entry) while > working on tracepoints. > > Ian's new function bears a closer resemblance to the one in > remote.c than to the one in utils.c, other than the fact that > it uses a pre-computed table. I'm not familiar with Jim's > version, and don't know whether they compute the same result. > > I'm not seeking credit here -- in fact, I'd prefer to avoid it, > since I frankly don't remember where I came up with the algorithm. > ;-( > > Michael OK, google gives millions of hits for the crc const 0x04c11db7 used by Ian's and my (remote.c) algorithm. I can't find my way to an original source, but apparently the algorithm was published as a part if IEEE 802.3 (ethernet), and is in very wide use (mpeg, png, v.42, posix cksum...) If you want to know the actual polynomial, this MIGHT be it (I guarantee nothing): x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1 Happy googling!