[Mesa-dev] [PATCH v2 28/52] st/nine: Match REP implementation to LOOP

Axel Davy axel.davy at ens.fr
Sun Jan 11 01:12:19 PST 2015


On 10/01/2015 19:33, Ilia Mirkin wrote :
> Is there a "continue" in d3d9? I couldn't find one, but if there is,
> then this change won't work.
no, but you can break early.
That's why the counter decrease is put at the end of the loop,
since it allows better performance if the loop is stopped early.
>
> On Sat, Jan 10, 2015 at 5:42 AM, Axel Davy <axel.davy at ens.fr> wrote:
>> Previous implementation was fine,
>> just instead of having increasing counter,
>> have a decreasing counter.
> Didn't you have some other reason to do this? Why are there all these
> changes which are basically just like "Well, I was debugging some bug,
> made a bunch of changes, but they ended up making no difference. The
> new code has _no_ benefits at all that I can think of, but let's push
> them anyways, since code churn is fun."?
>
> Look, I'm sure there's _some_ sort of reason for this stuff, but you
> just have to explain it in the commit logs.
>
What would you think of:

Fix syntax ( if () { instead of if () endline { ).

Add more comments.

Move the counter update at the end for better performance
when the loop is stopped early by a breakc instruction or similar.

In addition move to a decreasing counter instead
of increasing counter to do the same way than
loop for simplicity and for a potential perf boost since
on some cards it's probably faster to compare
against 0 than compare to a constant.

Axel Davy


More information about the mesa-dev mailing list