svn commit: r229415 - head/lib/libvgl

John-Mark Gurney jmg at funkthat.com
Tue Jan 10 18:07:06 UTC 2012


Eitan Adler wrote this message on Mon, Jan 09, 2012 at 23:48 -0500:
> On Mon, Jan 9, 2012 at 11:02 PM, John-Mark Gurney <jmg at funkthat.com> wrote:
> > Last time I did benchmarking on this ~10 years ago, it was slower to
> > use xor instead of using assignments...
> 
> I'd be shocked if the compiler didn't optimize this away to an XCHG.

As someone else mentioned, it did...  But it's still an obfuscation of
the code...  Not everyone knows this "trick" to swap two vars...  If it
isn't timing critical, it's better to be maintainable...

Thanks.

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the svn-src-all mailing list