From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KZZ4L-0007iT-Vu for qemu-devel@nongnu.org; Sat, 30 Aug 2008 18:37:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KZZ4L-0007iH-CM for qemu-devel@nongnu.org; Sat, 30 Aug 2008 18:37:21 -0400 Received: from [199.232.76.173] (port=47361 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KZZ4L-0007iE-Ac for qemu-devel@nongnu.org; Sat, 30 Aug 2008 18:37:21 -0400 Received: from savannah.gnu.org ([199.232.41.3]:58935 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 1KZZ4L-0000Ad-00 for qemu-devel@nongnu.org; Sat, 30 Aug 2008 18:37:21 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KZZ4H-0005UP-Nl for qemu-devel@nongnu.org; Sat, 30 Aug 2008 22:37:17 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KZZ4H-0005UL-D9 for qemu-devel@nongnu.org; Sat, 30 Aug 2008 22:37:17 +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: Sat, 30 Aug 2008 22:37:17 +0000 Subject: [Qemu-devel] [5119] SH4: Convert shift functions to TCG 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: 5119 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5119 Author: aurel32 Date: 2008-08-30 22:37:17 +0000 (Sat, 30 Aug 2008) Log Message: ----------- SH4: Convert shift functions to TCG Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/target-sh4/op.c trunk/target-sh4/translate.c Modified: trunk/target-sh4/op.c =================================================================== --- trunk/target-sh4/op.c 2008-08-30 22:07:52 UTC (rev 5118) +++ trunk/target-sh4/op.c 2008-08-30 22:37:17 UTC (rev 5119) @@ -115,27 +115,6 @@ RETURN(); } -void OPPROTO op_shal_Rn(void) -{ - cond_t(env->gregs[PARAM1] & 0x80000000); - env->gregs[PARAM1] <<= 1; - RETURN(); -} - -void OPPROTO op_shar_Rn(void) -{ - cond_t(env->gregs[PARAM1] & 1); - *(int32_t *)&env->gregs[PARAM1] >>= 1; - RETURN(); -} - -void OPPROTO op_shlr_Rn(void) -{ - cond_t(env->gregs[PARAM1] & 1); - env->gregs[PARAM1] >>= 1; - RETURN(); -} - void OPPROTO op_fmov_frN_FT0(void) { FT0 = env->fregs[PARAM1]; Modified: trunk/target-sh4/translate.c =================================================================== --- trunk/target-sh4/translate.c 2008-08-30 22:07:52 UTC (rev 5118) +++ trunk/target-sh4/translate.c 2008-08-30 22:37:17 UTC (rev 5119) @@ -1226,13 +1226,19 @@ return; case 0x4000: /* shll Rn */ case 0x4020: /* shal Rn */ - gen_op_shal_Rn(REG(B11_8)); + tcg_gen_andi_i32(cpu_T[0], cpu_gregs[REG(B11_8)], 0x80000000); + gen_cmp_imm(TCG_COND_NE, cpu_T[0], 0); + tcg_gen_shli_i32(cpu_gregs[REG(B11_8)], cpu_gregs[REG(B11_8)], 1); return; case 0x4021: /* shar Rn */ - gen_op_shar_Rn(REG(B11_8)); + tcg_gen_andi_i32(cpu_T[0], cpu_gregs[REG(B11_8)], 1); + gen_cmp_imm(TCG_COND_NE, cpu_T[0], 0); + tcg_gen_sari_i32(cpu_gregs[REG(B11_8)], cpu_gregs[REG(B11_8)], 1); return; case 0x4001: /* shlr Rn */ - gen_op_shlr_Rn(REG(B11_8)); + tcg_gen_andi_i32(cpu_T[0], cpu_gregs[REG(B11_8)], 1); + gen_cmp_imm(TCG_COND_NE, cpu_T[0], 0); + tcg_gen_shri_i32(cpu_gregs[REG(B11_8)], cpu_gregs[REG(B11_8)], 1); return; case 0x4008: /* shll2 Rn */ tcg_gen_shli_i32(cpu_gregs[REG(B11_8)], cpu_gregs[REG(B11_8)], 2);