diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-04 22:11:39 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-04 22:11:39 +0000 |
commit | b04ae9811a944c2c7356692c13dcf32505b87d84 (patch) | |
tree | 59ce4f5f7090255542547a4aa3ee76df9c34f19b | |
parent | 707cec33f0c978a9c56504e6d1a90ce1770ccaa7 (diff) | |
download | qemu-b04ae9811a944c2c7356692c13dcf32505b87d84.zip qemu-b04ae9811a944c2c7356692c13dcf32505b87d84.tar.gz qemu-b04ae9811a944c2c7356692c13dcf32505b87d84.tar.bz2 |
Add vmsum{u,m}bm instructions.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6179 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r-- | target-ppc/helper.h | 2 | ||||
-rw-r--r-- | target-ppc/op_helper.c | 28 | ||||
-rw-r--r-- | 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 d96e030..0e93818 100644 --- a/target-ppc/helper.h +++ b/target-ppc/helper.h @@ -165,6 +165,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 ee08652..2133529 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -2093,6 +2093,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; + + for (i = 0; i < ARRAY_SIZE(r->s8); i++) { + 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; + + for (i = 0; i < ARRAY_SIZE(r->u8); i++) { + 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 b9d65f2..e80cdf3 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -6376,6 +6376,8 @@ GEN_HANDLER(vsldoi, 0x04, 0x16, 0xFF, 0x00000400, PPC_ALTIVEC) tcg_temp_free_ptr(rd); \ } +GEN_VAFORM_PAIRED(vmsumubm, vmsummbm, 18) + /*** SPE extension ***/ /* Register moves */ |