From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LC375-0006NB-Mi for qemu-devel@nongnu.org; Sun, 14 Dec 2008 21:23:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LC375-0006Ml-38 for qemu-devel@nongnu.org; Sun, 14 Dec 2008 21:23:15 -0500 Received: from [199.232.76.173] (port=47108 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LC374-0006Mg-Uv for qemu-devel@nongnu.org; Sun, 14 Dec 2008 21:23:14 -0500 Received: from mx20.gnu.org ([199.232.41.8]:31287) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LC374-0001GD-Jx for qemu-devel@nongnu.org; Sun, 14 Dec 2008 21:23:14 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LC373-0002RG-JB for qemu-devel@nongnu.org; Sun, 14 Dec 2008 21:23:13 -0500 From: Nathan Froyd Date: Sun, 14 Dec 2008 18:15:02 -0800 Message-Id: <1229307315-16807-30-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 29/42] target-ppc: add vupk{h, l}px 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 | 2 ++ target-ppc/op_helper.c | 27 +++++++++++++++++++++++++++ target-ppc/translate.c | 3 +++ 3 files changed, 32 insertions(+), 0 deletions(-) diff --git a/target-ppc/helper.h b/target-ppc/helper.h index 2ca4e26..9352a67 100644 --- a/target-ppc/helper.h +++ b/target-ppc/helper.h @@ -185,6 +185,8 @@ 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) +DEF_HELPER_2(vupkhpx, void, avr, avr) +DEF_HELPER_2(vupklpx, void, 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 44af1cc..22d88db 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -2429,6 +2429,33 @@ void helper_vsubcuw (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) } } +#if defined(WORDS_BIGENDIAN) +#define UPKHI 1 +#define UPKLO 0 +#else +#define UPKHI 0 +#define UPKLO 1 +#endif +#define VUPKPX(suffix, hi) \ + void helper_vupk##suffix (ppc_avr_t *r, ppc_avr_t *b) \ + { \ + int i; \ + ppc_avr_t result; \ + VECTOR_FOR_I (i, u32) { \ + uint16_t e = b->u16[hi ? i : i+4]; \ + uint8_t a = (e >> 15) ? 0xff : 0; \ + uint8_t r = (e >> 10) & 0x1f; \ + uint8_t g = (e >> 5) & 0x1f; \ + uint8_t b = e & 0x1f; \ + result.u32[i] = (a << 24) | (r << 16) | (g << 8) | b; \ + } \ + *r = result; \ + } +VUPKPX(lpx, UPKLO) +VUPKPX(hpx, UPKHI) +#undef UPKHI +#undef UPKLO + #undef VECTOR_FOR #undef VECTOR_FOR_I #undef VECTOR_FOR_INORDER_I diff --git a/target-ppc/translate.c b/target-ppc/translate.c index f1c621f..ca4f10a 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -6314,6 +6314,9 @@ GEN_VXFORM(vsr, 708); tcg_temp_free (rd); \ } +GEN_VXFORM_NOA(vupkhpx, 846); +GEN_VXFORM_NOA(vupklpx, 974); + #define GEN_VXFORM_SIMM(name, xo) \ GEN_HANDLER(name, 0x04, (xo >> 1) & 0x1f, (xo >> 6) & 0x1f, 0x00000000, PPC_ALTIVEC) \ { \ -- 1.6.0.5