Commit 5e1d0985f9cb5146f7feaa8a6aa223566ef0592a
1 parent
bf8d8ded
Add vrl{b,h,w} 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@6170 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
21 additions
and
0 deletions
target-ppc/helper.h
@@ -152,6 +152,9 @@ DEF_HELPER_3(vaddcuw, void, avr, avr, avr) | @@ -152,6 +152,9 @@ DEF_HELPER_3(vaddcuw, void, avr, avr, avr) | ||
152 | DEF_HELPER_3(vsubcuw, void, avr, avr, avr) | 152 | DEF_HELPER_3(vsubcuw, void, avr, avr, avr) |
153 | DEF_HELPER_2(lvsl, void, avr, tl); | 153 | DEF_HELPER_2(lvsl, void, avr, tl); |
154 | DEF_HELPER_2(lvsr, void, avr, tl); | 154 | DEF_HELPER_2(lvsr, void, avr, tl); |
155 | +DEF_HELPER_3(vrlb, void, avr, avr, avr) | ||
156 | +DEF_HELPER_3(vrlh, void, avr, avr, avr) | ||
157 | +DEF_HELPER_3(vrlw, void, avr, avr, avr) | ||
155 | 158 | ||
156 | DEF_HELPER_1(efscfsi, i32, i32) | 159 | DEF_HELPER_1(efscfsi, i32, i32) |
157 | DEF_HELPER_1(efscfui, i32, i32) | 160 | DEF_HELPER_1(efscfui, i32, i32) |
target-ppc/op_helper.c
@@ -2115,6 +2115,21 @@ VMUL(uh, u16, u32) | @@ -2115,6 +2115,21 @@ VMUL(uh, u16, u32) | ||
2115 | #undef VMUL_DO | 2115 | #undef VMUL_DO |
2116 | #undef VMUL | 2116 | #undef VMUL |
2117 | 2117 | ||
2118 | +#define VROTATE(suffix, element) \ | ||
2119 | + void helper_vrl##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ | ||
2120 | + { \ | ||
2121 | + int i; \ | ||
2122 | + for (i = 0; i < ARRAY_SIZE(r->element); i++) { \ | ||
2123 | + unsigned int mask = ((1 << (3 + (sizeof (a->element[0]) >> 1))) - 1); \ | ||
2124 | + unsigned int shift = b->element[i] & mask; \ | ||
2125 | + r->element[i] = (a->element[i] << shift) | (a->element[i] >> (sizeof(a->element[0]) * 8 - shift)); \ | ||
2126 | + } \ | ||
2127 | + } | ||
2128 | +VROTATE(b, u8) | ||
2129 | +VROTATE(h, u16) | ||
2130 | +VROTATE(w, u32) | ||
2131 | +#undef VROTATE | ||
2132 | + | ||
2118 | #define VSL(suffix, element) \ | 2133 | #define VSL(suffix, element) \ |
2119 | void helper_vsl##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ | 2134 | void helper_vsl##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ |
2120 | { \ | 2135 | { \ |
target-ppc/translate.c
@@ -6264,6 +6264,9 @@ GEN_VXFORM(vslo, 6, 16); | @@ -6264,6 +6264,9 @@ GEN_VXFORM(vslo, 6, 16); | ||
6264 | GEN_VXFORM(vsro, 6, 17); | 6264 | GEN_VXFORM(vsro, 6, 17); |
6265 | GEN_VXFORM(vaddcuw, 0, 6); | 6265 | GEN_VXFORM(vaddcuw, 0, 6); |
6266 | GEN_VXFORM(vsubcuw, 0, 22); | 6266 | GEN_VXFORM(vsubcuw, 0, 22); |
6267 | +GEN_VXFORM(vrlb, 2, 0); | ||
6268 | +GEN_VXFORM(vrlh, 2, 1); | ||
6269 | +GEN_VXFORM(vrlw, 2, 2); | ||
6267 | 6270 | ||
6268 | /*** SPE extension ***/ | 6271 | /*** SPE extension ***/ |
6269 | /* Register moves */ | 6272 | /* Register moves */ |