aboutsummaryrefslogtreecommitdiff
path: root/target/mips
diff options
context:
space:
mode:
authorYongbok Kim <yongbok.kim@mips.com>2018-06-20 13:05:58 +0100
committerAleksandar Markovic <amarkovic@wavecomp.com>2018-06-27 20:13:17 +0200
commitb52d3bfa2d54d99ef25f6d008815eecc53b67bfe (patch)
treedcdb1b39a2eff3a2ee50366318cb4c093509f02a /target/mips
parent0305d194be1dbda09fa7a7c883894030d07c355f (diff)
target/mips: Update gen_flt_ldst()
Update gen_flt_ldst() in order to reuse the functions for nanoMIPS Signed-off-by: Yongbok Kim <yongbok.kim@mips.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Aleksandar Markovic <aleksandar.markovic@mips.com> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@mips.com>
Diffstat (limited to 'target/mips')
-rw-r--r--target/mips/translate.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/target/mips/translate.c b/target/mips/translate.c
index 2eb211ae8c..e923d2739b 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -2433,11 +2433,8 @@ static void gen_st_cond (DisasContext *ctx, uint32_t opc, int rt,
/* Load and store */
static void gen_flt_ldst (DisasContext *ctx, uint32_t opc, int ft,
- int base, int16_t offset)
+ TCGv t0)
{
- TCGv t0 = tcg_temp_new();
-
- gen_base_offset_addr(ctx, t0, base, offset);
/* Don't do NOP if destination is zero: we must perform the actual
memory access. */
switch (opc) {
@@ -2480,15 +2477,15 @@ static void gen_flt_ldst (DisasContext *ctx, uint32_t opc, int ft,
default:
MIPS_INVAL("flt_ldst");
generate_exception_end(ctx, EXCP_RI);
- goto out;
+ break;
}
- out:
- tcg_temp_free(t0);
}
static void gen_cop1_ldst(DisasContext *ctx, uint32_t op, int rt,
int rs, int16_t imm)
{
+ TCGv t0 = tcg_temp_new();
+
if (ctx->CP0_Config1 & (1 << CP0C1_FP)) {
check_cp1_enabled(ctx);
switch (op) {
@@ -2497,11 +2494,13 @@ static void gen_cop1_ldst(DisasContext *ctx, uint32_t op, int rt,
check_insn(ctx, ISA_MIPS2);
/* Fallthrough */
default:
- gen_flt_ldst(ctx, op, rt, rs, imm);
+ gen_base_offset_addr(ctx, t0, rs, imm);
+ gen_flt_ldst(ctx, op, rt, t0);
}
} else {
generate_exception_err(ctx, EXCP_CpU, 1);
}
+ tcg_temp_free(t0);
}
/* Arithmetic with immediate operand */