diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-04 22:09:08 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-04 22:09:08 +0000 |
commit | d79f08096c4475c785c8584878e722ba4d9ad800 (patch) | |
tree | 56feedbbd55cc253ca9514b90fb5d280d2e5e8e5 /target-ppc/op_helper.c | |
parent | 07ef34c35eea5d25b873b614078ee8092a3631a5 (diff) | |
download | qemu-d79f08096c4475c785c8584878e722ba4d9ad800.zip |
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
Diffstat (limited to 'target-ppc/op_helper.c')
-rw-r--r-- | target-ppc/op_helper.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 648c50f63f..06c101c9ed 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -2088,6 +2088,21 @@ VMUL(uh, u16, u32) #undef VMUL_DO #undef VMUL +#define VSL(suffix, element) \ + void helper_vsl##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; \ + } \ + } +VSL(b, u8) +VSL(h, u16) +VSL(w, u32) +#undef VSL + #define VSR(suffix, element) \ void helper_vsr##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ { \ |