From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGwr6-00075v-2V for qemu-devel@nongnu.org; Wed, 26 Sep 2012 15:01:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGwr5-0000Pj-3z for qemu-devel@nongnu.org; Wed, 26 Sep 2012 15:01:08 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:65426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGwr4-0000PT-U0 for qemu-devel@nongnu.org; Wed, 26 Sep 2012 15:01:07 -0400 Received: by pbbrp2 with SMTP id rp2so2354348pbb.4 for ; Wed, 26 Sep 2012 12:01:05 -0700 (PDT) Sender: Richard Henderson Message-ID: <506350EF.8010508@twiddle.net> Date: Wed, 26 Sep 2012 12:01:03 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1348685335-16770-1-git-send-email-peter.maydell@linaro.org> <1348685335-16770-2-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1348685335-16770-2-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] tcg/arm: Factor out code to emit immediate or reg-reg op List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, Aurelien Jarno , patches@linaro.org On 09/26/2012 11:48 AM, Peter Maydell wrote: > case INDEX_op_setcond_i32: > - if (const_args[2]) { > - int rot; > - rot = encode_imm(args[2]); > - tcg_out_dat_imm(s, COND_AL, ARITH_CMP, 0, > - args[1], rotl(args[2], rot) | (rot << 7)); > - } else { > - tcg_out_dat_reg(s, COND_AL, ARITH_CMP, 0, > - args[1], args[2], SHIFT_IMM_LSL(0)); > - } > + tcg_out_dat_rI(s, COND_AL, ARITH_CMP, 0, > + args[1], args[2], const_args[2]); > tcg_out_dat_imm(s, tcg_cond_to_arm_cond[args[3]], > ARITH_MOV, args[0], 0, 1); > tcg_out_dat_imm(s, tcg_cond_to_arm_cond[tcg_invert_cond(args[3])], The patch itself is fine. But as a followup, if movcc is no longer "free", then perhaps the setcond sequence is better as cmp mov movcc i.e. the second move is unconditional? A register renaming OOO core could then schedule the mov before the cmp. r~