diff options
Diffstat (limited to 'target-ppc')
-rw-r--r-- | target-ppc/helper.h | 6 | ||||
-rw-r--r-- | target-ppc/op_helper.c | 18 | ||||
-rw-r--r-- | target-ppc/translate.c | 6 |
3 files changed, 30 insertions, 0 deletions
diff --git a/target-ppc/helper.h b/target-ppc/helper.h index 3b44b97803..025679010c 100644 --- a/target-ppc/helper.h +++ b/target-ppc/helper.h @@ -137,6 +137,12 @@ DEF_HELPER_3(vmulosb, void, avr, avr, avr) DEF_HELPER_3(vmulosh, void, avr, avr, avr) DEF_HELPER_3(vmuloub, void, avr, avr, avr) DEF_HELPER_3(vmulouh, void, avr, avr, avr) +DEF_HELPER_3(vsrab, void, avr, avr, avr) +DEF_HELPER_3(vsrah, void, avr, avr, avr) +DEF_HELPER_3(vsraw, void, avr, avr, avr) +DEF_HELPER_3(vsrb, void, avr, avr, avr) +DEF_HELPER_3(vsrh, void, avr, avr, avr) +DEF_HELPER_3(vsrw, void, 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 4a548ea136..648c50f63f 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -2088,6 +2088,24 @@ VMUL(uh, u16, u32) #undef VMUL_DO #undef VMUL +#define VSR(suffix, element) \ + void helper_vsr##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ + { \ + int i; \ + for (i = 0; i < ARRAY_SIZE(r->element); i++) { \ + unsigned int mask = ((1 << (3 + (sizeof (a->element[0]) >> 1))) - 1); \ + unsigned int shift = b->element[i] & mask; \ + r->element[i] = a->element[i] >> shift; \ + } \ + } +VSR(ab, s8) +VSR(ah, s16) +VSR(aw, s32) +VSR(b, u8) +VSR(h, u16) +VSR(w, u32) +#undef VSR + #undef VECTOR_FOR_INORDER_I #undef HI_IDX #undef LO_IDX diff --git a/target-ppc/translate.c b/target-ppc/translate.c index eed3999105..cd6b5354b7 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -6219,6 +6219,12 @@ GEN_VXFORM(vmuleub, 4, 8); GEN_VXFORM(vmuleuh, 4, 9); GEN_VXFORM(vmulesb, 4, 12); GEN_VXFORM(vmulesh, 4, 13); +GEN_VXFORM(vsrb, 2, 8); +GEN_VXFORM(vsrh, 2, 9); +GEN_VXFORM(vsrw, 2, 10); +GEN_VXFORM(vsrab, 2, 12); +GEN_VXFORM(vsrah, 2, 13); +GEN_VXFORM(vsraw, 2, 14); /*** SPE extension ***/ /* Register moves */ |