This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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 <jistone@redhat.com> 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[0]))
> 
> Space after sizeof

The spaces in all of these will be the end of me... ;)

Thanks,
Josh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]