From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K5qRi-0004au-CX for qemu-devel@nongnu.org; Mon, 09 Jun 2008 19:06:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K5qRh-0004Ze-JY for qemu-devel@nongnu.org; Mon, 09 Jun 2008 19:06:37 -0400 Received: from [199.232.76.173] (port=34877 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K5qRh-0004ZF-0F for qemu-devel@nongnu.org; Mon, 09 Jun 2008 19:06:37 -0400 Received: from savannah.gnu.org ([199.232.41.3]:54970 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 1K5qRg-0006xQ-6p for qemu-devel@nongnu.org; Mon, 09 Jun 2008 19:06:36 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1K5qRc-0003Zz-7Q for qemu-devel@nongnu.org; Mon, 09 Jun 2008 23:06:32 +0000 Received: from edgar_igl by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1K5qRb-0003Zv-VB for qemu-devel@nongnu.org; Mon, 09 Jun 2008 23:06:32 +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, 09 Jun 2008 23:06:32 +0000 Subject: [Qemu-devel] [4717] CRIS: Translator updates. 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: 4717 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4717 Author: edgar_igl Date: 2008-06-09 23:06:31 +0000 (Mon, 09 Jun 2008) Log Message: ----------- CRIS: Translator updates. * RFN (Return From NMI) insn. * Avoid unnecessary T0 transfers. * Dont do tcg related init more than once. Modified Paths: -------------- trunk/target-cris/translate.c Modified: trunk/target-cris/translate.c =================================================================== --- trunk/target-cris/translate.c 2008-06-09 20:44:19 UTC (rev 4716) +++ trunk/target-cris/translate.c 2008-06-09 23:06:31 UTC (rev 4717) @@ -735,7 +735,7 @@ else tcg_gen_andi_tl(cpu_PR[PR_CCS], cpu_PR[PR_CCS], ~X_FLAG); - } + } dc->flags_uptodate = 1; } @@ -1530,7 +1530,6 @@ cris_cc_mask(dc, CC_MASK_NZ); - t_gen_mov_TN_reg(cpu_T[0], dc->op2); cris_alu(dc, CC_OP_BTST, cpu_T[0], cpu_R[dc->op2], tcg_const_tl(dc->op1), 4); cris_update_cc_op(dc, CC_OP_FLAGS, 4); @@ -1968,11 +1967,10 @@ dc->op1, dc->op2)); cris_cc_mask(dc, CC_MASK_NZ); - t_gen_mov_TN_reg(cpu_T[0], dc->op1); /* Size can only be qi or hi. */ t_gen_sext(cpu_T[1], cpu_R[dc->op1], size); cris_alu(dc, CC_OP_MOVE, - cpu_R[dc->op2], cpu_T[0], cpu_T[1], 4); + cpu_R[dc->op2], cpu_R[dc->op1], cpu_T[1], 4); return 2; } @@ -2788,7 +2786,9 @@ break; case 5: /* rfn. */ - BUG(); + cris_evaluate_flags(dc); + tcg_gen_helper_0_0(helper_rfn); + dc->is_jmp = DISAS_UPDATE; break; case 6: /* break. */ @@ -3271,13 +3271,21 @@ CPUCRISState *cpu_cris_init (const char *cpu_model) { CPUCRISState *env; + static int tcg_initialized = 0; int i; env = qemu_mallocz(sizeof(CPUCRISState)); if (!env) return NULL; + cpu_exec_init(env); + cpu_reset(env); + if (tcg_initialized) + return env; + + tcg_initialized = 1; + cpu_env = tcg_global_reg_new(TCG_TYPE_PTR, TCG_AREG0, "env"); #if TARGET_LONG_BITS > HOST_LONG_BITS cpu_T[0] = tcg_global_mem_new(TCG_TYPE_TL, @@ -3337,6 +3345,7 @@ TCG_HELPER(helper_movl_sreg_reg); TCG_HELPER(helper_movl_reg_sreg); TCG_HELPER(helper_rfe); + TCG_HELPER(helper_rfn); TCG_HELPER(helper_evaluate_flags_muls); TCG_HELPER(helper_evaluate_flags_mulu); @@ -3346,8 +3355,6 @@ TCG_HELPER(helper_evaluate_flags_move_2); TCG_HELPER(helper_evaluate_flags); TCG_HELPER(helper_top_evaluate_flags); - - cpu_reset(env); return env; }