This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH 2/3] Simplify and inline get_uleb128 and get_sleb128
- From: Petr Machata <pmachata at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Thu, 12 Dec 2013 23:23:11 +0100
- Subject: 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