Commit 7872c51c1a2e78f7937c8f6efb47d9a8274135d8
1 parent
8e27dd6f
Add v{add,sub}u{b,h,w}m 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@6155 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
32 additions
and
0 deletions
target-ppc/helper.h
| @@ -96,6 +96,15 @@ DEF_HELPER_1(fres, i64, i64) | @@ -96,6 +96,15 @@ DEF_HELPER_1(fres, i64, i64) | ||
| 96 | DEF_HELPER_1(frsqrte, i64, i64) | 96 | DEF_HELPER_1(frsqrte, i64, i64) |
| 97 | DEF_HELPER_3(fsel, i64, i64, i64, i64) | 97 | DEF_HELPER_3(fsel, i64, i64, i64, i64) |
| 98 | 98 | ||
| 99 | +#define dh_alias_avr ptr | ||
| 100 | +#define dh_ctype_avr ppc_avr_t * | ||
| 101 | + | ||
| 102 | +DEF_HELPER_3(vaddubm, void, avr, avr, avr) | ||
| 103 | +DEF_HELPER_3(vadduhm, void, avr, avr, avr) | ||
| 104 | +DEF_HELPER_3(vadduwm, void, avr, avr, avr) | ||
| 105 | +DEF_HELPER_3(vsububm, void, avr, avr, avr) | ||
| 106 | +DEF_HELPER_3(vsubuhm, void, avr, avr, avr) | ||
| 107 | +DEF_HELPER_3(vsubuwm, void, avr, avr, avr) | ||
| 99 | DEF_HELPER_1(efscfsi, i32, i32) | 108 | DEF_HELPER_1(efscfsi, i32, i32) |
| 100 | DEF_HELPER_1(efscfui, i32, i32) | 109 | DEF_HELPER_1(efscfui, i32, i32) |
| 101 | DEF_HELPER_1(efscfuf, i32, i32) | 110 | DEF_HELPER_1(efscfuf, i32, i32) |
target-ppc/op_helper.c
| @@ -1971,6 +1971,23 @@ target_ulong helper_dlmzb (target_ulong high, target_ulong low, uint32_t update_ | @@ -1971,6 +1971,23 @@ target_ulong helper_dlmzb (target_ulong high, target_ulong low, uint32_t update_ | ||
| 1971 | for (index = ARRAY_SIZE(r->element)-1; index >= 0; index--) | 1971 | for (index = ARRAY_SIZE(r->element)-1; index >= 0; index--) |
| 1972 | #endif | 1972 | #endif |
| 1973 | 1973 | ||
| 1974 | +#define VARITH_DO(name, op, element) \ | ||
| 1975 | +void helper_v##name (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ | ||
| 1976 | +{ \ | ||
| 1977 | + int i; \ | ||
| 1978 | + for (i = 0; i < ARRAY_SIZE(r->element); i++) { \ | ||
| 1979 | + r->element[i] = a->element[i] op b->element[i]; \ | ||
| 1980 | + } \ | ||
| 1981 | +} | ||
| 1982 | +#define VARITH(suffix, element) \ | ||
| 1983 | + VARITH_DO(add##suffix, +, element) \ | ||
| 1984 | + VARITH_DO(sub##suffix, -, element) | ||
| 1985 | +VARITH(ubm, u8) | ||
| 1986 | +VARITH(uhm, u16) | ||
| 1987 | +VARITH(uwm, u32) | ||
| 1988 | +#undef VARITH_DO | ||
| 1989 | +#undef VARITH | ||
| 1990 | + | ||
| 1974 | #undef VECTOR_FOR_INORDER_I | 1991 | #undef VECTOR_FOR_INORDER_I |
| 1975 | #undef HI_IDX | 1992 | #undef HI_IDX |
| 1976 | #undef LO_IDX | 1993 | #undef LO_IDX |
target-ppc/translate.c
| @@ -6181,6 +6181,12 @@ GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC) \ | @@ -6181,6 +6181,12 @@ GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC) \ | ||
| 6181 | tcg_temp_free_ptr(rd); \ | 6181 | tcg_temp_free_ptr(rd); \ |
| 6182 | } | 6182 | } |
| 6183 | 6183 | ||
| 6184 | +GEN_VXFORM(vaddubm, 0, 0); | ||
| 6185 | +GEN_VXFORM(vadduhm, 0, 1); | ||
| 6186 | +GEN_VXFORM(vadduwm, 0, 2); | ||
| 6187 | +GEN_VXFORM(vsububm, 0, 16); | ||
| 6188 | +GEN_VXFORM(vsubuhm, 0, 17); | ||
| 6189 | +GEN_VXFORM(vsubuwm, 0, 18); | ||
| 6184 | /*** SPE extension ***/ | 6190 | /*** SPE extension ***/ |
| 6185 | /* Register moves */ | 6191 | /* Register moves */ |
| 6186 | 6192 |