[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 36/42] target-ppc: add vpkpx instruction.
From: |
Nathan Froyd |
Subject: |
[Qemu-devel] [PATCH 36/42] target-ppc: add vpkpx instruction. |
Date: |
Sun, 14 Dec 2008 18:15:09 -0800 |
Signed-off-by: Nathan Froyd <address@hidden>
---
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
- [Qemu-devel] [PATCH 42/42] target-ppc: add vsumsws, vsum2sws, and vsum4{sbs, shs, ubs} instructions., (continued)
- [Qemu-devel] [PATCH 42/42] target-ppc: add vsumsws, vsum2sws, and vsum4{sbs, shs, ubs} instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 02/42] target-ppc: add helper macros for later patches., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 08/42] target-ppc: add v{min, max}{s, u}{b, h, w} instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 13/42] target-ppc: add vmul{e, o}{s, u}{b, h} instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 21/42] target-ppc: add vrl{b, h, w} instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 26/42] target-ppc: add GEN_VXFORM_UIMM macro for subsequent instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 30/42] target-ppc: add vupk{h, l}s{b, h} instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 34/42] target-ppc: add saturating arithmetic conversion functions for subsequent instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 36/42] target-ppc: add vpkpx instruction.,
Nathan Froyd <=
- [Qemu-devel] [PATCH 04/42] target-ppc: add GEN_VXFORM macro for subsequent instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 29/42] target-ppc: add vupk{h, l}px instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 15/42] target-ppc: add vsl{b, h, w} instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 03/42] target-ppc: add gen_avr_ptr function., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 09/42] target-ppc: add GEN_VXRFORM{, 1} macros for subsequent instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 22/42] target-ppc: add vs{l,r} instructions., Nathan Froyd, 2008/12/14