Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K5qSu-0005MP-DT for qemu-devel@nongnu.org; Mon, 09 Jun 2008 19:07:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K5qSt-0005Lz-FS for qemu-devel@nongnu.org; Mon, 09 Jun 2008 19:07:51 -0400 Received: from [199.232.76.173] (port=34896 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K5qSt-0005Lu-A0 for qemu-devel@nongnu.org; Mon, 09 Jun 2008 19:07:51 -0400 Received: from savannah.gnu.org ([199.232.41.3]:54975 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 1K5qSs-00075e-Ua for qemu-devel@nongnu.org; Mon, 09 Jun 2008 19:07:51 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1K5qSs-0003bR-CP for qemu-devel@nongnu.org; Mon, 09 Jun 2008 23:07:50 +0000 Received: from edgar_igl by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1K5qSs-0003bN-7H for qemu-devel@nongnu.org; Mon, 09 Jun 2008 23:07:50 +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:07:50 +0000 Subject: [Qemu-devel] [4718] CRIS: Support RFN insn. 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: 4718 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4718 Author: edgar_igl Date: 2008-06-09 23:07:50 +0000 (Mon, 09 Jun 2008) Log Message: ----------- CRIS: Support RFN insn. Modified Paths: -------------- trunk/target-cris/helper.h trunk/target-cris/op_helper.c Modified: trunk/target-cris/helper.h =================================================================== --- trunk/target-cris/helper.h 2008-06-09 23:06:31 UTC (rev 4717) +++ trunk/target-cris/helper.h 2008-06-09 23:07:50 UTC (rev 4718) @@ -5,6 +5,7 @@ void TCG_HELPER_PROTO helper_dump(uint32_t a0, uint32_t a1, uint32_t a2); void TCG_HELPER_PROTO helper_dummy(void); void TCG_HELPER_PROTO helper_rfe(void); +void TCG_HELPER_PROTO helper_rfn(void); void TCG_HELPER_PROTO helper_store(uint32_t a0); void TCG_HELPER_PROTO helper_movl_sreg_reg (uint32_t sreg, uint32_t reg); Modified: trunk/target-cris/op_helper.c =================================================================== --- trunk/target-cris/op_helper.c 2008-06-09 23:06:31 UTC (rev 4717) +++ trunk/target-cris/op_helper.c 2008-06-09 23:07:50 UTC (rev 4718) @@ -220,6 +220,25 @@ env->pregs[PR_CCS] |= P_FLAG; } +void helper_rfn(void) +{ + int rflag = env->pregs[PR_CCS] & R_FLAG; + + D(fprintf(logfile, "rfn: erp=%x pid=%x ccs=%x btarget=%x\n", + env->pregs[PR_ERP], env->pregs[PR_PID], + env->pregs[PR_CCS], + env->btarget)); + + cris_ccs_rshift(env); + + /* Set the P_FLAG only if the R_FLAG is not set. */ + if (!rflag) + env->pregs[PR_CCS] |= P_FLAG; + + /* Always set the M flag. */ + env->pregs[PR_CCS] |= M_FLAG; +} + void helper_store(uint32_t a0) { if (env->pregs[PR_CCS] & P_FLAG )