From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQGR6-0008CE-8y for qemu-devel@nongnu.org; Sat, 28 May 2011 06:08:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQGR5-0005Yf-BQ for qemu-devel@nongnu.org; Sat, 28 May 2011 06:08:00 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:44044) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQGR5-0005UW-8D for qemu-devel@nongnu.org; Sat, 28 May 2011 06:07:59 -0400 Received: by mail-qw0-f45.google.com with SMTP id 8so1416698qwj.4 for ; Sat, 28 May 2011 03:07:59 -0700 (PDT) MIME-Version: 1.0 From: Blue Swirl Date: Sat, 28 May 2011 13:07:39 +0300 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] [PATCH 07/18] TCG/ARM: use stack for TCG temps List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel , Aurelien Jarno , Peter Maydell , Andrzej Zaborowski Use stack instead of temp_buf array in CPUState for TCG temps. Signed-off-by: Blue Swirl --- 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