From patchwork Thu Jun 5 12:55:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Shawcroft X-Patchwork-Id: 356373 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 06410140080 for ; Thu, 5 Jun 2014 22:55:16 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=JRtma2Glw3p3pmRgj8JYysIkpchequ1ScpA1ZajDaSOgT7 P6G/oB0gXaazWU9E45byIrxEno2L8fe8iFa35T5XifK1Wo/8onA9l4wq0RZfkaoX 1VWhBZ8Gc1trLNTIVVDPVeWRabrarLlxOBM7T/16tKRuKIa505GVYfq+7l+/k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=9m5CorgWEePDqwcQeUWf6+LNLlA=; b=xVZdBDSogUFmPfDhIixx 6L9jGBJBB/Xhz89UkEZ1Z6mkfT7pFiELZlaxQSIOKyFnnmNSUvWSeTPTj/AbRson lxDHr/u8Dl0CsTCTmFoni44NWlkrP6WGAzDD2TKHghd07yIDng1iU99T/7WLVO2d +MlsMYzj8R4KCcs5zC/HeVw= Received: (qmail 6613 invoked by alias); 5 Jun 2014 12:55:10 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 6602 invoked by uid 89); 5 Jun 2014 12:55:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Jun 2014 12:55:08 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 05 Jun 2014 13:55:04 +0100 Received: from [10.1.207.52] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 5 Jun 2014 13:55:01 +0100 Message-ID: <539068A8.4040606@arm.com> Date: Thu, 05 Jun 2014 13:55:04 +0100 From: Marcus Shawcroft User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [COMMITTED][AArch64] Unify callee save slot allocation for X29 and X30. X-MC-Unique: 114060513550404501 This patch restructures the callee slave slot allocation code to handle X29 and X30 consistently with the other core registers. The patch also ensures that the offset recorded for X30 is accurate. Committed. /Marcus 2014-06-05 Marcus Shawcroft Jiong Wang * config/aarch64/aarch64.c (aarch64_layout_frame): Correct initialization of R30 offset. Update offset. Iterate core regisers upto X30. Remove X29, X30 specific code. From 4063c0f8ee2914a07001072b60da397a0bdbaa6e Mon Sep 17 00:00:00 2001 From: Marcus Shawcroft Date: Tue, 22 Apr 2014 18:12:53 +0100 Subject: [PATCH 4/8] [AArch64] Handle FP/LR slot allocation cleanly. Rebase of Jiong's patch. --- gcc/config/aarch64/aarch64.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 15ac880..6d9fe4d 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -1841,13 +1841,15 @@ aarch64_layout_frame (void) if (frame_pointer_needed) { - cfun->machine->frame.reg_offset[R30_REGNUM] = 0; + /* FP and LR are placed in the linkage record. */ cfun->machine->frame.reg_offset[R29_REGNUM] = 0; + cfun->machine->frame.reg_offset[R30_REGNUM] = UNITS_PER_WORD; cfun->machine->frame.hardfp_offset = 2 * UNITS_PER_WORD; + offset += 2 * UNITS_PER_WORD; } /* Now assign stack slots for them. */ - for (regno = R0_REGNUM; regno <= R28_REGNUM; regno++) + for (regno = R0_REGNUM; regno <= R30_REGNUM; regno++) if (cfun->machine->frame.reg_offset[regno] == SLOT_REQUIRED) { cfun->machine->frame.reg_offset[regno] = offset; @@ -1861,18 +1863,6 @@ aarch64_layout_frame (void) offset += UNITS_PER_WORD; } - if (frame_pointer_needed) - { - cfun->machine->frame.reg_offset[R29_REGNUM] = offset; - offset += UNITS_PER_WORD; - } - - if (cfun->machine->frame.reg_offset[R30_REGNUM] == SLOT_REQUIRED) - { - cfun->machine->frame.reg_offset[R30_REGNUM] = offset; - offset += UNITS_PER_WORD; - } - cfun->machine->frame.padding0 = (AARCH64_ROUND_UP (offset, STACK_BOUNDARY / BITS_PER_UNIT) - offset); offset = AARCH64_ROUND_UP (offset, STACK_BOUNDARY / BITS_PER_UNIT); -- 1.7.9.5