Received: from eggs.gnu.org ([208.118.235.92]:48037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLbo4-0001pt-Tp for qemu-devel@nongnu.org; Tue, 09 Oct 2012 11:34:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLbmZ-0007uu-6J for qemu-devel@nongnu.org; Tue, 09 Oct 2012 11:33:16 -0400 Received: from hall.aurel32.net ([88.191.126.93]:59334) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLbmX-0007rn-SZ for qemu-devel@nongnu.org; Tue, 09 Oct 2012 11:31:42 -0400 Date: Tue, 9 Oct 2012 17:31:39 +0200 From: Aurelien Jarno Message-ID: <20121009153139.GB9230@hall.aurel32.net> References: <1349202750-16815-1-git-send-email-rth@twiddle.net> <1349202750-16815-2-git-send-email-rth@twiddle.net> <20121009151357.GB14078@ohm.aurel32.net> <5074416F.5010708@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <5074416F.5010708@twiddle.net> Sender: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 01/10] tcg: Split out swap_commutative as a subroutine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org On Tue, Oct 09, 2012 at 08:23:27AM -0700, Richard Henderson wrote: > On 10/09/2012 08:13 AM, Aurelien Jarno wrote: > >> > It also prefers > >> > > >> > add r, r, c > >> > over > >> > add r, c, r > >> > > >> > when both inputs are known constants. This doesn't matter for true add, as > >> > we will fully constant fold that. But it matters for a follow-on patch using > >> > this routine for add2 which may not be fully foldable. > ... > > Does this sum += and -= actually generates better code than the previous > > one? It's not something obvious to read (fortunately there is the > > comment for helping), so if it doesn't bring any optimization, it's > > better to keep the previous form. > > Yes. See the comment within the log above. I am not talking about the code generated by TCG, but rather by the code generated by GCC. Does using sum += and sum -= brings a gain to compare to the equivalent if function? -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net