From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LJbAO-00014a-LK for qemu-devel@nongnu.org; Sun, 04 Jan 2009 17:09:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJbAM-00014O-6S for qemu-devel@nongnu.org; Sun, 04 Jan 2009 17:09:51 -0500 Received: from [199.232.76.173] (port=56551 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJbAM-00014L-1V for qemu-devel@nongnu.org; Sun, 04 Jan 2009 17:09:50 -0500 Received: from savannah.gnu.org ([199.232.41.3]:35967 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 1LJbAK-0000o7-L8 for qemu-devel@nongnu.org; Sun, 04 Jan 2009 17:09:49 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LJbAF-00011o-Lq for qemu-devel@nongnu.org; Sun, 04 Jan 2009 22:09:43 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LJbAF-000113-AO for qemu-devel@nongnu.org; Sun, 04 Jan 2009 22:09:43 +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: Sun, 04 Jan 2009 22:09:43 +0000 Subject: [Qemu-devel] [6169] Add lvs{l,r} instructions. 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: 6169 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6169 Author: aurel32 Date: 2009-01-04 22:09:42 +0000 (Sun, 04 Jan 2009) Log Message: ----------- Add lvs{l,r} instructions. 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-01-04 22:09:31 UTC (rev 6168) +++ trunk/target-ppc/helper.h 2009-01-04 22:09:42 UTC (rev 6169) @@ -150,6 +150,8 @@ DEF_HELPER_3(vsro, void, avr, avr, avr) DEF_HELPER_3(vaddcuw, void, avr, avr, avr) DEF_HELPER_3(vsubcuw, void, avr, avr, avr) +DEF_HELPER_2(lvsl, void, avr, tl); +DEF_HELPER_2(lvsr, void, avr, tl); DEF_HELPER_1(efscfsi, i32, i32) DEF_HELPER_1(efscfui, i32, i32) Modified: trunk/target-ppc/op_helper.c =================================================================== --- trunk/target-ppc/op_helper.c 2009-01-04 22:09:31 UTC (rev 6168) +++ trunk/target-ppc/op_helper.c 2009-01-04 22:09:42 UTC (rev 6169) @@ -1972,6 +1972,24 @@ for (index = ARRAY_SIZE(r->element)-1; index >= 0; index--) #endif +void helper_lvsl (ppc_avr_t *r, target_ulong sh) +{ + int i, j = (sh & 0xf); + + VECTOR_FOR_INORDER_I (i, u8) { + r->u8[i] = j++; + } +} + +void helper_lvsr (ppc_avr_t *r, target_ulong sh) +{ + int i, j = 0x10 - (sh & 0xf); + + VECTOR_FOR_INORDER_I (i, u8) { + r->u8[i] = j++; + } +} + 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-01-04 22:09:31 UTC (rev 6168) +++ trunk/target-ppc/translate.c 2009-01-04 22:09:42 UTC (rev 6169) @@ -6146,6 +6146,38 @@ /* As we don't emulate the cache, stvxl is stricly equivalent to stvx */ GEN_VR_STX(svxl, 0x07, 0x0F); +GEN_HANDLER(lvsl, 0x1f, 0x06, 0x00, 0x00000001, PPC_ALTIVEC) +{ + TCGv_ptr rd; + TCGv EA; + if (unlikely(!ctx->altivec_enabled)) { + gen_exception(ctx, POWERPC_EXCP_VPU); + return; + } + EA = tcg_temp_new(); + gen_addr_reg_index(ctx, EA); + rd = gen_avr_ptr(rD(ctx->opcode)); + gen_helper_lvsl(rd, EA); + tcg_temp_free(EA); + tcg_temp_free_ptr(rd); +} + +GEN_HANDLER(lvsr, 0x1f, 0x06, 0x01, 0x00000001, PPC_ALTIVEC) +{ + TCGv_ptr rd; + TCGv EA; + if (unlikely(!ctx->altivec_enabled)) { + gen_exception(ctx, POWERPC_EXCP_VPU); + return; + } + EA = tcg_temp_new(); + gen_addr_reg_index(ctx, EA); + rd = gen_avr_ptr(rD(ctx->opcode)); + gen_helper_lvsr(rd, EA); + tcg_temp_free(EA); + tcg_temp_free_ptr(rd); +} + /* Logical operations */ #define GEN_VX_LOGICAL(name, tcg_op, opc2, opc3) \ GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC) \