From 6e33fad374814f1a4bf80aa37d4ded9c9096edab Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 14 Apr 1995 01:13:53 +0000 Subject: Thu Apr 13 09:45:01 1995 Roland McGrath * elf/libelf.h (elf_hash): Use XOR instead of ANDN when the bits being cleared are already known to be set. Thanks Ulrich. --- elf/libelf.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'elf/libelf.h') diff --git a/elf/libelf.h b/elf/libelf.h index e95dd93..b6575b9 100644 --- a/elf/libelf.h +++ b/elf/libelf.h @@ -220,8 +220,12 @@ elf_hash (__const char *__name) __hash = (__hash << 4) + *__name++; __hi = __hash & 0xf0000000; if (__hi != 0) - __hash ^= __hi >> 24; - __hash &= ~__hi; + { + __hash ^= __hi >> 24; + /* The ELF ABI says `hash &= ~hi', but this is equivalent + in this case and on some machines one insn instead of two. */ + __hash ^= __hi; + } } return __hash; } -- cgit v1.1