[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 32/42] target-ppc: add vmsum{u, m}bm instructions.
From: |
Nathan Froyd |
Subject: |
[Qemu-devel] [PATCH 32/42] target-ppc: add vmsum{u, m}bm instructions. |
Date: |
Sun, 14 Dec 2008 18:15:05 -0800 |
Signed-off-by: Nathan Froyd <address@hidden>
---
target-ppc/helper.h | 2 ++
target-ppc/op_helper.c | 28 ++++++++++++++++++++++++++++
target-ppc/translate.c | 2 ++
3 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/target-ppc/helper.h b/target-ppc/helper.h
index 26ff038..dbd00f5 100644
--- a/target-ppc/helper.h
+++ b/target-ppc/helper.h
@@ -191,6 +191,8 @@ DEF_HELPER_2(vupkhsb, void, avr, avr)
DEF_HELPER_2(vupkhsh, void, avr, avr)
DEF_HELPER_2(vupklsb, void, avr, avr)
DEF_HELPER_2(vupklsh, void, avr, avr)
+DEF_HELPER_4(vmsumubm, void, avr, avr, avr, avr)
+DEF_HELPER_4(vmsummbm, void, avr, 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 346ddde..aa8a563 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -2228,6 +2228,34 @@ VMRG(w, u32)
#undef MRGHI
#undef MRGLO
+void helper_vmsummbm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
+{
+ int32_t prod[16];
+ int i;
+
+ VECTOR_FOR_I(i, s8) {
+ prod[i] = (int32_t)a->s8[i] * b->u8[i];
+ }
+
+ VECTOR_FOR_INORDER_I(i, s32) {
+ r->s32[i] = c->s32[i] + prod[4*i] + prod[4*i+1] + prod[4*i+2] +
prod[4*i+3];
+ }
+}
+
+void helper_vmsumubm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
+{
+ uint16_t prod[16];
+ int i;
+
+ VECTOR_FOR_I(i, u8) {
+ prod[i] = a->u8[i] * b->u8[i];
+ }
+
+ VECTOR_FOR_INORDER_I(i, u32) {
+ r->u32[i] = c->u32[i] + prod[4*i] + prod[4*i+1] + prod[4*i+2] +
prod[4*i+3];
+ }
+}
+
#define VMUL_DO(name, mul_element, prod_element, evenp) \
void helper_v##name (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 d77ddaf..34b1d9e 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -6442,6 +6442,8 @@ GEN_HANDLER(vsldoi, 0x04, 0x16, 0xFF, 0x00000400,
PPC_ALTIVEC)
tcg_temp_free (rd); \
}
+GEN_VAFORM_PAIRED(vmsumubm, vmsummbm, 36)
+
/*** SPE extension ***/
/* Register moves */
--
1.6.0.5
- [Qemu-devel] [PATCH 29/42] target-ppc: add vupk{h, l}px instructions., (continued)
- [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
- [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 <=
- [Qemu-devel] [PATCH 37/42] target-ppc: add vmh{, r}addshs instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 33/42] target-ppc: add vsel and vperm instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 05/42] target-ppc: add v{add, sub}u{b, h, w}m instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 11/42] target-ppc: add vscr access macros., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 16/42] target-ppc: add vs{l,r}o instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 20/42] target-ppc: add v{add, sub}{s, u}{b, h, w}s instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 38/42] target-ppc: add vmsumuh{m, s} instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 41/42] target-ppc: add {l, st}ve{b, h, w}x instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 24/42] target-ppc: add GEN_VXFORM_SIMM macro for subsequent instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 40/42] target-ppc: add vmladduhm instruction., Nathan Froyd, 2008/12/14