From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: Dragan Mladjenovic <Dragan.Mladjenovic@syrmia.com>,
Milica Lazarevic <milica.lazarevic@syrmia.com>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
Djordje Todorovic <djordje.todorovic@syrmia.com>,
Aurelien Jarno <aurelien@aurel32.net>,
Bernhard Beschow <shentey@gmail.com>
Subject: Re: [PATCH-for-8.0 v2 03/11] hw/mips/bootloader: Implement nanoMIPS SW opcode generator
Date: Mon, 12 Dec 2022 07:50:07 -0600 [thread overview]
Message-ID: <ace38f47-df82-11d0-b80f-7b9fbef585b4@linaro.org> (raw)
In-Reply-To: <20221211204533.85359-4-philmd@linaro.org>
On 12/11/22 14:45, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/mips/bootloader.c | 20 +++++++++++++++++++-
> 1 file changed, 19 insertions(+), 1 deletion(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
>
> diff --git a/hw/mips/bootloader.c b/hw/mips/bootloader.c
> index 0035f37335..3e1e73360f 100644
> --- a/hw/mips/bootloader.c
> +++ b/hw/mips/bootloader.c
> @@ -143,9 +143,27 @@ static void bl_gen_ori(void **p, bl_reg rt, bl_reg rs, uint16_t imm)
> bl_gen_i_type(p, 0x0d, rs, rt, imm);
> }
>
> +static void bl_gen_sw_nm(void **ptr, bl_reg rt, uint8_t rs, uint16_t ofs12)
> +{
> + uint32_t insn = 0;
> +
> + assert(extract32(ofs12, 0, 12) == ofs12);
> + insn = deposit32(insn, 26, 6, 0b100001);
> + insn = deposit32(insn, 21, 5, rt);
> + insn = deposit32(insn, 16, 5, rs);
> + insn = deposit32(insn, 12, 4, 0b1001);
> + insn = deposit32(insn, 0, 12, ofs12);
> +
> + st_nm32_p(ptr, insn);
> +}
> +
> static void bl_gen_sw(void **p, bl_reg rt, uint8_t base, uint16_t offset)
> {
> - bl_gen_i_type(p, 0x2b, base, rt, offset);
> + if (bootcpu_supports_isa(ISA_NANOMIPS32)) {
> + bl_gen_sw_nm(p, rt, base, offset);
> + } else {
> + bl_gen_i_type(p, 0x2b, base, rt, offset);
> + }
> }
>
> static void bl_gen_sd(void **p, bl_reg rt, uint8_t base, uint16_t offset)
next prev parent reply other threads:[~2022-12-12 13:50 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-11 20:45 [PATCH-for-8.0 v2 00/11] hw/mips/malta: Generate nanoMIPS bootloader with bootloader generator API Philippe Mathieu-Daudé
2022-12-11 20:45 ` [PATCH-for-8.0 v2 01/11] hw/mips/bootloader: Handle buffers as opaque arrays Philippe Mathieu-Daudé
2022-12-11 20:52 ` Philippe Mathieu-Daudé
2022-12-12 13:46 ` Richard Henderson
2022-12-11 20:45 ` [PATCH-for-8.0 v2 02/11] hw/mips/bootloader: Implement nanoMIPS NOP opcode generator Philippe Mathieu-Daudé
2022-12-11 20:45 ` [PATCH-for-8.0 v2 03/11] hw/mips/bootloader: Implement nanoMIPS SW " Philippe Mathieu-Daudé
2022-12-12 13:50 ` Richard Henderson [this message]
2022-12-11 20:45 ` [PATCH-for-8.0 v2 04/11] hw/mips/bootloader: Implement nanoMIPS LI (LUI+ORI) " Philippe Mathieu-Daudé
2022-12-12 13:52 ` Richard Henderson
2022-12-11 20:45 ` [PATCH-for-8.0 v2 05/11] hw/mips/bootloader: Implement nanoMIPS JALRc " Philippe Mathieu-Daudé
2022-12-12 13:55 ` Richard Henderson
2022-12-11 20:45 ` [PATCH-for-8.0 v2 06/11] hw/mips/malta: Use bootloader generator API for nanoMIPS CPUs (1/5) Philippe Mathieu-Daudé
2022-12-12 14:31 ` Richard Henderson
2022-12-11 20:45 ` [PATCH-for-8.0 v2 07/11] hw/mips/malta: Use bootloader generator API for nanoMIPS CPUs (2/5) Philippe Mathieu-Daudé
2022-12-12 14:35 ` Richard Henderson
2022-12-11 20:45 ` [PATCH-for-8.0 v2 08/11] hw/mips/malta: Use bootloader generator API for nanoMIPS CPUs (3/5) Philippe Mathieu-Daudé
2022-12-12 14:37 ` Richard Henderson
2022-12-11 20:45 ` [PATCH-for-8.0 v2 09/11] hw/mips/malta: Use bootloader generator API for nanoMIPS CPUs (4/5) Philippe Mathieu-Daudé
2022-12-12 14:40 ` Richard Henderson
2022-12-11 20:45 ` [PATCH-for-8.0 v2 10/11] hw/mips/malta: Use bootloader generator API for nanoMIPS CPUs (5/5) Philippe Mathieu-Daudé
2022-12-12 14:53 ` Richard Henderson
2022-12-11 20:45 ` [PATCH-for-8.0 v2 11/11] hw/mips/malta: Merge common BL code as bl_setup_gt64120_jump_kernel() Philippe Mathieu-Daudé
2022-12-12 14:58 ` Richard Henderson
2022-12-21 7:07 ` [PATCH-for-8.0 v2 00/11] hw/mips/malta: Generate nanoMIPS bootloader with bootloader generator API 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=ace38f47-df82-11d0-b80f-7b9fbef585b4@linaro.org \
--to=richard.henderson@linaro.org \
--cc=Dragan.Mladjenovic@syrmia.com \
--cc=aurelien@aurel32.net \
--cc=djordje.todorovic@syrmia.com \
--cc=jiaxun.yang@flygoat.com \
--cc=milica.lazarevic@syrmia.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=shentey@gmail.com \
/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).