Commit d79f08096c4475c785c8584878e722ba4d9ad800
1 parent
07ef34c3
Add vsl{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@6166 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
21 additions
and
0 deletions
target-ppc/helper.h
@@ -143,6 +143,9 @@ DEF_HELPER_3(vsraw, void, avr, avr, avr) | @@ -143,6 +143,9 @@ DEF_HELPER_3(vsraw, void, avr, avr, avr) | ||
143 | DEF_HELPER_3(vsrb, void, avr, avr, avr) | 143 | DEF_HELPER_3(vsrb, void, avr, avr, avr) |
144 | DEF_HELPER_3(vsrh, void, avr, avr, avr) | 144 | DEF_HELPER_3(vsrh, void, avr, avr, avr) |
145 | DEF_HELPER_3(vsrw, void, avr, avr, avr) | 145 | DEF_HELPER_3(vsrw, void, avr, avr, avr) |
146 | +DEF_HELPER_3(vslb, void, avr, avr, avr) | ||
147 | +DEF_HELPER_3(vslh, void, avr, avr, avr) | ||
148 | +DEF_HELPER_3(vslw, void, avr, avr, avr) | ||
146 | 149 | ||
147 | DEF_HELPER_1(efscfsi, i32, i32) | 150 | DEF_HELPER_1(efscfsi, i32, i32) |
148 | DEF_HELPER_1(efscfui, i32, i32) | 151 | DEF_HELPER_1(efscfui, i32, i32) |
target-ppc/op_helper.c
@@ -2088,6 +2088,21 @@ VMUL(uh, u16, u32) | @@ -2088,6 +2088,21 @@ VMUL(uh, u16, u32) | ||
2088 | #undef VMUL_DO | 2088 | #undef VMUL_DO |
2089 | #undef VMUL | 2089 | #undef VMUL |
2090 | 2090 | ||
2091 | +#define VSL(suffix, element) \ | ||
2092 | + void helper_vsl##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ | ||
2093 | + { \ | ||
2094 | + int i; \ | ||
2095 | + for (i = 0; i < ARRAY_SIZE(r->element); i++) { \ | ||
2096 | + unsigned int mask = ((1 << (3 + (sizeof (a->element[0]) >> 1))) - 1); \ | ||
2097 | + unsigned int shift = b->element[i] & mask; \ | ||
2098 | + r->element[i] = a->element[i] << shift; \ | ||
2099 | + } \ | ||
2100 | + } | ||
2101 | +VSL(b, u8) | ||
2102 | +VSL(h, u16) | ||
2103 | +VSL(w, u32) | ||
2104 | +#undef VSL | ||
2105 | + | ||
2091 | #define VSR(suffix, element) \ | 2106 | #define VSR(suffix, element) \ |
2092 | void helper_vsr##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ | 2107 | void helper_vsr##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ |
2093 | { \ | 2108 | { \ |
target-ppc/translate.c
@@ -6219,6 +6219,9 @@ GEN_VXFORM(vmuleub, 4, 8); | @@ -6219,6 +6219,9 @@ GEN_VXFORM(vmuleub, 4, 8); | ||
6219 | GEN_VXFORM(vmuleuh, 4, 9); | 6219 | GEN_VXFORM(vmuleuh, 4, 9); |
6220 | GEN_VXFORM(vmulesb, 4, 12); | 6220 | GEN_VXFORM(vmulesb, 4, 12); |
6221 | GEN_VXFORM(vmulesh, 4, 13); | 6221 | GEN_VXFORM(vmulesh, 4, 13); |
6222 | +GEN_VXFORM(vslb, 2, 4); | ||
6223 | +GEN_VXFORM(vslh, 2, 5); | ||
6224 | +GEN_VXFORM(vslw, 2, 6); | ||
6222 | GEN_VXFORM(vsrb, 2, 8); | 6225 | GEN_VXFORM(vsrb, 2, 8); |
6223 | GEN_VXFORM(vsrh, 2, 9); | 6226 | GEN_VXFORM(vsrh, 2, 9); |
6224 | GEN_VXFORM(vsrw, 2, 10); | 6227 | GEN_VXFORM(vsrw, 2, 10); |