On 05/25/2016 03:06 AM, Erik Faye-Lund wrote: > On Tue, May 24, 2016 at 8:42 AM, <mathias.froehl...@gmx.net> wrote: >> From: Mathias Fröhlich <mathias.froehl...@web.de> >> >> Replaces a loop that iterates all lights and test >> which of them is enabled by a loop only iterating over >> the bits set in the enabled bitmask. > > This takes the code from something very obvious and easy to follow to > something you'll have to think twice about the correctness of... > > Since MAX_LIGHTS is 8, this seems a bit like a premature optimization > to me. Does this patch yield any measurable improvement in speed in > any real-world applications?
Right... because now the compiler will likely not unroll the loop. I'd be curious to compare the before / after code. My guess is that it doesn't make much difference either way. > _______________________________________________ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev