Commit f6b19645485237c9ce98409834b97b6a6bf0c0dd

Authored by aurel32
1 parent 34ba2857

Add vrfi{m,n,p,z} 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@6512 c046a42c-6fe2-441c-8c8c-71466251a162
target-ppc/helper.h
... ... @@ -232,6 +232,10 @@ DEF_HELPER_3(vsum2sws, void, avr, avr, avr)
232 232 DEF_HELPER_3(vsum4sbs, void, avr, avr, avr)
233 233 DEF_HELPER_3(vsum4shs, void, avr, avr, avr)
234 234 DEF_HELPER_3(vsum4ubs, void, avr, avr, avr)
  235 +DEF_HELPER_2(vrfim, void, avr, avr)
  236 +DEF_HELPER_2(vrfin, void, avr, avr)
  237 +DEF_HELPER_2(vrfip, void, avr, avr)
  238 +DEF_HELPER_2(vrfiz, void, avr, avr)
235 239  
236 240 DEF_HELPER_1(efscfsi, i32, i32)
237 241 DEF_HELPER_1(efscfui, i32, i32)
... ...
target-ppc/op_helper.c
... ... @@ -2490,6 +2490,24 @@ VPK(uwum, u32, u16, I, 0)
2490 2490 #undef VPK
2491 2491 #undef PKBIG
2492 2492  
  2493 +#define VRFI(suffix, rounding) \
  2494 + void helper_vrfi##suffix (ppc_avr_t *r, ppc_avr_t *b) \
  2495 + { \
  2496 + int i; \
  2497 + float_status s = env->vec_status; \
  2498 + set_float_rounding_mode(rounding, &s); \
  2499 + for (i = 0; i < ARRAY_SIZE(r->f); i++) { \
  2500 + HANDLE_NAN1(r->f[i], b->f[i]) { \
  2501 + r->f[i] = float32_round_to_int (b->f[i], &s); \
  2502 + } \
  2503 + } \
  2504 + }
  2505 +VRFI(n, float_round_nearest_even)
  2506 +VRFI(m, float_round_down)
  2507 +VRFI(p, float_round_up)
  2508 +VRFI(z, float_round_to_zero)
  2509 +#undef VRFI
  2510 +
2493 2511 #define VROTATE(suffix, element) \
2494 2512 void helper_vrl##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
2495 2513 { \
... ...
target-ppc/translate.c
... ... @@ -6468,6 +6468,10 @@ GEN_VXFORM_NOA(vupklsb, 7, 10);
6468 6468 GEN_VXFORM_NOA(vupklsh, 7, 11);
6469 6469 GEN_VXFORM_NOA(vupkhpx, 7, 13);
6470 6470 GEN_VXFORM_NOA(vupklpx, 7, 15);
  6471 +GEN_VXFORM_NOA(vrfim, 5, 8);
  6472 +GEN_VXFORM_NOA(vrfin, 5, 9);
  6473 +GEN_VXFORM_NOA(vrfip, 5, 10);
  6474 +GEN_VXFORM_NOA(vrfiz, 5, 11);
6471 6475  
6472 6476 #define GEN_VXFORM_SIMM(name, opc2, opc3) \
6473 6477 GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC) \
... ...