diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-04 22:09:52 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-04 22:09:52 +0000 |
commit | 5e1d0985f9cb5146f7feaa8a6aa223566ef0592a (patch) | |
tree | 2704e133f890923df18c20dd8a4e8f753cccdbe5 /target-ppc | |
parent | bf8d8ded57a6c54d9ff8a55c35201301ff61ece7 (diff) | |
download | qemu-5e1d0985f9cb5146f7feaa8a6aa223566ef0592a.tar.gz qemu-5e1d0985f9cb5146f7feaa8a6aa223566ef0592a.tar.bz2 qemu-5e1d0985f9cb5146f7feaa8a6aa223566ef0592a.zip |
Add vrl{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@6170 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc')
-rw-r--r-- | target-ppc/helper.h | 3 | ||||
-rw-r--r-- | target-ppc/op_helper.c | 15 | ||||
-rw-r--r-- | target-ppc/translate.c | 3 |
3 files changed, 21 insertions, 0 deletions
diff --git a/target-ppc/helper.h b/target-ppc/helper.h index b18f4d2adb..16e1bf8ff7 100644 --- a/target-ppc/helper.h +++ b/target-ppc/helper.h @@ -152,6 +152,9 @@ DEF_HELPER_3(vaddcuw, void, avr, avr, avr) DEF_HELPER_3(vsubcuw, void, avr, avr, avr) DEF_HELPER_2(lvsl, void, avr, tl); DEF_HELPER_2(lvsr, void, avr, tl); +DEF_HELPER_3(vrlb, void, avr, avr, avr) +DEF_HELPER_3(vrlh, void, avr, avr, avr) +DEF_HELPER_3(vrlw, void, avr, avr, avr) DEF_HELPER_1(efscfsi, i32, i32) DEF_HELPER_1(efscfui, i32, i32) diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 9f3ef5921c..7f149c5ad2 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -2115,6 +2115,21 @@ VMUL(uh, u16, u32) #undef VMUL_DO #undef VMUL +#define VROTATE(suffix, element) \ + void helper_vrl##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) | (a->element[i] >> (sizeof(a->element[0]) * 8 - shift)); \ + } \ + } +VROTATE(b, u8) +VROTATE(h, u16) +VROTATE(w, u32) +#undef VROTATE + #define VSL(suffix, element) \ void helper_vsl##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ { \ diff --git a/target-ppc/translate.c b/target-ppc/translate.c index b1b8009cc9..93c4177d3b 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -6264,6 +6264,9 @@ GEN_VXFORM(vslo, 6, 16); GEN_VXFORM(vsro, 6, 17); GEN_VXFORM(vaddcuw, 0, 6); GEN_VXFORM(vsubcuw, 0, 22); +GEN_VXFORM(vrlb, 2, 0); +GEN_VXFORM(vrlh, 2, 1); +GEN_VXFORM(vrlw, 2, 2); /*** SPE extension ***/ /* Register moves */ |