From patchwork Tue Sep 28 19:20:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 45520 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 92D5E385843A for ; Tue, 28 Sep 2021 19:20:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 92D5E385843A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1632856837; bh=hmAVPcGxKXhdnHtnJ54oliwAp9HFplCUIZkuE8xMOyc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=oTWyZg8bEIWbF8csJfRzUMuyT1DNVZ1DNWd+zDaNm7NBkUoM8yRXi6/vKtap8uIfE NavoLC1yGqWnazQiCQnaVo+oUV8+9VpSjQH3VGiIUsnmyO0AiTdupDPJIV6oSBeLaP 6OZ+6V1fJbBH8NRi/4TYFldoyD2n9CuljXjNa3GM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 3B2DF3858D39 for ; Tue, 28 Sep 2021 19:20:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3B2DF3858D39 Received: by mail-wr1-x431.google.com with SMTP id t8so238384wri.1 for ; Tue, 28 Sep 2021 12:20:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :mime-version:content-transfer-encoding; bh=hmAVPcGxKXhdnHtnJ54oliwAp9HFplCUIZkuE8xMOyc=; b=VhRo9jcO8hoHjJ9qiGz+J/LIRiuVdDyu45+c8XggNGl4ufu3pzek8ou37nbUR25PB6 lq1u3FZ6FjMEMd0lP8b7hv+coATyCsNrIwlQkoR7dP/b0LVYt2O/X2QrlKSzzliPnP82 usDTb5bPhSglNDCnuMwZ7B8VFjGgqQNjDvOtvd5AkLxXlwA+4GnfJo3UvcwHLgKuBZOz 7G6q/FwyUVbs+C8tKmbTDzmAH273e0s3ukydcVRuIkLOkk1OyVyDin2s5ltV2VgC5mnZ RsHtOufNqZILqSKKppBl8K2fCtL6ZBCWNuADLRV4hB6Ux40Q2SMfd9/boeiqnVLJpZ4u pC7Q== X-Gm-Message-State: AOAM531J6lOyMO1/5m0r4UeTSK9dp+wajIcRMLZKrtsvPyZdB9FcFIBP eDz3VjPcvjrP0x2Nf1boNCf4PXN+9OHMsg== X-Google-Smtp-Source: ABdhPJylPVkPrlBGin0yytz1HxRCuFNDnkPIYQh4/vVhgmihjPLQMEVRr0fkCboDqav7annieSPw3w== X-Received: by 2002:a05:6000:2af:: with SMTP id l15mr2127181wry.129.1632856808003; Tue, 28 Sep 2021 12:20:08 -0700 (PDT) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id r19sm3223458wmp.43.2021.09.28.12.20.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Sep 2021 12:20:07 -0700 (PDT) X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [pushed] Darwin, PPC : Fix R13 for PPC64. Date: Tue, 28 Sep 2021 20:20:01 +0100 Message-Id: <20210928192001.35039-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Sandoe via Gcc-patches From: Iain Sandoe Reply-To: iain@sandoe.co.uk Cc: Iain Sandoe , segher@kernel.crashing.org Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi, We have a somewhat unusual situation in that for PPC64, R13 is both reserved for future use by the ABI document and callee-saved. In fact, it is already used internally by the pthreads implementation to contain pthread_self. So add R13 to the fixed regs, but also keep it in the callee- saved set. tested on powerpc-darwin9, pushed to master, thanks Iain gcc/ChangeLog: * config/rs6000/darwin.h (FIXED_R13): Add for PPC64. (FIRST_SAVED_GP_REGNO): Save from R13 even when it is one of the fixed regs. --- gcc/config/rs6000/darwin.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h index 6abf8e84f54..120b01f9a2b 100644 --- a/gcc/config/rs6000/darwin.h +++ b/gcc/config/rs6000/darwin.h @@ -203,7 +203,7 @@ /* Make both r2 and r13 available for allocation. */ #define FIXED_R2 0 -#define FIXED_R13 0 +#define FIXED_R13 TARGET_64BIT /* Base register for access to local variables of the function. */ @@ -213,6 +213,9 @@ #undef RS6000_PIC_OFFSET_TABLE_REGNUM #define RS6000_PIC_OFFSET_TABLE_REGNUM 31 +#undef FIRST_SAVED_GP_REGNO +#define FIRST_SAVED_GP_REGNO 13 + /* Darwin's stack must remain 16-byte aligned for both 32 and 64 bit ABIs. */