Commit 1dd9ffb969c82e6edff5b0bff0b26519c6daa9c7
1 parent
5335a145
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
Showing
3 changed files
with
23 additions
and
0 deletions
target-ppc/helper.h
... | ... | @@ -177,6 +177,7 @@ DEF_HELPER_3(vpkuhus, void, avr, avr, avr) |
177 | 177 | DEF_HELPER_3(vpkuwus, void, avr, avr, avr) |
178 | 178 | DEF_HELPER_3(vpkuhum, void, avr, avr, avr) |
179 | 179 | DEF_HELPER_3(vpkuwum, void, avr, avr, avr) |
180 | +DEF_HELPER_3(vpkpx, void, avr, avr, avr) | |
180 | 181 | |
181 | 182 | DEF_HELPER_1(efscfsi, i32, i32) |
182 | 183 | DEF_HELPER_1(efscfui, i32, i32) | ... | ... |
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) |
2195 | 2195 | #else |
2196 | 2196 | #define PKBIG 0 |
2197 | 2197 | #endif |
2198 | +void helper_vpkpx (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) | |
2199 | +{ | |
2200 | + int i, j; | |
2201 | + ppc_avr_t result; | |
2202 | +#if defined(WORDS_BIGENDIAN) | |
2203 | + const ppc_avr_t *x[2] = { a, b }; | |
2204 | +#else | |
2205 | + const ppc_avr_t *x[2] = { b, a }; | |
2206 | +#endif | |
2207 | + | |
2208 | + VECTOR_FOR_INORDER_I (i, u64) { | |
2209 | + VECTOR_FOR_INORDER_I (j, u32){ | |
2210 | + uint32_t e = x[i]->u32[j]; | |
2211 | + result.u16[4*i+j] = (((e >> 9) & 0xfc00) | | |
2212 | + ((e >> 6) & 0x3e0) | | |
2213 | + ((e >> 3) & 0x1f)); | |
2214 | + } | |
2215 | + } | |
2216 | + *r = result; | |
2217 | +} | |
2218 | + | |
2198 | 2219 | #define VPK(suffix, from, to, cvt, dosat) \ |
2199 | 2220 | void helper_vpk##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ |
2200 | 2221 | { \ | ... | ... |
target-ppc/translate.c
... | ... | @@ -6281,6 +6281,7 @@ GEN_VXFORM(vpkshus, 7, 4); |
6281 | 6281 | GEN_VXFORM(vpkswus, 7, 5); |
6282 | 6282 | GEN_VXFORM(vpkshss, 7, 6); |
6283 | 6283 | GEN_VXFORM(vpkswss, 7, 7); |
6284 | +GEN_VXFORM(vpkpx, 7, 12); | |
6284 | 6285 | |
6285 | 6286 | #define GEN_VXFORM_NOA(name, opc2, opc3) \ |
6286 | 6287 | GEN_HANDLER(name, 0x04, opc2, opc3, 0x001f0000, PPC_ALTIVEC) \ | ... | ... |