diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-03 13:31:40 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-03 13:31:40 +0000 |
commit | 7872c51c1a2e78f7937c8f6efb47d9a8274135d8 (patch) | |
tree | 68c926f10b53bd1806ab9b71e10eac90e12d7c60 /target-ppc/op_helper.c | |
parent | 8e27dd6f09df9ca028edffae5df5b562d9d40cae (diff) |
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
Diffstat (limited to 'target-ppc/op_helper.c')
-rw-r--r-- | target-ppc/op_helper.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 5d603baedc..6d4bd1eb8d 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -1971,6 +1971,23 @@ target_ulong helper_dlmzb (target_ulong high, target_ulong low, uint32_t update_ for (index = ARRAY_SIZE(r->element)-1; index >= 0; index--) #endif +#define VARITH_DO(name, op, element) \ +void helper_v##name (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ +{ \ + int i; \ + for (i = 0; i < ARRAY_SIZE(r->element); i++) { \ + r->element[i] = a->element[i] op b->element[i]; \ + } \ +} +#define VARITH(suffix, element) \ + VARITH_DO(add##suffix, +, element) \ + VARITH_DO(sub##suffix, -, element) +VARITH(ubm, u8) +VARITH(uhm, u16) +VARITH(uwm, u32) +#undef VARITH_DO +#undef VARITH + #undef VECTOR_FOR_INORDER_I #undef HI_IDX #undef LO_IDX |