From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDfl6-0004hE-Lm for qemu-devel@nongnu.org; Mon, 17 Sep 2012 14:09:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TDfl5-0001Oy-E8 for qemu-devel@nongnu.org; Mon, 17 Sep 2012 14:09:24 -0400 Received: from hall.aurel32.net ([88.191.126.93]:33779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDfl5-0001OX-5f for qemu-devel@nongnu.org; Mon, 17 Sep 2012 14:09:23 -0400 Date: Mon, 17 Sep 2012 20:09:17 +0200 From: Aurelien Jarno Message-ID: <20120917180917.GC3880@ohm.aurel32.net> References: <1347836915-14091-1-git-send-email-aurelien@aurel32.net> <1347836915-14091-4-git-send-email-aurelien@aurel32.net> <5057437F.9010503@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <5057437F.9010503@twiddle.net> Subject: Re: [Qemu-devel] [PATCH 3/5] target-arm: convert shl and shr helpers to TCG List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Peter Maydell , qemu-devel@nongnu.org On Mon, Sep 17, 2012 at 08:36:31AM -0700, Richard Henderson wrote: > On 09/16/2012 04:08 PM, Aurelien Jarno wrote: > > + tcg_gen_setcondi_i32(TCG_COND_GE, tmp2, tmp1, 32); \ > > + tcg_gen_andi_i32(tmp1, tmp1, 0x1f); \ > > + tcg_gen_##name##_i32(dest, t0, tmp1); \ > > + tcg_temp_free_i32(tmp1); \ > > + tcg_gen_subi_i32(tmp2, tmp2, 1); \ > > + tcg_gen_and_i32(dest, dest, tmp2); \ > > Ought I revive my movcond patch? > > Surely you can agree it's much more natural to write this > as a conditional move of zero than playing masking games. > I agree it's more natural, that said in that case it doesn't spare that many instructions, and I am still not sure we want to introduce such a TCG op. What is important is to avoid helpers and branches which are really killing the performances. If you insist, maybe we can just add a movcond op that uses setcond, so it makes the code more readable? We introduced setcond a lot of time ago, and there are still plenty of places where it's not used. We can get higher performances already by fixing that. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net