From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LHsPf-0006LV-1R for qemu-devel@nongnu.org; Tue, 30 Dec 2008 23:10:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LHsPe-0006LJ-J9 for qemu-devel@nongnu.org; Tue, 30 Dec 2008 23:10:30 -0500 Received: from [199.232.76.173] (port=46435 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LHsPe-0006LG-Eq for qemu-devel@nongnu.org; Tue, 30 Dec 2008 23:10:30 -0500 Received: from mx20.gnu.org ([199.232.41.8]:33326) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LHsPe-000247-2v for qemu-devel@nongnu.org; Tue, 30 Dec 2008 23:10:30 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LHsPd-00009B-CT for qemu-devel@nongnu.org; Tue, 30 Dec 2008 23:10:29 -0500 From: Nathan Froyd Date: Tue, 30 Dec 2008 19:10:05 -0800 Message-Id: <1230693022-18380-24-git-send-email-froydnj@codesourcery.com> In-Reply-To: <1230693022-18380-1-git-send-email-froydnj@codesourcery.com> References: <1230693022-18380-1-git-send-email-froydnj@codesourcery.com> Subject: [Qemu-devel] [PATCH 23/40] 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 Signed-off-by: Nathan Froyd --- target-ppc/helper.h | 3 +++ target-ppc/op_helper.c | 17 +++++++++++++++++ target-ppc/translate.c | 4 ++++ 3 files changed, 24 insertions(+), 0 deletions(-) diff --git a/target-ppc/helper.h b/target-ppc/helper.h index 02e3c10..9fbcc4a 100644 --- a/target-ppc/helper.h +++ b/target-ppc/helper.h @@ -179,6 +179,9 @@ DEF_HELPER_3(vrlw, void, avr, avr, avr) 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_1(efscfsi, i32, i32) DEF_HELPER_1(efscfui, i32, i32) diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index d0748b2..55f341f 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -2302,6 +2302,23 @@ void helper_vslo (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) #endif } +#define VSPLTI(suffix, element, splat_type) \ + void helper_vspltis##suffix (ppc_avr_t *r, uint32_t splat) \ + { \ + splat_type x = (splat_type)splat; \ + int i; \ + /* 5-bit sign extension. */ \ + if (x & 0x10) \ + x -= 0x20; \ + 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) \ { \ diff --git a/target-ppc/translate.c b/target-ppc/translate.c index e590476..d9c1e60 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -6339,6 +6339,10 @@ GEN_VXFORM(vsr, 2, 11); 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_VXRFORM1(opname, name, str, opc2, opc3) \ GEN_HANDLER2(name, str, 0x4, opc2, opc3, 0x00000000, PPC_ALTIVEC) \ { \ -- 1.6.0.5