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 2/3] Simplify and inline get_uleb128 and get_sleb128


Josh Stone <jistone@redhat.com> writes:

> On 12/12/2013 04:13 AM, Petr Machata wrote:
>> Josh Stone <jistone@redhat.com> writes:
>>> +static inline uint64_t
>>> +__libdw_get_uleb128 (const unsigned char **addrp)
>>> +{
>>> +  uint64_t acc = 0;
>>> +  get_uleb128_step (acc, *addrp, 0);
>>> +  for (unsigned int i = 1; i < len_leb128(acc); ++i)
>>> +    get_uleb128_step (acc, *addrp, i);
>> 
>> Is there a reason not to use for (i = 0; ...) instead of the pre-step
>> followed by a for (i = 1; ...)?
>
> Ah, yes, I should explain that a little.  I found that the code was
> actually faster with the first step unrolled.

Ah, I think that's fine then, but needs a comment.

Thanks,
PM

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