diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-04 22:10:09 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-04 22:10:09 +0000 |
commit | cd633b10fd99faeb01c94ba35ec35f48f4e86a68 (patch) | |
tree | 85086901caffc7c10bea78dbf4363fae756386fb /target-ppc/op_helper.c | |
parent | 5e1d0985f9cb5146f7feaa8a6aa223566ef0592a (diff) | |
download | qemu-cd633b10fd99faeb01c94ba35ec35f48f4e86a68.tar.gz qemu-cd633b10fd99faeb01c94ba35ec35f48f4e86a68.tar.bz2 qemu-cd633b10fd99faeb01c94ba35ec35f48f4e86a68.zip |
Add vsldoi instruction.
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@6171 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op_helper.c')
-rw-r--r-- | target-ppc/op_helper.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 7f149c5ad2..fc5f20eb25 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -2145,6 +2145,34 @@ VSL(h, u16) VSL(w, u32) #undef VSL +void helper_vsldoi (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, uint32_t shift) +{ + int sh = shift & 0xf; + int i; + ppc_avr_t result; + +#if defined(WORDS_BIGENDIAN) + for (i = 0; i < ARRAY_SIZE(r->u8); i++) { + int index = sh + i; + if (index > 0xf) { + result.u8[i] = b->u8[index-0x10]; + } else { + result.u8[i] = a->u8[index]; + } + } +#else + for (i = 0; i < ARRAY_SIZE(r->u8); i++) { + int index = (16 - sh) + i; + if (index > 0xf) { + result.u8[i] = a->u8[index-0x10]; + } else { + result.u8[i] = b->u8[index]; + } + } +#endif + *r = result; +} + void helper_vslo (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { int sh = (b->u8[LO_IDX*0xf] >> 3) & 0xf; |