From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LURNW-0002ft-HQ for qemu-devel@nongnu.org; Tue, 03 Feb 2009 14:56:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LURNV-0002fQ-To for qemu-devel@nongnu.org; Tue, 03 Feb 2009 14:56:14 -0500 Received: from [199.232.76.173] (port=53376 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LURNV-0002fK-Nd for qemu-devel@nongnu.org; Tue, 03 Feb 2009 14:56:13 -0500 Received: from savannah.gnu.org ([199.232.41.3]:59470 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 1LURNU-0006xK-NI for qemu-devel@nongnu.org; Tue, 03 Feb 2009 14:56:12 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LURNS-0001bK-HD for qemu-devel@nongnu.org; Tue, 03 Feb 2009 19:56:10 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LURNR-0001b6-Oc for qemu-devel@nongnu.org; Tue, 03 Feb 2009 19:56:10 +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: Tue, 03 Feb 2009 19:56:09 +0000 Subject: [Qemu-devel] [6508] Make mtvscr use a helper 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: 6508 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6508 Author: aurel32 Date: 2009-02-03 19:56:09 +0000 (Tue, 03 Feb 2009) Log Message: ----------- Make mtvscr use a helper Do this so we can set float statuses once per mtvscr, rather than once per Altivec instruction. Signed-off-by: Nathan Froyd Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/target-ppc/helper.h trunk/target-ppc/op_helper.c trunk/target-ppc/translate.c Modified: trunk/target-ppc/helper.h =================================================================== --- trunk/target-ppc/helper.h 2009-02-03 19:55:59 UTC (rev 6507) +++ trunk/target-ppc/helper.h 2009-02-03 19:56:09 UTC (rev 6508) @@ -220,6 +220,7 @@ DEF_HELPER_4(vmsumshm, void, avr, avr, avr, avr) DEF_HELPER_4(vmsumshs, void, avr, avr, avr, avr) DEF_HELPER_4(vmladduhm, void, avr, avr, avr, avr) +DEF_HELPER_1(mtvscr, void, avr); DEF_HELPER_2(lvebx, void, avr, tl) DEF_HELPER_2(lvehx, void, avr, tl) DEF_HELPER_2(lvewx, void, avr, tl) Modified: trunk/target-ppc/op_helper.c =================================================================== --- trunk/target-ppc/op_helper.c 2009-02-03 19:55:59 UTC (rev 6507) +++ trunk/target-ppc/op_helper.c 2009-02-03 19:56:09 UTC (rev 6508) @@ -2050,6 +2050,16 @@ #undef I #undef LVE +void helper_mtvscr (ppc_avr_t *r) +{ +#if defined(WORDS_BIGENDIAN) + env->vscr = r->u32[3]; +#else + env->vscr = r->u32[0]; +#endif + set_flush_to_zero(vscr_nj, &env->vec_status); +} + void helper_vaddcuw (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { int i; Modified: trunk/target-ppc/translate.c =================================================================== --- trunk/target-ppc/translate.c 2009-02-03 19:55:59 UTC (rev 6507) +++ trunk/target-ppc/translate.c 2009-02-03 19:56:09 UTC (rev 6508) @@ -6268,15 +6268,14 @@ GEN_HANDLER(mtvscr, 0x04, 0x2, 0x19, 0x03ff0000, PPC_ALTIVEC) { - TCGv_i32 t; + TCGv_ptr p; if (unlikely(!ctx->altivec_enabled)) { gen_exception(ctx, POWERPC_EXCP_VPU); return; } - t = tcg_temp_new_i32(); - tcg_gen_trunc_i64_i32(t, cpu_avrl[rD(ctx->opcode)]); - tcg_gen_st_i32(t, cpu_env, offsetof(CPUState, vscr)); - tcg_temp_free_i32(t); + p = gen_avr_ptr(rD(ctx->opcode)); + gen_helper_mtvscr(p); + tcg_temp_free_ptr(p); } /* Logical operations */