From owner-svn-src-head@FreeBSD.ORG Tue Jan 10 19:16:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83B34106566B for ; Tue, 10 Jan 2012 19:16:28 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm8.bullet.mail.sp2.yahoo.com (nm8.bullet.mail.sp2.yahoo.com [98.139.91.78]) by mx1.freebsd.org (Postfix) with SMTP id 5B0A08FC15 for ; Tue, 10 Jan 2012 19:16:28 +0000 (UTC) Received: from [98.139.91.68] by nm8.bullet.mail.sp2.yahoo.com with NNFMP; 10 Jan 2012 19:16:28 -0000 Received: from [98.139.91.49] by tm8.bullet.mail.sp2.yahoo.com with NNFMP; 10 Jan 2012 19:16:28 -0000 Received: from [127.0.0.1] by omp1049.mail.sp2.yahoo.com with NNFMP; 10 Jan 2012 19:16:28 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 145073.45919.bm@omp1049.mail.sp2.yahoo.com Received: (qmail 9514 invoked by uid 60001); 10 Jan 2012 19:16:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1326222987; bh=OlDuVB4DVqxxYHVxFww5fQ922pS/zwF5N+jdEOYNW/E=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=MC+tfDEuVRDCsSauUo4jVBfuaOCLA0JigfllRleMVmsMFOGEEXFUcFotl0CPbbTSOxcglGB29LUjjW+MDHQZ6fDFC15nI0JykawCENPwEE3jSWynQpRmhr7LO/37GWLs7dadozOt8TEpAYEsux/ayGIdHKyp089MxH7c0Dchsqw= X-YMail-OSG: tvKQl7kVM1n3eoAFMcfUszNy8yim9lVUuLGUBCB287cuP6x t7tZuNJJOTpOxizSJcOX1o1YkaidcPv80WN4iHPtfQcGSbxPf8yIYhph9ZKr njb0w17HR2ilgIhfX40sU2mMw8_t8PPK4zug280xY_NiNmPyMMVg8AVeo72o bDeExCXCc0PIpIC3GM_f1T_toQ1dx9ViEFgR8AmJDSS5z5k_p1d1Q8q4D7yo bj7_z8D7_u9.FhvUfpyWzp5X2hDgZLF8feKl1ft.c3vMEJHuESbOl0RctU0T ak4dnMRrwpnb9c_1JEvVCjwtEOZvDbg1__zV4JTE001QDbK9Bua.9Njn2yls wAlg9.zWGSakq7L.emyOIYd7V_qqgjwLndVUZeEiFIrv3AnYeY7UOFISyKzA zO6pc0vSNCadvD8Ig52UrbblWHwZDp4kqR5w0C_8YFN_dp4MbbDqZP3FqMfT ox4db0bJgfYTmWFHOgopF9xI7Qw-- Received: from [200.118.157.7] by web113516.mail.gq1.yahoo.com via HTTP; Tue, 10 Jan 2012 11:16:27 PST X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.4 YahooMailWebService/0.8.115.331698 Message-ID: <1326222987.8062.YahooMailClassic@web113516.mail.gq1.yahoo.com> Date: Tue, 10 Jan 2012 11:16:27 -0800 (PST) From: Pedro Giffuni To: Eitan Adler , John-Mark Gurney In-Reply-To: <20120110180703.GF52468@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r229415 - head/lib/libvgl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 19:16:28 -0000 =0A=0A--- Mar 10/1/12, John-Mark Gurney ha scritto:=0A= =0A> Eitan Adler wrote this message on=0A> Mon, Jan 09, 2012 at 23:48 -0500= :=0A> > On Mon, Jan 9, 2012 at 11:02 PM, John-Mark Gurney=0A> =0A> wrote:=0A> > > Last time I did benchmarking on this ~10 years=0A>= > > ago, it was slower to use xor instead of=0A> > > using assignments...= =0A> > =0A> > I'd be shocked if the compiler didn't optimize this=0A> > awa= y to an XCHG.=0A> =0A> As someone else mentioned, it did...=A0 But it's sti= ll=0A> an obfuscation of the code...=A0 =0A> Not everyone knows this "trick= " to swap two vars...=0A> If it isn't timing critical, it's better to be=0A= > maintainable...=0A>=0A=0AThe code was taken from a book and it's pretty m= uch=0Aubiquitous as-is. If not everyone knows this "trick",=0Athen I guess = it simply proves that there is a lot of=0Avalue in reading books after all = ;-).=0A=0Acheers,=0A=0APedro.=0A