target/ppc: decode target register in VSX_VECTOR_LOAD_STORE_LENGTH at translation time

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20190616123751.781-14-mark.cave-ayland@ilande.co.uk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Mark Cave-Ayland 2019-06-16 13:37:49 +01:00 committed by David Gibson
parent 6ae4a57ab0
commit 2aba168e50
3 changed files with 30 additions and 31 deletions

View file

@ -279,10 +279,10 @@ DEF_HELPER_3(stvebx, void, env, avr, tl)
DEF_HELPER_3(stvehx, void, env, avr, tl) DEF_HELPER_3(stvehx, void, env, avr, tl)
DEF_HELPER_3(stvewx, void, env, avr, tl) DEF_HELPER_3(stvewx, void, env, avr, tl)
#if defined(TARGET_PPC64) #if defined(TARGET_PPC64)
DEF_HELPER_4(lxvl, void, env, tl, tl, tl) DEF_HELPER_4(lxvl, void, env, tl, vsr, tl)
DEF_HELPER_4(lxvll, void, env, tl, tl, tl) DEF_HELPER_4(lxvll, void, env, tl, vsr, tl)
DEF_HELPER_4(stxvl, void, env, tl, tl, tl) DEF_HELPER_4(stxvl, void, env, tl, vsr, tl)
DEF_HELPER_4(stxvll, void, env, tl, tl, tl) DEF_HELPER_4(stxvll, void, env, tl, vsr, tl)
#endif #endif
DEF_HELPER_4(vsumsws, void, env, avr, avr, avr) DEF_HELPER_4(vsumsws, void, env, avr, avr, avr)
DEF_HELPER_4(vsum2sws, void, env, avr, avr, avr) DEF_HELPER_4(vsum2sws, void, env, avr, avr, avr)

View file

@ -415,9 +415,8 @@ STVE(stvewx, cpu_stl_data_ra, bswap32, u32)
#define VSX_LXVL(name, lj) \ #define VSX_LXVL(name, lj) \
void helper_##name(CPUPPCState *env, target_ulong addr, \ void helper_##name(CPUPPCState *env, target_ulong addr, \
target_ulong xt_num, target_ulong rb) \ ppc_vsr_t *xt, target_ulong rb) \
{ \ { \
ppc_vsr_t *xt = &env->vsr[xt_num]; \
ppc_vsr_t t; \ ppc_vsr_t t; \
uint64_t nb = GET_NB(rb); \ uint64_t nb = GET_NB(rb); \
int i; \ int i; \
@ -446,9 +445,8 @@ VSX_LXVL(lxvll, 1)
#define VSX_STXVL(name, lj) \ #define VSX_STXVL(name, lj) \
void helper_##name(CPUPPCState *env, target_ulong addr, \ void helper_##name(CPUPPCState *env, target_ulong addr, \
target_ulong xt_num, target_ulong rb) \ ppc_vsr_t *xt, target_ulong rb) \
{ \ { \
ppc_vsr_t *xt = &env->vsr[xt_num]; \
target_ulong nb = GET_NB(rb); \ target_ulong nb = GET_NB(rb); \
int i; \ int i; \
\ \

View file

@ -344,29 +344,30 @@ VSX_VECTOR_STORE(stxv, st_i64, 0)
VSX_VECTOR_STORE(stxvx, st_i64, 1) VSX_VECTOR_STORE(stxvx, st_i64, 1)
#ifdef TARGET_PPC64 #ifdef TARGET_PPC64
#define VSX_VECTOR_LOAD_STORE_LENGTH(name) \ #define VSX_VECTOR_LOAD_STORE_LENGTH(name) \
static void gen_##name(DisasContext *ctx) \ static void gen_##name(DisasContext *ctx) \
{ \ { \
TCGv EA, xt; \ TCGv EA; \
\ TCGv_ptr xt; \
if (xT(ctx->opcode) < 32) { \ \
if (unlikely(!ctx->vsx_enabled)) { \ if (xT(ctx->opcode) < 32) { \
gen_exception(ctx, POWERPC_EXCP_VSXU); \ if (unlikely(!ctx->vsx_enabled)) { \
return; \ gen_exception(ctx, POWERPC_EXCP_VSXU); \
} \ return; \
} else { \ } \
if (unlikely(!ctx->altivec_enabled)) { \ } else { \
gen_exception(ctx, POWERPC_EXCP_VPU); \ if (unlikely(!ctx->altivec_enabled)) { \
return; \ gen_exception(ctx, POWERPC_EXCP_VPU); \
} \ return; \
} \ } \
EA = tcg_temp_new(); \ } \
xt = tcg_const_tl(xT(ctx->opcode)); \ EA = tcg_temp_new(); \
gen_set_access_type(ctx, ACCESS_INT); \ xt = gen_vsr_ptr(xT(ctx->opcode)); \
gen_addr_register(ctx, EA); \ gen_set_access_type(ctx, ACCESS_INT); \
gen_helper_##name(cpu_env, EA, xt, cpu_gpr[rB(ctx->opcode)]); \ gen_addr_register(ctx, EA); \
tcg_temp_free(EA); \ gen_helper_##name(cpu_env, EA, xt, cpu_gpr[rB(ctx->opcode)]); \
tcg_temp_free(xt); \ tcg_temp_free(EA); \
tcg_temp_free_ptr(xt); \
} }
VSX_VECTOR_LOAD_STORE_LENGTH(lxvl) VSX_VECTOR_LOAD_STORE_LENGTH(lxvl)