From: Laurent Desnogues <laurent.desnogues@gmail.com>
To: Juha.Riihimaki@nokia.com
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 06/12] target-arm: optimize arm load/store multiple ops
Date: Sat, 24 Oct 2009 00:48:32 +0200 [thread overview]
Message-ID: <761ea48b0910231548u2f014d49p67b363db644ef2b6@mail.gmail.com> (raw)
In-Reply-To: <54D1051E-4C0D-4EB5-9396-4B094F08626F@nokia.com>
On Wed, Oct 21, 2009 at 12:17 PM, <Juha.Riihimaki@nokia.com> wrote:
> ARM load/store multiple instructions can be slightly optimized by
> loading the register offset constant into a variable outside the
> register loop and using the preloaded variable inside the loop instead
> of reloading the offset value to a temporary variable on each loop
> iteration. This causes less TCG ops to be generated for a ARM load/
> store multiple instruction.
>
> Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
> ---
> diff --git a/target-arm/translate.c b/target-arm/translate.c
> index e5a2881..bae1122 100644
> --- a/target-arm/translate.c
> +++ b/target-arm/translate.c
> @@ -6852,6 +6852,7 @@ static void disas_arm_insn(CPUState * env,
> DisasContext *s)
> }
> rn = (insn >> 16) & 0xf;
> addr = load_reg(s, rn);
> + tmp2 = tcg_const_i32(4);
>
> /* compute total size */
> loaded_base = 0;
> @@ -6865,7 +6866,7 @@ static void disas_arm_insn(CPUState * env,
> DisasContext *s)
> if (insn & (1 << 23)) {
> if (insn & (1 << 24)) {
> /* pre increment */
> - tcg_gen_addi_i32(addr, addr, 4);
> + tcg_gen_add_i32(addr, addr, tmp2);
> } else {
> /* post increment */
> }
> @@ -6918,7 +6919,7 @@ static void disas_arm_insn(CPUState * env,
> DisasContext *s)
> j++;
> /* no need to add after the last transfer */
> if (j != n)
> - tcg_gen_addi_i32(addr, addr, 4);
> + tcg_gen_add_i32(addr, addr, tmp2);
> }
> }
> if (insn & (1 << 21)) {
> @@ -6928,7 +6929,7 @@ static void disas_arm_insn(CPUState * env,
> DisasContext *s)
> /* pre increment */
> } else {
> /* post increment */
> - tcg_gen_addi_i32(addr, addr, 4);
> + tcg_gen_add_i32(addr, addr, tmp2);
> }
> } else {
> if (insn & (1 << 24)) {
> @@ -6944,6 +6945,7 @@ static void disas_arm_insn(CPUState * env,
> DisasContext *s)
> } else {
> dead_tmp(addr);
> }
> + tcg_temp_free_i32(tmp2);
> if (loaded_base) {
> store_reg(s, rn, loaded_var);
> }
>
Laurent
prev parent reply other threads:[~2009-10-23 22:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-21 10:17 [Qemu-devel] [PATCH 06/12] target-arm: optimize arm load/store multiple ops Juha.Riihimaki
2009-10-23 22:48 ` Laurent Desnogues [this message]
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=761ea48b0910231548u2f014d49p67b363db644ef2b6@mail.gmail.com \
--to=laurent.desnogues@gmail.com \
--cc=Juha.Riihimaki@nokia.com \
--cc=qemu-devel@nongnu.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).