All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Greg Kurz" <groug@kaod.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-arm@nongnu.org, qemu-ppc@nongnu.org,
	"David Gibson" <david@gibson.dropbear.id.au>
Subject: [PATCH 1/4] target/alpha: Use tcg_constant_i64() in gen_call_pal()
Date: Sun, 24 Oct 2021 18:16:16 +0200	[thread overview]
Message-ID: <20211024161619.325903-2-f4bug@amsat.org> (raw)
In-Reply-To: <20211024161619.325903-1-f4bug@amsat.org>

Avoid using a TCG temporary by moving the flag and
exception address to the constant pool.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/alpha/translate.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/target/alpha/translate.c b/target/alpha/translate.c
index a4c3f43e720..326d4216aad 100644
--- a/target/alpha/translate.c
+++ b/target/alpha/translate.c
@@ -1191,20 +1191,17 @@ static DisasJumpType gen_call_pal(DisasContext *ctx, int palcode)
     return gen_excp(ctx, EXCP_CALL_PAL, palcode);
 #else
     {
-        TCGv tmp = tcg_temp_new();
         uint64_t exc_addr = ctx->base.pc_next;
         uint64_t entry = ctx->palbr;
 
         if (ctx->tbflags & ENV_FLAG_PAL_MODE) {
             exc_addr |= 1;
         } else {
-            tcg_gen_movi_i64(tmp, 1);
-            st_flag_byte(tmp, ENV_FLAG_PAL_SHIFT);
+            st_flag_byte(tcg_constant_i64(1), ENV_FLAG_PAL_SHIFT);
         }
 
-        tcg_gen_movi_i64(tmp, exc_addr);
-        tcg_gen_st_i64(tmp, cpu_env, offsetof(CPUAlphaState, exc_addr));
-        tcg_temp_free(tmp);
+        tcg_gen_st_i64(tcg_constant_i64(exc_addr),
+                       cpu_env, offsetof(CPUAlphaState, exc_addr));
 
         entry += (palcode & 0x80
                   ? 0x2000 + (palcode - 0x80) * 64
-- 
2.31.1



  reply	other threads:[~2021-10-24 16:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-24 16:16 [PATCH 0/4] target/alpha,arm,ppc: More uses of tcg_constant() Philippe Mathieu-Daudé
2021-10-24 16:16 ` Philippe Mathieu-Daudé [this message]
2021-10-24 21:19   ` [PATCH 1/4] target/alpha: Use tcg_constant_i64() in gen_call_pal() Richard Henderson
2021-10-24 16:16 ` [PATCH 2/4] target/arm: Use tcg_constant_i64() in do_sat_addsub_64() Philippe Mathieu-Daudé
2021-10-24 21:24   ` Richard Henderson
2021-10-24 16:16 ` [PATCH 3/4] target/ppc: Use tcg_constant_tl() in gen_op_cmp() Philippe Mathieu-Daudé
2021-10-24 21:25   ` Richard Henderson
2021-10-25  0:21   ` David Gibson
2021-10-24 16:16 ` [PATCH 4/4] target/ppc: Use tcg_constant_i32() in gen_ld/st() Philippe Mathieu-Daudé
2021-10-24 21:27   ` Richard Henderson
2021-10-25  0:21   ` David Gibson

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=20211024161619.325903-2-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.