This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/4] Add an abstract incremental hash data type
- From: Andi Kleen <andi at firstfloor dot org>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Andi Kleen <ak at linux dot intel dot com>, Trevor Saunders <tsaunders at mozilla dot com>, Andi Kleen <andi at firstfloor dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 23 Jul 2014 21:34:39 +0200
- Subject: Re: [PATCH 1/4] Add an abstract incremental hash data type
- Authentication-results: sourceware.org; auth=none
- References: <1405488709-12677-1-git-send-email-andi at firstfloor dot org> <1405488709-12677-2-git-send-email-andi at firstfloor dot org> <20140717024053 dot GA23343 at tsaunders-iceball dot corp dot tor1 dot mozilla dot com> <20140717043631 dot GD18735 at two dot firstfloor dot org> <20140718010852 dot GA8100 at tsaunders-iceball dot corp dot tor1 dot mozilla dot com> <CAFiYyc2-tD3DLb9VMYBWdQQhYb9Gjzsc1EwaDgy1eKA-Q8droQ at mail dot gmail dot com> <20140723142743 dot GV5803 at tassilo dot jf dot intel dot com> <8befa2d1-80d9-4a12-a09a-410e6624a775 at email dot android dot com>
> So there will be at most one hash implementation?
One per binary I expect. Modern hash functions are pretty good,
so it's unlikely that someone needs to come up with special
purpose hashes.
I found Bob Jenkins' spooky is rather good for this case (very
large incremential keys), but it is only efficient on 64bit hosts.
So it would need a fallback (like mumurhash2a or the existing one) on 32bit.
Another alternative would be to use CityHash, but that also has multiple
variants, including some machine specific ones (e.g. use the CRC
instructions on SSE2 hosts)
> Maybe use a namespace instead of a hash then?
I don't understand the suggestion.
> So other places can extend it?
Not sure that is needed.
> Why didn't you replace the tree.c uses BTW?
Patches were already quite big, but I'll add it.
-Andi