Commit b04ae9811a944c2c7356692c13dcf32505b87d84

Authored by aurel32
1 parent 707cec33

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
target-ppc/helper.h
@@ -165,6 +165,8 @@ DEF_HELPER_2(vupkhsb, void, avr, avr) @@ -165,6 +165,8 @@ DEF_HELPER_2(vupkhsb, void, avr, avr)
165 DEF_HELPER_2(vupkhsh, void, avr, avr) 165 DEF_HELPER_2(vupkhsh, void, avr, avr)
166 DEF_HELPER_2(vupklsb, void, avr, avr) 166 DEF_HELPER_2(vupklsb, void, avr, avr)
167 DEF_HELPER_2(vupklsh, void, avr, avr) 167 DEF_HELPER_2(vupklsh, void, avr, avr)
  168 +DEF_HELPER_4(vmsumubm, void, avr, avr, avr, avr)
  169 +DEF_HELPER_4(vmsummbm, void, avr, avr, avr, avr)
168 170
169 DEF_HELPER_1(efscfsi, i32, i32) 171 DEF_HELPER_1(efscfsi, i32, i32)
170 DEF_HELPER_1(efscfui, i32, i32) 172 DEF_HELPER_1(efscfui, i32, i32)
target-ppc/op_helper.c
@@ -2093,6 +2093,34 @@ VMRG(w, u32) @@ -2093,6 +2093,34 @@ VMRG(w, u32)
2093 #undef MRGHI 2093 #undef MRGHI
2094 #undef MRGLO 2094 #undef MRGLO
2095 2095
  2096 +void helper_vmsummbm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
  2097 +{
  2098 + int32_t prod[16];
  2099 + int i;
  2100 +
  2101 + for (i = 0; i < ARRAY_SIZE(r->s8); i++) {
  2102 + prod[i] = (int32_t)a->s8[i] * b->u8[i];
  2103 + }
  2104 +
  2105 + VECTOR_FOR_INORDER_I(i, s32) {
  2106 + r->s32[i] = c->s32[i] + prod[4*i] + prod[4*i+1] + prod[4*i+2] + prod[4*i+3];
  2107 + }
  2108 +}
  2109 +
  2110 +void helper_vmsumubm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
  2111 +{
  2112 + uint16_t prod[16];
  2113 + int i;
  2114 +
  2115 + for (i = 0; i < ARRAY_SIZE(r->u8); i++) {
  2116 + prod[i] = a->u8[i] * b->u8[i];
  2117 + }
  2118 +
  2119 + VECTOR_FOR_INORDER_I(i, u32) {
  2120 + r->u32[i] = c->u32[i] + prod[4*i] + prod[4*i+1] + prod[4*i+2] + prod[4*i+3];
  2121 + }
  2122 +}
  2123 +
2096 #define VMUL_DO(name, mul_element, prod_element, evenp) \ 2124 #define VMUL_DO(name, mul_element, prod_element, evenp) \
2097 void helper_v##name (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ 2125 void helper_v##name (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
2098 { \ 2126 { \
target-ppc/translate.c
@@ -6376,6 +6376,8 @@ GEN_HANDLER(vsldoi, 0x04, 0x16, 0xFF, 0x00000400, PPC_ALTIVEC) @@ -6376,6 +6376,8 @@ GEN_HANDLER(vsldoi, 0x04, 0x16, 0xFF, 0x00000400, PPC_ALTIVEC)
6376 tcg_temp_free_ptr(rd); \ 6376 tcg_temp_free_ptr(rd); \
6377 } 6377 }
6378 6378
  6379 +GEN_VAFORM_PAIRED(vmsumubm, vmsummbm, 18)
  6380 +
6379 /*** SPE extension ***/ 6381 /*** SPE extension ***/
6380 /* Register moves */ 6382 /* Register moves */
6381 6383