Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JvSuV-0008Hf-Rp for qemu-devel@nongnu.org; Mon, 12 May 2008 03:57:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JvSuV-0008HT-CI for qemu-devel@nongnu.org; Mon, 12 May 2008 03:57:27 -0400 Received: from [199.232.76.173] (port=34039 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvSuV-0008HQ-9R for qemu-devel@nongnu.org; Mon, 12 May 2008 03:57:27 -0400 Received: from savannah.gnu.org ([199.232.41.3]:37212 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 1JvSuU-0000bh-IU for qemu-devel@nongnu.org; Mon, 12 May 2008 03:57:26 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1JvSuS-0004am-W1 for qemu-devel@nongnu.org; Mon, 12 May 2008 07:57:25 +0000 Received: from edgar_igl by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1JvSuS-0004ah-Br for qemu-devel@nongnu.org; Mon, 12 May 2008 07:57:24 +0000 MIME-Version: 1.0 Errors-To: edgar_igl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: "Edgar E. Iglesias" Message-Id: Date: Mon, 12 May 2008 07:57:24 +0000 Subject: [Qemu-devel] [4433] CRIS: Remove some old dyngen T0/T1 fiddle. 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: 4433 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4433 Author: edgar_igl Date: 2008-05-12 07:57:23 +0000 (Mon, 12 May 2008) Log Message: ----------- CRIS: Remove some old dyngen T0/T1 fiddle. More usage of the results from the x flag liveness analysis. Modified Paths: -------------- trunk/target-cris/translate.c Modified: trunk/target-cris/translate.c =================================================================== --- trunk/target-cris/translate.c 2008-05-12 07:44:23 UTC (rev 4432) +++ trunk/target-cris/translate.c 2008-05-12 07:57:23 UTC (rev 4433) @@ -483,24 +483,36 @@ tcg_gen_discard_tl(c); } -static inline void t_gen_subx_carry(TCGv d) +static inline void t_gen_subx_carry(DisasContext *dc, TCGv d) { - TCGv x, c; + if (dc->flagx_live) { + TCGv x, c; - x = tcg_temp_new(TCG_TYPE_TL); - c = tcg_temp_new(TCG_TYPE_TL); - t_gen_mov_TN_preg(x, PR_CCS); - tcg_gen_mov_tl(c, x); + x = tcg_temp_new(TCG_TYPE_TL); + c = tcg_temp_new(TCG_TYPE_TL); + t_gen_mov_TN_preg(x, PR_CCS); + tcg_gen_mov_tl(c, x); - /* Propagate carry into d if X is set. Branch free. */ - tcg_gen_andi_tl(c, c, C_FLAG); - tcg_gen_andi_tl(x, x, X_FLAG); - tcg_gen_shri_tl(x, x, 4); + /* Propagate carry into d if X is set. Branch free. */ + tcg_gen_andi_tl(c, c, C_FLAG); + tcg_gen_andi_tl(x, x, X_FLAG); + tcg_gen_shri_tl(x, x, 4); - tcg_gen_and_tl(x, x, c); - tcg_gen_sub_tl(d, d, x); - tcg_gen_discard_tl(x); - tcg_gen_discard_tl(c); + tcg_gen_and_tl(x, x, c); + tcg_gen_sub_tl(d, d, x); + tcg_gen_discard_tl(x); + tcg_gen_discard_tl(c); + } else { + if (dc->flags_x) { + TCGv c; + + c = tcg_temp_new(TCG_TYPE_TL); + /* C flag is already at bit 0. */ + tcg_gen_andi_tl(c, c, C_FLAG); + tcg_gen_add_tl(d, d, c); + tcg_gen_discard_tl(c); + } + } } /* Swap the two bytes within each half word of the s operand. @@ -633,7 +645,7 @@ { if (!dc->flagx_live || (dc->flagx_live && dc->flags_x) - || dc->cc_op != CC_OP_FLAGS) + || dc->cc_op == CC_OP_FLAGS) tcg_gen_andi_i32(cpu_PR[PR_CCS], cpu_PR[PR_CCS], ~X_FLAG); dc->flagx_live = 1; dc->flags_x = 0; @@ -760,7 +772,7 @@ tcg_gen_xori_tl(cpu_T[1], cpu_T[1], -1); /* Extended arithmetics. */ - t_gen_subx_carry(cpu_T[0]); + t_gen_subx_carry(dc, cpu_T[0]); break; case CC_OP_MOVE: tcg_gen_mov_tl(cpu_T[0], cpu_T[1]); @@ -786,7 +798,7 @@ case CC_OP_NEG: tcg_gen_neg_tl(cpu_T[0], cpu_T[1]); /* Extended arithmetics. */ - t_gen_subx_carry(cpu_T[0]); + t_gen_subx_carry(dc, cpu_T[0]); break; case CC_OP_LZ: t_gen_lz_i32(cpu_T[0], cpu_T[1]); @@ -827,15 +839,12 @@ } break; case CC_OP_CMP: - tcg_gen_neg_tl(cpu_T[1], cpu_T[1]); - tcg_gen_add_tl(cpu_T[0], cpu_T[0], cpu_T[1]); + tcg_gen_sub_tl(cpu_T[0], cpu_T[0], cpu_T[1]); /* CRIS flag evaluation needs ~src. */ - tcg_gen_neg_tl(cpu_T[1], cpu_T[1]); - /* CRIS flag evaluation needs ~src. */ - tcg_gen_xori_tl(cpu_T[1], cpu_T[1], -1); + tcg_gen_xori_tl(cpu_T[1], cpu_T[1], ~0); /* Extended arithmetics. */ - t_gen_subx_carry(cpu_T[0]); + t_gen_subx_carry(dc, cpu_T[0]); writeback = 0; break; default: @@ -855,17 +864,13 @@ /* Writeback. */ if (writeback) { if (size == 4) - t_gen_mov_reg_TN(rd, cpu_T[0]); + tcg_gen_mov_tl(cpu_R[rd], cpu_T[0]); else { - tcg_gen_mov_tl(cpu_T[1], cpu_T[0]); - t_gen_mov_TN_reg(cpu_T[0], rd); if (size == 1) - tcg_gen_andi_tl(cpu_T[0], cpu_T[0], ~0xff); + tcg_gen_andi_tl(cpu_R[rd], cpu_R[rd], ~0xff); else - tcg_gen_andi_tl(cpu_T[0], cpu_T[0], ~0xffff); - tcg_gen_or_tl(cpu_T[0], cpu_T[0], cpu_T[1]); - t_gen_mov_reg_TN(rd, cpu_T[0]); - tcg_gen_mov_tl(cpu_T[0], cpu_T[1]); + tcg_gen_andi_tl(cpu_R[rd], cpu_R[rd], ~0xffff); + tcg_gen_or_tl(cpu_R[rd], cpu_R[rd], cpu_T[0]); } } if (dc->update_cc) @@ -1208,7 +1213,6 @@ tcg_gen_addi_tl(cpu_R[dc->op1], cpu_R[dc->op1], size); } - static void dec_prep_move_r(DisasContext *dc, int rs, int rd, int size, int s_ext) { @@ -1352,7 +1356,7 @@ imm = sign_extend(dc->op1, 5); DIS(fprintf (logfile, "moveq %d, $r%u\n", imm, dc->op2)); - t_gen_mov_reg_TN(dc->op2, tcg_const_tl(imm)); + tcg_gen_mov_tl(cpu_R[dc->op2], tcg_const_tl(imm)); return 2; } static unsigned int dec_subq(DisasContext *dc) @@ -1363,7 +1367,7 @@ cris_cc_mask(dc, CC_MASK_NZVC); /* Fetch register operand, */ - t_gen_mov_TN_reg(cpu_T[0], dc->op2); + tcg_gen_mov_tl(cpu_T[0], cpu_R[dc->op2]); tcg_gen_movi_tl(cpu_T[1], dc->op1); crisv32_alu_op(dc, CC_OP_SUB, dc->op2, 4); return 2;