qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/6] target/mips: Convert Loongson DIV.G opcodes to decodetre


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 3/6] target/mips: Convert Loongson DIV.G opcodes to decodetree
Date: Tue, 12 Jan 2021 22:59:41 +0100

On Tue, Jan 12, 2021 at 10:55 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> DIV.G and DDIV.G are very similar. Provide gen_lext_DIV_G() a
> 'is_double' argument so it can generate DIV.G (divide 32-bit
> signed integers).
>
> With this commit we explicit the template used to generate
> opcode for 32/64-bit word variants. Next commits will be less
> verbose by providing both variants at once.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  target/mips/godson2.decode    |  1 +
>  target/mips/loong-ext.decode  |  1 +
>  target/mips/loong_translate.c | 28 ++++++++++++++++++++++------
>  target/mips/translate.c       | 26 --------------------------
>  4 files changed, 24 insertions(+), 32 deletions(-)
...
> @@ -51,18 +54,26 @@ static bool gen_lext_DIV_G(DisasContext *s, int rd, int 
> rs, int rt)
>      gen_load_gpr(t0, rs);
>      gen_load_gpr(t1, rt);
>
> +    if (!is_double) {
> +        tcg_gen_ext32s_tl(t0, t0);
> +        tcg_gen_ext32s_tl(t0, t0);

Oops copy/paste problem...

> +        tcg_gen_ext32s_tl(t1, t1);
> +    }
>      tcg_gen_brcondi_tl(TCG_COND_NE, t1, 0, l1);
>      tcg_gen_movi_tl(cpu_gpr[rd], 0);
>      tcg_gen_br(l3);
>      gen_set_label(l1);
...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]