|
From: | Richard Henderson |
Subject: | Re: [PATCH 1/3] target/mips: fix JALS32/J32 instruction handling for microMIPS |
Date: | Wed, 15 Feb 2023 10:21:33 -1000 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 |
On 2/14/23 22:47, Marcin Nowakowski wrote:
@@ -4860,6 +4860,7 @@ static void gen_compute_branch(DisasContext *ctx, uint32_t opc, target_ulong btgt = -1; int blink = 0; int bcond_compute = 0; + int jal_mask = 0;
Better to limit the scope of the variable to the block below.
@@ -4917,6 +4918,11 @@ static void gen_compute_branch(DisasContext *ctx, uint32_t opc, break; case OPC_J: case OPC_JAL: + /* Jump to immediate */ + jal_mask = ctx->hflags & MIPS_HFLAG_M16 ? 0xF8000000 : 0xF0000000; + btgt = ((ctx->base.pc_next + insn_bytes) & jal_mask) | + (uint32_t)offset;
Ideally we wouldn't have one huge helper function, and could pass down the mask from the translator. But that's on-going cleanup.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
[Prev in Thread] | Current Thread | [Next in Thread] |