qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>,
	Marcin Nowakowski <marcin.nowakowski@fungible.com>,
	qemu-devel@nongnu.org
Cc: Aurelien Jarno <aurelien@aurel32.net>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
Subject: Re: [PATCH 1/3] target/mips: fix JALS32/J32 instruction handling for microMIPS
Date: Wed, 15 Feb 2023 21:50:24 +0100	[thread overview]
Message-ID: <92e0e4dd-0aee-7d12-06b5-eb087766e087@linaro.org> (raw)
In-Reply-To: <645427aa-2630-a2be-9f1a-bee60a2d2885@linaro.org>

On 15/2/23 21:21, Richard Henderson wrote:
> 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.

Yes, this is the approach taken in decodetree conversion.

I hope to rebase / respin incorporating Jiaxun patches some day...

> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> 
> 
> r~



  reply	other threads:[~2023-02-15 20:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15  8:47 [PATCH 0/3] target/mips: misc microMIPS fixes Marcin Nowakowski
2023-02-15  8:47 ` [PATCH 1/3] target/mips: fix JALS32/J32 instruction handling for microMIPS Marcin Nowakowski
2023-02-15 20:21   ` Richard Henderson
2023-02-15 20:50     ` Philippe Mathieu-Daudé [this message]
2023-02-16  1:31       ` Jiaxun Yang
2023-02-15  8:47 ` [PATCH 2/3] target/mips: fix SWM32 handling for micromips Marcin Nowakowski
2023-02-15 10:51   ` Philippe Mathieu-Daudé
2023-02-15  8:47 ` [PATCH 3/3] target/mips: implement CP0.Config7.WII bit support Marcin Nowakowski
2023-02-15 18:33   ` Philippe Mathieu-Daudé
2023-02-15 19:19     ` Marcin Nowakowski
2023-02-15 19:39       ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=92e0e4dd-0aee-7d12-06b5-eb087766e087@linaro.org \
    --to=philmd@linaro.org \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=aurelien@aurel32.net \
    --cc=jiaxun.yang@flygoat.com \
    --cc=marcin.nowakowski@fungible.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).