mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-05 19:35:52 +03:00
Optimize generic ELF hash function a bit more
This commit is contained in:
@@ -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>
|
2011-12-06 Andreas Schwab <schwab@linux-m68k.org>
|
||||||
|
|
||||||
[BZ #13472]
|
[BZ #13472]
|
||||||
|
@@ -60,9 +60,12 @@ _dl_elf_hash (const char *name_arg)
|
|||||||
But the following is equivalent and a lot
|
But the following is equivalent and a lot
|
||||||
faster, especially on modern processors. */
|
faster, especially on modern processors. */
|
||||||
|
|
||||||
hash ^= hi;
|
|
||||||
hash ^= hi >> 24;
|
hash ^= hi >> 24;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Second part of the modified formula. This
|
||||||
|
operation can be lifted outside the loop. */
|
||||||
|
hash &= 0x0fffffff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user