[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 29/42] target-ppc: add vupk{h, l}px instructions.
From: |
Nathan Froyd |
Subject: |
[Qemu-devel] [PATCH 29/42] target-ppc: add vupk{h, l}px instructions. |
Date: |
Sun, 14 Dec 2008 18:15:02 -0800 |
Signed-off-by: Nathan Froyd <address@hidden>
---
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
- Re: [Qemu-devel] [PATCH 02/42] target-ppc: add helper macros for later patches., (continued)
- [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, 2008/12/14
- [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 <=
- [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
- [Qemu-devel] [PATCH 27/42] target-ppc: add vsplt{b, h, w} instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 32/42] target-ppc: add vmsum{u, m}bm instructions., Nathan Froyd, 2008/12/14