From: David Gibson <david@gibson.dropbear.id.au>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Richard Henderson <richard.henderson@linaro.org>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
Greg Kurz <groug@kaod.org>
Subject: Re: [PATCH 1/2] target/ppc: Use tcg_constant_i32() in gen_setb()
Date: Tue, 5 Oct 2021 11:46:02 +1100 [thread overview]
Message-ID: <YVugSuz+LtDYYvD1@yekko> (raw)
In-Reply-To: <20211003141711.3673181-2-f4bug@amsat.org>
[-- Attachment #1: Type: text/plain, Size: 1480 bytes --]
On Sun, Oct 03, 2021 at 04:17:10PM +0200, Philippe Mathieu-Daudé wrote:
> Avoid using TCG temporaries for the -1 and 8 constant values.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Both patches applied to ppc-for-6.2, thanks.
> ---
> target/ppc/translate.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/target/ppc/translate.c b/target/ppc/translate.c
> index b985e9e55bc..193d8e89152 100644
> --- a/target/ppc/translate.c
> +++ b/target/ppc/translate.c
> @@ -5074,19 +5074,15 @@ static void gen_mtspr(DisasContext *ctx)
> static void gen_setb(DisasContext *ctx)
> {
> TCGv_i32 t0 = tcg_temp_new_i32();
> - TCGv_i32 t8 = tcg_temp_new_i32();
> - TCGv_i32 tm1 = tcg_temp_new_i32();
> + TCGv_i32 t8 = tcg_constant_i32(8);
> + TCGv_i32 tm1 = tcg_constant_i32(-1);
> int crf = crfS(ctx->opcode);
>
> tcg_gen_setcondi_i32(TCG_COND_GEU, t0, cpu_crf[crf], 4);
> - tcg_gen_movi_i32(t8, 8);
> - tcg_gen_movi_i32(tm1, -1);
> tcg_gen_movcond_i32(TCG_COND_GEU, t0, cpu_crf[crf], t8, tm1, t0);
> tcg_gen_ext_i32_tl(cpu_gpr[rD(ctx->opcode)], t0);
>
> tcg_temp_free_i32(t0);
> - tcg_temp_free_i32(t8);
> - tcg_temp_free_i32(tm1);
> }
> #endif
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2021-10-05 1:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-03 14:17 [PATCH 0/2] target/ppc: Use tcg_constant_* Philippe Mathieu-Daudé
2021-10-03 14:17 ` [PATCH 1/2] target/ppc: Use tcg_constant_i32() in gen_setb() Philippe Mathieu-Daudé
2021-10-03 15:21 ` Richard Henderson
2021-10-05 0:46 ` David Gibson [this message]
2021-10-03 14:17 ` [PATCH 2/2] target/ppc: Use tcg_constant_i64() in gen_brh() Philippe Mathieu-Daudé
2021-10-03 15:22 ` Richard Henderson
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=YVugSuz+LtDYYvD1@yekko \
--to=david@gibson.dropbear.id.au \
--cc=f4bug@amsat.org \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).