From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LL022-0005OG-1e for qemu-devel@nongnu.org; Thu, 08 Jan 2009 13:55:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LL020-0005NF-CL for qemu-devel@nongnu.org; Thu, 08 Jan 2009 13:55:00 -0500 Received: from [199.232.76.173] (port=56728 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LL01z-0005N9-R7 for qemu-devel@nongnu.org; Thu, 08 Jan 2009 13:54:59 -0500 Received: from savannah.gnu.org ([199.232.41.3]:45507 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 1LL01z-0007sR-EM for qemu-devel@nongnu.org; Thu, 08 Jan 2009 13:54:59 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LL01y-0004Zh-Pu for qemu-devel@nongnu.org; Thu, 08 Jan 2009 18:54:58 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LL01y-0004Zd-9R for qemu-devel@nongnu.org; Thu, 08 Jan 2009 18:54:58 +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: Thu, 08 Jan 2009 18:54:58 +0000 Subject: [Qemu-devel] [6238] Add vspltis{b,h,w} 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: 6238 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6238 Author: aurel32 Date: 2009-01-08 18:54:57 +0000 (Thu, 08 Jan 2009) Log Message: ----------- Add vspltis{b,h,w} 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-08 18:54:48 UTC (rev 6237) +++ trunk/target-ppc/helper.h 2009-01-08 18:54:57 UTC (rev 6238) @@ -176,6 +176,9 @@ DEF_HELPER_3(vsl, void, avr, avr, avr) DEF_HELPER_3(vsr, void, avr, avr, avr) DEF_HELPER_4(vsldoi, void, avr, avr, avr, i32) +DEF_HELPER_2(vspltisb, void, avr, i32) +DEF_HELPER_2(vspltish, void, avr, i32) +DEF_HELPER_2(vspltisw, void, avr, i32) DEF_HELPER_3(vspltb, void, avr, avr, i32) DEF_HELPER_3(vsplth, void, avr, avr, i32) DEF_HELPER_3(vspltw, void, avr, avr, i32) Modified: trunk/target-ppc/op_helper.c =================================================================== --- trunk/target-ppc/op_helper.c 2009-01-08 18:54:48 UTC (rev 6237) +++ trunk/target-ppc/op_helper.c 2009-01-08 18:54:57 UTC (rev 6238) @@ -2570,6 +2570,20 @@ #undef SPLAT_ELEMENT #undef _SPLAT_MASKED +#define VSPLTI(suffix, element, splat_type) \ + void helper_vspltis##suffix (ppc_avr_t *r, uint32_t splat) \ + { \ + splat_type x = (int8_t)(splat << 3) >> 3; \ + int i; \ + for (i = 0; i < ARRAY_SIZE(r->element); i++) { \ + r->element[i] = x; \ + } \ + } +VSPLTI(b, s8, int8_t) +VSPLTI(h, s16, int16_t) +VSPLTI(w, s32, int32_t) +#undef VSPLTI + #define VSR(suffix, element) \ void helper_vsr##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ { \ Modified: trunk/target-ppc/translate.c =================================================================== --- trunk/target-ppc/translate.c 2009-01-08 18:54:48 UTC (rev 6237) +++ trunk/target-ppc/translate.c 2009-01-08 18:54:57 UTC (rev 6238) @@ -6392,6 +6392,26 @@ GEN_VXRFORM(vcmpgtuh, 3, 9) GEN_VXRFORM(vcmpgtuw, 3, 10) +#define GEN_VXFORM_SIMM(name, opc2, opc3) \ + GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC) \ + { \ + TCGv_ptr rd; \ + TCGv_i32 simm; \ + if (unlikely(!ctx->altivec_enabled)) { \ + gen_exception(ctx, POWERPC_EXCP_VPU); \ + return; \ + } \ + simm = tcg_const_i32(SIMM5(ctx->opcode)); \ + rd = gen_avr_ptr(rD(ctx->opcode)); \ + gen_helper_##name (rd, simm); \ + tcg_temp_free_i32(simm); \ + tcg_temp_free_ptr(rd); \ + } + +GEN_VXFORM_SIMM(vspltisb, 6, 12); +GEN_VXFORM_SIMM(vspltish, 6, 13); +GEN_VXFORM_SIMM(vspltisw, 6, 14); + #define GEN_VXFORM_NOA(name, opc2, opc3) \ GEN_HANDLER(name, 0x04, opc2, opc3, 0x001f0000, PPC_ALTIVEC) \ { \