From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Laurent Vivier <laurent@vivier.eu>, Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [Qemu-devel] [PATCH 6/6] target/m68k: Reduce the scope of the 'zero' tcg_temp
Date: Sun, 10 Mar 2019 01:34:28 +0100 [thread overview]
Message-ID: <20190310003428.11723-7-f4bug@amsat.org> (raw)
In-Reply-To: <20190310003428.11723-1-f4bug@amsat.org>
Reduce the scope of the 'zero' tcg_temp. Since this tcg_temp is
allocated with tcg_const_i32(), free it using tcg_temp_free_i32().
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/m68k/translate.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index b51b8a2a12..3f27079379 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -3664,7 +3664,7 @@ static void rotate_x_flags(TCGv reg, TCGv X, int size)
/* Result of rotate_x() is valid if 0 <= shift <= size */
static TCGv rotate_x(TCGv reg, TCGv shift, int left, int size)
{
- TCGv X, shl, shr, shx, sz, zero;
+ TCGv X, shl, shr, shx, sz;
sz = tcg_const_i32(size);
@@ -3672,14 +3672,14 @@ static TCGv rotate_x(TCGv reg, TCGv shift, int left, int size)
shl = tcg_temp_new();
shx = tcg_temp_new();
if (left) {
+ TCGv zero = tcg_const_i32(0);
tcg_gen_mov_i32(shl, shift); /* shl = shift */
tcg_gen_movi_i32(shr, size + 1);
tcg_gen_sub_i32(shr, shr, shift); /* shr = size + 1 - shift */
tcg_gen_subi_i32(shx, shift, 1); /* shx = shift - 1 */
/* shx = shx < 0 ? size : shx; */
- zero = tcg_const_i32(0);
tcg_gen_movcond_i32(TCG_COND_LT, shx, shx, zero, sz, shx);
- tcg_temp_free(zero);
+ tcg_temp_free_i32(zero);
} else {
tcg_gen_mov_i32(shr, shift); /* shr = shift */
tcg_gen_movi_i32(shl, size + 1);
--
2.19.1
next prev parent reply other threads:[~2019-03-10 0:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-10 0:34 [Qemu-devel] [PATCH 0/6] target/m68k: Optimize few instructions using deposit/extraxt_i32() Philippe Mathieu-Daudé
2019-03-10 0:34 ` [Qemu-devel] [PATCH 1/6] target/m68k: Reduce the l1 TCGLabel scope Philippe Mathieu-Daudé
2019-03-11 14:46 ` Richard Henderson
2019-03-10 0:34 ` [Qemu-devel] [PATCH 2/6] target/m68k: Optimize the partset instruction using deposit_i32() Philippe Mathieu-Daudé
2019-03-11 14:46 ` Richard Henderson
2019-03-10 0:34 ` [Qemu-devel] [PATCH 3/6] target/m68k: Fix a tcg_temp leak Philippe Mathieu-Daudé
2019-03-11 14:48 ` Richard Henderson
2019-03-10 0:34 ` [Qemu-devel] [PATCH 4/6] target/m68k: Optimize get_sr() using deposit_i32() Philippe Mathieu-Daudé
2019-03-11 14:52 ` Richard Henderson
2019-03-10 0:34 ` [Qemu-devel] [PATCH 5/6] target/m68k: Optimize rotate_x() using extract_i32() Philippe Mathieu-Daudé
2019-03-11 14:59 ` Richard Henderson
2019-03-10 0:34 ` Philippe Mathieu-Daudé [this message]
2019-03-11 14:58 ` [Qemu-devel] [PATCH 6/6] target/m68k: Reduce the scope of the 'zero' tcg_temp 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=20190310003428.11723-7-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).