From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LnxBt-00030e-0z for qemu-devel@nongnu.org; Sun, 29 Mar 2009 11:44:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LnxBr-00030L-FS for qemu-devel@nongnu.org; Sun, 29 Mar 2009 11:44:51 -0400 Received: from [199.232.76.173] (port=34588 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LnxBr-00030I-B6 for qemu-devel@nongnu.org; Sun, 29 Mar 2009 11:44:51 -0400 Received: from savannah.gnu.org ([199.232.41.3]:59305 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LnxBr-0003Gy-0e for qemu-devel@nongnu.org; Sun, 29 Mar 2009 11:44:51 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1LnxBq-0006es-KE for qemu-devel@nongnu.org; Sun, 29 Mar 2009 15:44:50 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1LnxBq-0006eo-BQ for qemu-devel@nongnu.org; Sun, 29 Mar 2009 15:44:50 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Sun, 29 Mar 2009 15:44:50 +0000 Subject: [Qemu-devel] [6956] target-mips: optimize gen_movci() Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 6956 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6956 Author: aurel32 Date: 2009-03-29 15:44:50 +0000 (Sun, 29 Mar 2009) Log Message: ----------- target-mips: optimize gen_movci() Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/target-mips/translate.c Modified: trunk/target-mips/translate.c =================================================================== --- trunk/target-mips/translate.c 2009-03-29 15:44:34 UTC (rev 6955) +++ trunk/target-mips/translate.c 2009-03-29 15:44:50 UTC (rev 6956) @@ -5693,29 +5693,31 @@ static void gen_movci (DisasContext *ctx, int rd, int rs, int cc, int tf) { - int l1 = gen_new_label(); - uint32_t ccbit; + int l1; TCGCond cond; - TCGv t0 = tcg_temp_local_new(); - TCGv_i32 r_tmp = tcg_temp_new_i32(); + TCGv_i32 t0; - if (cc) - ccbit = 1 << (24 + cc); - else - ccbit = 1 << 23; + if (rd == 0) { + /* Treat as NOP. */ + return; + } + if (tf) cond = TCG_COND_EQ; else cond = TCG_COND_NE; - gen_load_gpr(t0, rd); - tcg_gen_andi_i32(r_tmp, fpu_fcr31, ccbit); - tcg_gen_brcondi_i32(cond, r_tmp, 0, l1); - tcg_temp_free_i32(r_tmp); - gen_load_gpr(t0, rs); + l1 = gen_new_label(); + t0 = tcg_temp_new_i32(); + tcg_gen_andi_i32(t0, fpu_fcr31, get_fp_bit(cc)); + tcg_gen_brcondi_i32(cond, t0, 0, l1); + if (rs == 0) { + tcg_gen_movi_tl(cpu_gpr[rd], 0); + } else { + tcg_gen_mov_tl(cpu_gpr[rd], cpu_gpr[rs]); + } gen_set_label(l1); - gen_store_gpr(t0, rd); - tcg_temp_free(t0); + tcg_temp_free_i32(t0); } static inline void gen_movcf_s (int fs, int fd, int cc, int tf)