From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel <qemu-devel@nongnu.org>,
Aurelien Jarno <aurelien@aurel32.net>,
Peter Maydell <peter.maydell@linaro.org>,
Andrzej Zaborowski <balrogg@gmail.com>
Subject: [Qemu-devel] [PATCH 07/18] TCG/ARM: use stack for TCG temps
Date: Sat, 28 May 2011 13:07:39 +0300 [thread overview]
Message-ID: <BANLkTinbcP7DRVz9Pc98Z3+KKoGxuhSYSg@mail.gmail.com> (raw)
Use stack instead of temp_buf array in CPUState for TCG temps.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
tcg/arm/tcg-target.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c
index 93eb0f1..eacda6b 100644
--- a/tcg/arm/tcg-target.c
+++ b/tcg/arm/tcg-target.c
@@ -1804,8 +1804,6 @@ static void tcg_target_init(TCGContext *s)
tcg_regset_set_reg(s->reserved_regs, TCG_REG_PC);
tcg_add_target_add_op_defs(arm_op_defs);
- tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf),
- CPU_TEMP_BUF_NLONGS * sizeof(long));
}
static inline void tcg_out_ld(TCGContext *s, TCGType type, int arg,
@@ -1848,6 +1846,9 @@ static inline void tcg_out_movi(TCGContext *s,
TCGType type,
static void tcg_target_qemu_prologue(TCGContext *s)
{
+ tcg_set_frame(s, TCG_REG_CALL_STACK, TCG_STATIC_CALL_ARGS_SIZE,
+ CPU_TEMP_BUF_NLONGS * sizeof(long));
+
/* Calling convention requires us to save r4-r11 and lr;
* save also r12 to maintain stack 8-alignment.
*/
@@ -1855,11 +1856,17 @@ static void tcg_target_qemu_prologue(TCGContext *s)
/* stmdb sp!, { r4 - r12, lr } */
tcg_out32(s, (COND_AL << 28) | 0x092d5ff0);
+ tcg_out_addi(s, TCG_REG_CALL_STACK, -TCG_STATIC_CALL_ARGS_SIZE -
+ CPU_TEMP_BUF_NLONGS * sizeof(long)));
+
tcg_out_mov(s, TCG_TYPE_PTR, TCG_AREG0, tcg_target_call_iarg_regs[0]);
tcg_out_bx(s, COND_AL, tcg_target_call_iarg_regs[1]);
tb_ret_addr = s->code_ptr;
+ tcg_out_addi(s, TCG_REG_CALL_STACK, TCG_STATIC_CALL_ARGS_SIZE +
+ CPU_TEMP_BUF_NLONGS * sizeof(long));
+
/* ldmia sp!, { r4 - r12, pc } */
tcg_out32(s, (COND_AL << 28) | 0x08bd9ff0);
}
--
1.6.2.4
next reply other threads:[~2011-05-28 10:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-28 10:07 Blue Swirl [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-06-19 21:05 [Qemu-devel] [PATCH 07/18] TCG/ARM: use stack for TCG temps Blue Swirl
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=BANLkTinbcP7DRVz9Pc98Z3+KKoGxuhSYSg@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=aurelien@aurel32.net \
--cc=balrogg@gmail.com \
--cc=peter.maydell@linaro.org \
--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).