From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MdhkJ-0004ZZ-GW for qemu-devel@nongnu.org; Wed, 19 Aug 2009 05:46:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MdhkE-0004XG-Bb for qemu-devel@nongnu.org; Wed, 19 Aug 2009 05:46:18 -0400 Received: from [199.232.76.173] (port=33670 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MdhkE-0004X8-1l for qemu-devel@nongnu.org; Wed, 19 Aug 2009 05:46:14 -0400 Received: from mail-bw0-f227.google.com ([209.85.218.227]:49735) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MdhkD-0001Op-Jb for qemu-devel@nongnu.org; Wed, 19 Aug 2009 05:46:13 -0400 Received: by bwz27 with SMTP id 27so3421990bwz.34 for ; Wed, 19 Aug 2009 02:46:12 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20090818161424.GA1435@shareable.org> References: <4A8ACF77.3090801@bandsman.co.uk> <20090818161424.GA1435@shareable.org> Date: Wed, 19 Aug 2009 11:46:11 +0200 Message-ID: <5b31733c0908190246h3385623fid8183b7e8e67500a@mail.gmail.com> Subject: Re: [Qemu-devel] Arm emulation tweak From: Filip Navara Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jamie Lokier Cc: Nigel Horne , qemu-devel@nongnu.org On Tue, Aug 18, 2009 at 6:14 PM, Jamie Lokier wrote: > Nigel Horne wrote: >> This small patch reduces (on my machine) the call to new_tmp by 16 >> bytes, which may not sound much, but it's called so often that it makes >> a nice speed up of Arm emulation: > >> =A0 =A0 =A0if (GET_TCGV_I32(temps[num_temps])) >> =A0 =A0 =A0 =A0return temps[num_temps++]; >> >> ! =A0 =A0 tmp =3D tcg_temp_new_i32(); >> ! =A0 =A0 temps[num_temps++] =3D tmp; >> ! =A0 =A0 return tmp; >> =A0} > > becomes > >> =A0 =A0 =A0if (GET_TCGV_I32(temps[num_temps])) >> =A0 =A0 =A0 =A0return temps[num_temps++]; >> >> ! =A0 =A0 return temps[num_temps++] =3D tcg_temp_new_i32(); >> =A0} > > That's pretty tragic if GCC fails to compile them to identical code, > assuming you had optimisation turned on. > > Have you tried building with -Os, -O2 etc. to see if that makes a > difference? > > Which GCC version are you using? > > -- Jamie > BTW, I have even better optimizations for this code at git://repo.or.cz/qemu/navara.git. These functions are no longer needed in the form as they appear in the source code today, since TCG has evolved. F.