]> sourceware.org Git - glibc.git/commitdiff
Optimize generic ELF hash function a bit more
authorUlrich Drepper <drepper@gmail.com>
Sat, 10 Dec 2011 16:53:44 +0000 (11:53 -0500)
committerUlrich Drepper <drepper@gmail.com>
Sat, 10 Dec 2011 16:53:44 +0000 (11:53 -0500)
ChangeLog
sysdeps/generic/dl-hash.h

index 73e9911d8593bfb1aecfa893deadc77f384d6b44..93adebd3890497ca8479cb32a331ff36518f16ad 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-10  Ulrich Drepper  <drepper@gmail.com>
+
+       * sysdeps/generic/dl-hash.h (_dl_elf_hash): Lift one operation out of
+       the inner loop.
+
 2011-12-06  Andreas Schwab  <schwab@linux-m68k.org>
 
        [BZ #13472]
index 28312ca1c48aca8628ebf8d7314b4881a0d09423..e0db00edc3b11072e80a47b7e0df28097b226373 100644 (file)
@@ -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;
                }
            }
        }
This page took 0.047572 seconds and 5 git commands to generate.