Received: from [140.186.70.92] (port=56238 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHjzR-0002ET-UQ for qemu-devel@nongnu.org; Thu, 27 May 2010 16:47:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHjzQ-0005Q6-Nk for qemu-devel@nongnu.org; Thu, 27 May 2010 16:47:41 -0400 Received: from are.twiddle.net ([75.149.56.221]:51245) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHjzQ-0005Pz-Il for qemu-devel@nongnu.org; Thu, 27 May 2010 16:47:40 -0400 From: Richard Henderson Date: Thu, 27 May 2010 13:46:21 -0700 Message-Id: <1274993204-30766-40-git-send-email-rth@twiddle.net> In-Reply-To: <1274993204-30766-1-git-send-email-rth@twiddle.net> References: <1274993204-30766-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 39/62] tcg-s390: Rearrange register allocation order. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: agraf@suse.de, aurelien@aurel32.net Try to avoid conflicting with the outgoing function call arguments. Signed-off-by: Richard Henderson --- tcg/s390/tcg-target.c | 23 +++++++++++++---------- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c index a26c963..eb57e24 100644 --- a/tcg/s390/tcg-target.c +++ b/tcg/s390/tcg-target.c @@ -186,22 +186,25 @@ static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { }; #endif +/* Since R6 is a potential argument register, choose it last of the + call-saved registers. Likewise prefer the call-clobbered registers + in reverse order to maximize the chance of avoiding the arguments. */ static const int tcg_target_reg_alloc_order[] = { - TCG_REG_R6, - TCG_REG_R7, - TCG_REG_R8, - TCG_REG_R9, - TCG_REG_R10, - TCG_REG_R11, - TCG_REG_R12, TCG_REG_R13, + TCG_REG_R12, + TCG_REG_R11, + TCG_REG_R10, + TCG_REG_R9, + TCG_REG_R8, + TCG_REG_R7, + TCG_REG_R6, TCG_REG_R14, TCG_REG_R0, TCG_REG_R1, - TCG_REG_R2, - TCG_REG_R3, - TCG_REG_R4, TCG_REG_R5, + TCG_REG_R4, + TCG_REG_R3, + TCG_REG_R2, }; static const int tcg_target_call_iarg_regs[] = { -- 1.7.0.1