Commit 6e87b7c7bf4ead3ef2d59a657608901334da35cb

Authored by aurel32
1 parent cf8358c8

Make mtvscr use a helper

Do this so we can set float statuses once per mtvscr, rather than once
per Altivec 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@6508 c046a42c-6fe2-441c-8c8c-71466251a162
target-ppc/helper.h
@@ -220,6 +220,7 @@ DEF_HELPER_4(vmsumuhs, void, avr, avr, avr, avr) @@ -220,6 +220,7 @@ DEF_HELPER_4(vmsumuhs, void, avr, avr, avr, avr)
220 DEF_HELPER_4(vmsumshm, void, avr, avr, avr, avr) 220 DEF_HELPER_4(vmsumshm, void, avr, avr, avr, avr)
221 DEF_HELPER_4(vmsumshs, void, avr, avr, avr, avr) 221 DEF_HELPER_4(vmsumshs, void, avr, avr, avr, avr)
222 DEF_HELPER_4(vmladduhm, void, avr, avr, avr, avr) 222 DEF_HELPER_4(vmladduhm, void, avr, avr, avr, avr)
  223 +DEF_HELPER_1(mtvscr, void, avr);
223 DEF_HELPER_2(lvebx, void, avr, tl) 224 DEF_HELPER_2(lvebx, void, avr, tl)
224 DEF_HELPER_2(lvehx, void, avr, tl) 225 DEF_HELPER_2(lvehx, void, avr, tl)
225 DEF_HELPER_2(lvewx, void, avr, tl) 226 DEF_HELPER_2(lvewx, void, avr, tl)
target-ppc/op_helper.c
@@ -2050,6 +2050,16 @@ STVE(stvewx, stl, bswap32, u32) @@ -2050,6 +2050,16 @@ STVE(stvewx, stl, bswap32, u32)
2050 #undef I 2050 #undef I
2051 #undef LVE 2051 #undef LVE
2052 2052
  2053 +void helper_mtvscr (ppc_avr_t *r)
  2054 +{
  2055 +#if defined(WORDS_BIGENDIAN)
  2056 + env->vscr = r->u32[3];
  2057 +#else
  2058 + env->vscr = r->u32[0];
  2059 +#endif
  2060 + set_flush_to_zero(vscr_nj, &env->vec_status);
  2061 +}
  2062 +
2053 void helper_vaddcuw (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) 2063 void helper_vaddcuw (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
2054 { 2064 {
2055 int i; 2065 int i;
target-ppc/translate.c
@@ -6268,15 +6268,14 @@ GEN_HANDLER(mfvscr, 0x04, 0x2, 0x18, 0x001ff800, PPC_ALTIVEC) @@ -6268,15 +6268,14 @@ GEN_HANDLER(mfvscr, 0x04, 0x2, 0x18, 0x001ff800, PPC_ALTIVEC)
6268 6268
6269 GEN_HANDLER(mtvscr, 0x04, 0x2, 0x19, 0x03ff0000, PPC_ALTIVEC) 6269 GEN_HANDLER(mtvscr, 0x04, 0x2, 0x19, 0x03ff0000, PPC_ALTIVEC)
6270 { 6270 {
6271 - TCGv_i32 t; 6271 + TCGv_ptr p;
6272 if (unlikely(!ctx->altivec_enabled)) { 6272 if (unlikely(!ctx->altivec_enabled)) {
6273 gen_exception(ctx, POWERPC_EXCP_VPU); 6273 gen_exception(ctx, POWERPC_EXCP_VPU);
6274 return; 6274 return;
6275 } 6275 }
6276 - t = tcg_temp_new_i32();  
6277 - tcg_gen_trunc_i64_i32(t, cpu_avrl[rD(ctx->opcode)]);  
6278 - tcg_gen_st_i32(t, cpu_env, offsetof(CPUState, vscr));  
6279 - tcg_temp_free_i32(t); 6276 + p = gen_avr_ptr(rD(ctx->opcode));
  6277 + gen_helper_mtvscr(p);
  6278 + tcg_temp_free_ptr(p);
6280 } 6279 }
6281 6280
6282 /* Logical operations */ 6281 /* Logical operations */