[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 27/40] Add vupk{h,l}px instructions.
From: |
Nathan Froyd |
Subject: |
[Qemu-devel] [PATCH 27/40] Add vupk{h,l}px instructions. |
Date: |
Tue, 30 Dec 2008 19:10:09 -0800 |
Signed-off-by: Nathan Froyd <address@hidden>
---
target-ppc/helper.h | 2 ++
target-ppc/op_helper.c | 29 +++++++++++++++++++++++++++++
target-ppc/translate.c | 3 +++
3 files changed, 34 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 28b1fb6..5d8e678 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -2381,6 +2381,35 @@ 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; \
+ for (i = 0; i < ARRAY_SIZE(r->u32); i++) { \
+ 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 VUPKPX
+
+#undef UPKHI
+#undef UPKLO
+
#undef VECTOR_FOR_INORDER_I
#undef HI_IDX
#undef LO_IDX
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index b8a7cab..a280db1 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -6340,6 +6340,9 @@ GEN_VXFORM(vsr, 2, 11);
tcg_temp_free_ptr(rd); \
}
+GEN_VXFORM_NOA(vupkhpx, 7, 13);
+GEN_VXFORM_NOA(vupklpx, 7, 15);
+
#define GEN_VXFORM_SIMM(name, opc2, opc3) \
GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC) \
{ \
--
1.6.0.5
- [Qemu-devel] [PATCH 10/40] Add vmrg{l,h}{b,h,w} instructions., (continued)
- [Qemu-devel] [PATCH 10/40] Add vmrg{l,h}{b,h,w} instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 12/40] Add vsr{,a}{b,h,w} instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 29/40] Add GEN_VAFORM_PAIRED macro for subsequent instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 02/40] Add helper macros for later patches., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 11/40] Add vmul{e,o}{s,u}{b,h} instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 16/40] Add lvs{l,r} instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 22/40] Add GEN_VXFORM_SIMM macro for subsequent instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 39/40] Add {l,st}ve{b,h,w}x instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 01/40] Fix TCG error in gen_avr_ptr., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 18/40] Add v{add, sub}{s, u}{b, h, w}s instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 27/40] Add vupk{h,l}px instructions.,
Nathan Froyd <=
- [Qemu-devel] [PATCH 28/40] Add vupk{h,l}s{b,h} instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 40/40] Add vsumsws, vsum2sws, and vsum4{sbs, shs, ubs} instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 36/40] Add vmsumuh{m,s} instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 03/40] Add GEN_VXFORM macro for subsequent instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 23/40] Add vspltis{b,h,w} instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 13/40] Add vsl{b,h,w} instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 05/40] Add vavg{s,u}{b,h,w} instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 24/40] Add GEN_VXFORM_UIMM macro for subsequent instructions., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 21/40] Add vsldoi instruction., Nathan Froyd, 2008/12/30
- [Qemu-devel] [PATCH 30/40] Add vmsum{u,m}bm instructions., Nathan Froyd, 2008/12/30
- Prev by Date:
[Qemu-devel] [PATCH 18/40] Add v{add, sub}{s, u}{b, h, w}s instructions.
- Next by Date:
[Qemu-devel] [PATCH 28/40] Add vupk{h,l}s{b,h} instructions.
- Previous by thread:
[Qemu-devel] [PATCH 18/40] Add v{add, sub}{s, u}{b, h, w}s instructions.
- Next by thread:
[Qemu-devel] [PATCH 28/40] Add vupk{h,l}s{b,h} instructions.
- Index(es):