From patchwork Sun Jun 19 21:05:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 101008 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 145AAB6FF0 for ; Mon, 20 Jun 2011 08:32:59 +1000 (EST) Received: from localhost ([::1]:49259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYQY3-0000e6-A3 for incoming@patchwork.ozlabs.org; Sun, 19 Jun 2011 18:32:55 -0400 Received: from eggs.gnu.org ([140.186.70.92]:45827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYPBq-000343-Ez for qemu-devel@nongnu.org; Sun, 19 Jun 2011 17:05:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QYPBo-0008FV-Gc for qemu-devel@nongnu.org; Sun, 19 Jun 2011 17:05:54 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:43697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYPBo-00085I-6Z for qemu-devel@nongnu.org; Sun, 19 Jun 2011 17:05:52 -0400 Received: by mail-qw0-f45.google.com with SMTP id 8so441368qwj.4 for ; Sun, 19 Jun 2011 14:05:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=jvnABdPnmi9sZCBGYDjOMKK+W3wyhScfg20Vs2l+7g8=; b=szdnU4SSyxg96cVrjDwZY/9sERYpifOrNm8oW2IQTa3WOtmBzeiHBgzEPmj9s0+oY/ W2skUb8Ibc75A+V70HeXvpRUr0Kok8Xzffad+rQ2uVkSnWvApd0aXiVaZDh0kVc9aY68 SO+UnfyuJbjaZHkU1ME1xGCRCjp8FlpIGCtgI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=qB9hw8hXVc7B67kMMJaQNm0zrmm0G6ETf6XBJFl2kp9O8IrM1ZsRCmLSlNguIiOQ4C ZN5FYExHEXM+MYv9xM/YFj8lKeXBGo3ZrRIYeZ2jwNoKL5JifvQuZIkUHinmNZTkeOe9 6rSggsDG2aRP184tmBfZUQrzBr+CNm6EJWTUI= Received: by 10.224.200.69 with SMTP id ev5mr720472qab.217.1308517552101; Sun, 19 Jun 2011 14:05:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.2.138 with HTTP; Sun, 19 Jun 2011 14:05:32 -0700 (PDT) From: Blue Swirl Date: Mon, 20 Jun 2011 00:05:32 +0300 Message-ID: To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.216.45 Subject: [Qemu-devel] [PATCH 07/18] TCG/ARM: use stack for TCG temps X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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(-) */ @@ -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); } 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.