From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LC36W-00065p-JF for qemu-devel@nongnu.org; Sun, 14 Dec 2008 21:22:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LC36V-000659-Is for qemu-devel@nongnu.org; Sun, 14 Dec 2008 21:22:40 -0500 Received: from [199.232.76.173] (port=47095 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LC36V-000653-95 for qemu-devel@nongnu.org; Sun, 14 Dec 2008 21:22:39 -0500 Received: from mx20.gnu.org ([199.232.41.8]:31277) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LC36V-0001AG-2U for qemu-devel@nongnu.org; Sun, 14 Dec 2008 21:22:39 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LC36U-0002Qc-9e for qemu-devel@nongnu.org; Sun, 14 Dec 2008 21:22:38 -0500 From: Nathan Froyd Date: Sun, 14 Dec 2008 18:15:09 -0800 Message-Id: <1229307315-16807-37-git-send-email-froydnj@codesourcery.com> In-Reply-To: <1229307315-16807-1-git-send-email-froydnj@codesourcery.com> References: <1229307315-16807-1-git-send-email-froydnj@codesourcery.com> Subject: [Qemu-devel] [PATCH 36/42] target-ppc: add vpkpx instruction. 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 | 1 + target-ppc/op_helper.c | 19 +++++++++++++++++++ target-ppc/translate.c | 1 + 3 files changed, 21 insertions(+), 0 deletions(-) diff --git a/target-ppc/helper.h b/target-ppc/helper.h index a1ef4df..e2ad294 100644 --- a/target-ppc/helper.h +++ b/target-ppc/helper.h @@ -203,6 +203,7 @@ DEF_HELPER_3(vpkuhus, void, avr, avr, avr) DEF_HELPER_3(vpkuwus, void, avr, avr, avr) DEF_HELPER_3(vpkuhum, void, avr, avr, avr) DEF_HELPER_3(vpkuwum, void, avr, avr, avr) +DEF_HELPER_3(vpkpx, void, avr, avr, avr) 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 2d53922..422600a 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -2330,6 +2330,25 @@ void helper_vperm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c) #else #define PKBIG 0 #endif +void helper_vpkpx (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) +{ + int i, j; + ppc_avr_t result; +#if defined(WORDS_BIGENDIAN) + const ppc_avr_t *x[2] = { a, b }; +#else + const ppc_avr_t *x[2] = { b, a }; +#endif + + VECTOR_FOR_INORDER_I (i, u64) { + VECTOR_FOR_INORDER_I (j, u32){ + uint32_t e = x[i]->u32[j]; + result.u16[4*i+j] = ((e >> 9) & 0xfc00) | ((e >> 6) & 0x3e0) | ((e >> 3) & 0x1f); + } + } + *r = result; +} + #define VPK(suffix, from, to, cvt, dosat) \ void helper_vpk##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 067c17b..4294148 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -6306,6 +6306,7 @@ GEN_VXFORM(vpkshus, 270); GEN_VXFORM(vpkswus, 334); GEN_VXFORM(vpkshss, 398); GEN_VXFORM(vpkswss, 462); +GEN_VXFORM(vpkpx, 782); #define GEN_VXFORM_NOA(name, xo) \ GEN_HANDLER(name, 0x04, (xo >> 1) & 0x1f, (xo >> 6) & 0x1f, 0x001f0000, PPC_ALTIVEC) \ -- 1.6.0.5