From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>,
Richard Henderson <rth@twiddle.net>,
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
Artyom Tarasenko <atar4qemu@gmail.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [Qemu-devel] [PATCH 8/8] target/sparc: optimize various functions using extract op
Date: Wed, 10 May 2017 17:05:35 -0300 [thread overview]
Message-ID: <20170510200535.13268-9-f4bug@amsat.org> (raw)
In-Reply-To: <20170510200535.13268-1-f4bug@amsat.org>
Applied using Coccinelle script.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/sparc/translate.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index aa6734d54e..a92b5c425c 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -380,29 +380,25 @@ static inline void gen_goto_tb(DisasContext *s, int tb_num,
static inline void gen_mov_reg_N(TCGv reg, TCGv_i32 src)
{
tcg_gen_extu_i32_tl(reg, src);
- tcg_gen_shri_tl(reg, reg, PSR_NEG_SHIFT);
- tcg_gen_andi_tl(reg, reg, 0x1);
+ tcg_gen_extract_tl(reg, reg, PSR_NEG_SHIFT, 0x1);
}
static inline void gen_mov_reg_Z(TCGv reg, TCGv_i32 src)
{
tcg_gen_extu_i32_tl(reg, src);
- tcg_gen_shri_tl(reg, reg, PSR_ZERO_SHIFT);
- tcg_gen_andi_tl(reg, reg, 0x1);
+ tcg_gen_extract_tl(reg, reg, PSR_ZERO_SHIFT, 0x1);
}
static inline void gen_mov_reg_V(TCGv reg, TCGv_i32 src)
{
tcg_gen_extu_i32_tl(reg, src);
- tcg_gen_shri_tl(reg, reg, PSR_OVF_SHIFT);
- tcg_gen_andi_tl(reg, reg, 0x1);
+ tcg_gen_extract_tl(reg, reg, PSR_OVF_SHIFT, 0x1);
}
static inline void gen_mov_reg_C(TCGv reg, TCGv_i32 src)
{
tcg_gen_extu_i32_tl(reg, src);
- tcg_gen_shri_tl(reg, reg, PSR_CARRY_SHIFT);
- tcg_gen_andi_tl(reg, reg, 0x1);
+ tcg_gen_extract_tl(reg, reg, PSR_CARRY_SHIFT, 0x1);
}
static inline void gen_op_add_cc(TCGv dst, TCGv src1, TCGv src2)
@@ -638,8 +634,7 @@ static inline void gen_op_mulscc(TCGv dst, TCGv src1, TCGv src2)
// env->y = (b2 << 31) | (env->y >> 1);
tcg_gen_andi_tl(r_temp, cpu_cc_src, 0x1);
tcg_gen_shli_tl(r_temp, r_temp, 31);
- tcg_gen_shri_tl(t0, cpu_y, 1);
- tcg_gen_andi_tl(t0, t0, 0x7fffffff);
+ tcg_gen_extract_tl(t0, cpu_y, 1, 0x7fffffff);
tcg_gen_or_tl(t0, t0, r_temp);
tcg_gen_andi_tl(cpu_y, t0, 0xffffffff);
--
2.11.0
next prev parent reply other threads:[~2017-05-10 20:06 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-10 20:05 [Qemu-devel] [PATCH 0/8] optimize various tcg_gen() functions using extract op Philippe Mathieu-Daudé
2017-05-10 20:05 ` [Qemu-devel] [PATCH 1/8] coccinelle: add a script to optimize tcg op using tcg_gen_extract() Philippe Mathieu-Daudé
2017-05-10 20:12 ` Eric Blake
2017-05-10 20:23 ` Philippe Mathieu-Daudé
2017-05-10 20:19 ` Richard Henderson
2017-05-10 20:23 ` Eric Blake
2017-05-10 21:27 ` Philippe Mathieu-Daudé
2017-05-10 23:52 ` [Qemu-devel] [RFC PATCH v2] " Philippe Mathieu-Daudé
2017-05-11 0:13 ` Philippe Mathieu-Daudé
2017-05-11 9:03 ` Markus Armbruster
2017-05-12 2:01 ` Philippe Mathieu-Daudé
2017-05-12 2:04 ` Philippe Mathieu-Daudé
2017-05-15 7:04 ` Markus Armbruster
2017-05-10 20:05 ` [Qemu-devel] [PATCH 2/8] target/arm: optimize smul_dual() and neon_trn_u8() using extract op Philippe Mathieu-Daudé
2017-05-10 20:15 ` Eric Blake
2017-05-12 2:49 ` Philippe Mathieu-Daudé
2017-05-10 20:20 ` Richard Henderson
2017-05-10 20:32 ` Philippe Mathieu-Daudé
2017-05-12 1:31 ` Philippe Mathieu-Daudé
2017-05-10 20:05 ` [Qemu-devel] [PATCH 3/8] target/arm: optimize rev16() " Philippe Mathieu-Daudé
2017-05-12 1:54 ` Philippe Mathieu-Daudé
2017-05-10 20:05 ` [Qemu-devel] [PATCH 4/8] target/cris: optimize gen_swapb() " Philippe Mathieu-Daudé
2017-05-12 1:29 ` Philippe Mathieu-Daudé
2017-05-10 20:05 ` [Qemu-devel] [PATCH 5/8] target/m68k: optimize bcd_flags() " Philippe Mathieu-Daudé
2017-05-11 8:41 ` Laurent Vivier
2017-05-12 1:52 ` Philippe Mathieu-Daudé
2017-05-10 20:05 ` [Qemu-devel] [PATCH 6/8] target/mips: optimize bshfl() " Philippe Mathieu-Daudé
2017-05-12 2:13 ` Philippe Mathieu-Daudé
2017-05-10 20:05 ` [Qemu-devel] [PATCH 7/8] target/ppc: optimize various functions " Philippe Mathieu-Daudé
2017-05-11 0:41 ` David Gibson
2017-05-11 8:46 ` [Qemu-devel] [Qemu-ppc] " Laurent Vivier
2017-05-12 5:13 ` David Gibson
2017-05-11 4:54 ` [Qemu-devel] " Nikunj A Dadhania
2017-05-12 1:48 ` Philippe Mathieu-Daudé
2017-05-12 5:16 ` David Gibson
2017-05-10 20:05 ` Philippe Mathieu-Daudé [this message]
2017-05-12 1:50 ` [Qemu-devel] [PATCH 8/8] target/sparc: " Philippe Mathieu-Daudé
2017-05-10 20:20 ` [Qemu-devel] [PATCH 0/8] optimize various tcg_gen() " no-reply
2017-05-12 2:34 ` 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=20170510200535.13268-9-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=atar4qemu@gmail.com \
--cc=aurelien@aurel32.net \
--cc=mark.cave-ayland@ilande.co.uk \
--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).