lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [lwip-devel] [task #6827] etharp could need some tuning


From: Goldschmidt Simon
Subject: RE: [lwip-devel] [task #6827] etharp could need some tuning
Date: Tue, 19 Jun 2007 20:34:20 +0200

>>
>> Follow-up Comment #39, task #6827 (project lwip):
>> [...]
>>
>> Making your loops have a comparison against 0 does count as one of
the
more
>> obscure optimisations you can do though, I agree.
>
> That may be true for some architectures or compilers. But the loop in

And it doesn't, for mine. On NIOS-II, a comparison is always register
against register. Comparison against 0 is a comparison against r0 (which
is bound to be 0). You have to have one register more, but I though
maybe the compiler can optimize the for-loop better than the while
(because the k-- is inside the body and not tight to the keyword like
with for, is that right or not?).

> question copies data 'backwards', i.e. accesses memory from higher to
> lower addresses. That could level out the optimisation gained by
> tweaking the loop abort criteria on some other architectures.

That might also be. Anyway, I don't think it's that important anyway,
just thought it's a strange way to do it (not the comparison against 0
but using while instead of for when you know the size).


Simon


reply via email to

[Prev in Thread] Current Thread [Next in Thread]