|
|
Message-Id: <DG598YG0L51V.5L30MM7MKUU1@tum.de>
Date: Tue, 03 Feb 2026 11:29:36 +0100
From: "Fabian Rast" <fabian.rast@....de>
To: "Fangrui Song" <i@...kray.me>
Cc: <musl@...ts.openwall.com>
Subject: Re: [PATCH v2] ldso: skip gnu hash calculation if
precomputed
On Tue Feb 3, 2026 at 8:17 AM CET, Fangrui Song wrote:
> Can the gh condition to optimized to
>
> gh = !i1 || (i0 < i1 ? sym_index < i1 : sym_index >= i0) ? h0 : h1;
Yes, the only difference is for `i0 == i1` which should not
occur for any valid hash table.
gcc generates better code for your version: https://godbolt.org/z/zTsbqPn5a
As I understand, the main problem was the 2 divides or 1 divide + 1 branch
required to compute i0 and i1 in the first place.
Thanks,
Fabian Rast
Download attachment "signature.asc" of type "application/pgp-signature" (294 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.