From f039c043071f2f55943d052fa7d4ad5f1a67db09 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 10 Dec 2011 11:53:44 -0500 Subject: Optimize generic ELF hash function a bit more --- sysdeps/generic/dl-hash.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sysdeps/generic/dl-hash.h') diff --git a/sysdeps/generic/dl-hash.h b/sysdeps/generic/dl-hash.h index 28312ca1c4..e0db00edc3 100644 --- a/sysdeps/generic/dl-hash.h +++ b/sysdeps/generic/dl-hash.h @@ -60,9 +60,12 @@ _dl_elf_hash (const char *name_arg) But the following is equivalent and a lot faster, especially on modern processors. */ - hash ^= hi; hash ^= hi >> 24; } + + /* Second part of the modified formula. This + operation can be lifted outside the loop. */ + hash &= 0x0fffffff; } } } -- cgit 1.4.1