Commit 6cf1c6e5470aa68afdc1185fe289072cb06e8cf7

Authored by aurel32
1 parent 79f85c3a

Add vupk{h,l}s{b,h} 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@6177 c046a42c-6fe2-441c-8c8c-71466251a162
target-ppc/helper.h
... ... @@ -161,6 +161,10 @@ DEF_HELPER_3(vsplth, void, avr, avr, i32)
161 161 DEF_HELPER_3(vspltw, void, avr, avr, i32)
162 162 DEF_HELPER_2(vupkhpx, void, avr, avr)
163 163 DEF_HELPER_2(vupklpx, void, avr, avr)
  164 +DEF_HELPER_2(vupkhsb, void, avr, avr)
  165 +DEF_HELPER_2(vupkhsh, void, avr, avr)
  166 +DEF_HELPER_2(vupklsb, void, avr, avr)
  167 +DEF_HELPER_2(vupklsh, void, avr, avr)
164 168  
165 169 DEF_HELPER_1(efscfsi, i32, i32)
166 170 DEF_HELPER_1(efscfui, i32, i32)
... ...
target-ppc/op_helper.c
... ... @@ -2274,6 +2274,27 @@ VUPKPX(lpx, UPKLO)
2274 2274 VUPKPX(hpx, UPKHI)
2275 2275 #undef VUPKPX
2276 2276  
  2277 +#define VUPK(suffix, unpacked, packee, hi) \
  2278 + void helper_vupk##suffix (ppc_avr_t *r, ppc_avr_t *b) \
  2279 + { \
  2280 + int i; \
  2281 + ppc_avr_t result; \
  2282 + if (hi) { \
  2283 + for (i = 0; i < ARRAY_SIZE(r->unpacked); i++) { \
  2284 + result.unpacked[i] = b->packee[i]; \
  2285 + } \
  2286 + } else { \
  2287 + for (i = ARRAY_SIZE(r->unpacked); i < ARRAY_SIZE(r->packee); i++) { \
  2288 + result.unpacked[i-ARRAY_SIZE(r->unpacked)] = b->packee[i]; \
  2289 + } \
  2290 + } \
  2291 + *r = result; \
  2292 + }
  2293 +VUPK(hsb, s16, s8, UPKHI)
  2294 +VUPK(hsh, s32, s16, UPKHI)
  2295 +VUPK(lsb, s16, s8, UPKLO)
  2296 +VUPK(lsh, s32, s16, UPKLO)
  2297 +#undef VUPK
2277 2298 #undef UPKHI
2278 2299 #undef UPKLO
2279 2300  
... ...
target-ppc/translate.c
... ... @@ -6289,6 +6289,10 @@ GEN_VXFORM(vrlw, 2, 2);
6289 6289 tcg_temp_free_ptr(rd); \
6290 6290 }
6291 6291  
  6292 +GEN_VXFORM_NOA(vupkhsb, 7, 8);
  6293 +GEN_VXFORM_NOA(vupkhsh, 7, 9);
  6294 +GEN_VXFORM_NOA(vupklsb, 7, 10);
  6295 +GEN_VXFORM_NOA(vupklsh, 7, 11);
6292 6296 GEN_VXFORM_NOA(vupkhpx, 7, 13);
6293 6297 GEN_VXFORM_NOA(vupklpx, 7, 15);
6294 6298  
... ...