diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-04 22:12:19 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-04 22:12:19 +0000 |
commit | 1dd9ffb969c82e6edff5b0bff0b26519c6daa9c7 (patch) | |
tree | 221fd7c9a579015bacd69aa83a59773637a59ef6 /target-ppc/op_helper.c | |
parent | 5335a145a178630a8d157cd927c5bd697d1e362e (diff) | |
download | hqemu-1dd9ffb969c82e6edff5b0bff0b26519c6daa9c7.zip hqemu-1dd9ffb969c82e6edff5b0bff0b26519c6daa9c7.tar.gz |
Add vpkpx 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@6183 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op_helper.c')
-rw-r--r-- | target-ppc/op_helper.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 1c82088..dcf1aef 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -2195,6 +2195,27 @@ void helper_vperm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c) #else #define PKBIG 0 #endif +void helper_vpkpx (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) +{ + int i, j; + ppc_avr_t result; +#if defined(WORDS_BIGENDIAN) + const ppc_avr_t *x[2] = { a, b }; +#else + const ppc_avr_t *x[2] = { b, a }; +#endif + + VECTOR_FOR_INORDER_I (i, u64) { + VECTOR_FOR_INORDER_I (j, u32){ + uint32_t e = x[i]->u32[j]; + result.u16[4*i+j] = (((e >> 9) & 0xfc00) | + ((e >> 6) & 0x3e0) | + ((e >> 3) & 0x1f)); + } + } + *r = result; +} + #define VPK(suffix, from, to, cvt, dosat) \ void helper_vpk##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ { \ |