This is the mail archive of the
mailing list for the elfutils project.
Re: [PATCH 1/3] Add an inlined fast path for __libdw_form_val_len
- From: Josh Stone <jistone at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Thu, 12 Dec 2013 11:06:06 -0800
- Subject: Re: [PATCH 1/3] Add an inlined fast path for __libdw_form_val_len
On 12/12/2013 02:47 AM, Petr Machata wrote:
> Josh Stone <firstname.lastname@example.org> writes:
>> + /* Note that form_lengths[flag_present] is 0, like every other absent index.
>> + * But since flag_present's length truly is 0, check for it explicitly. */
>> + if (form == DW_FORM_flag_present)
>> + return 0;
> One way to get rid of this if would be to store X | 0x80 in the table
> (including 0 | 0x80 for DW_FORM_flag_present), and then return
> len ^ 0x80 later. I don't feel strongly about this though, and
> certainly not if it offsets the performance gains again ;)
That's a good idea, though I'd probably use len & 0x7f so the others
don't need to have 0x80. I'll play with it.
>> + /* Return immediately for forms with fixed lengths. */
>> + if (form < sizeof(form_lengths) / sizeof(form_lengths))
> Space after sizeof
The spaces in all of these will be the end of me... ;)