From a63e54967334ae3ef76e78f245b4c0662a1471ce Mon Sep 17 00:00:00 2001 From: Yongbok Kim Date: Tue, 3 Jul 2018 01:01:00 -0400 Subject: [PATCH] target/mips: Fix data type for offset Offset can be larger than 16 bit from nanoMIPS, and immediate field can be larger than 16 bits as well. Backports commit 72e1f16f18fe62504f8f25d7a3f6813b24b221be from qemu --- qemu/target/mips/translate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qemu/target/mips/translate.c b/qemu/target/mips/translate.c index bb182666..196d3deb 100644 --- a/qemu/target/mips/translate.c +++ b/qemu/target/mips/translate.c @@ -2123,7 +2123,7 @@ OP_ST_ATOMIC(scd,st64,ld64,0x7); #undef OP_ST_ATOMIC static void gen_base_offset_addr (DisasContext *ctx, TCGv addr, - int base, int16_t offset) + int base, int offset) { TCGContext *tcg_ctx = ctx->uc->tcg_ctx; TCGv *cpu_gpr = tcg_ctx->cpu_gpr; @@ -2153,7 +2153,7 @@ static target_ulong pc_relative_pc (DisasContext *ctx) /* Load */ static void gen_ld(DisasContext *ctx, uint32_t opc, - int rt, int base, int16_t offset) + int rt, int base, int offset) { TCGContext *tcg_ctx = ctx->uc->tcg_ctx; TCGv t0, t1, t2; @@ -2351,7 +2351,7 @@ static void gen_ld(DisasContext *ctx, uint32_t opc, /* Store */ static void gen_st (DisasContext *ctx, uint32_t opc, int rt, - int base, int16_t offset) + int base, int offset) { TCGContext *tcg_ctx = ctx->uc->tcg_ctx; TCGv t0 = tcg_temp_new(tcg_ctx); @@ -2524,7 +2524,7 @@ static void gen_cop1_ldst(DisasContext *ctx, uint32_t op, int rt, /* Arithmetic with immediate operand */ static void gen_arith_imm(DisasContext *ctx, uint32_t opc, - int rt, int rs, int16_t imm) + int rt, int rs, int imm) { TCGContext *tcg_ctx = ctx->uc->tcg_ctx; TCGv *cpu_gpr = tcg_ctx->cpu_gpr;