From patchwork Mon Mar 21 13:07:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 600120 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 3qTGMt0YXTz9s5g for ; Tue, 22 Mar 2016 00:07:53 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=immNVcf0; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=QvROZNMDxNBJj9uV4 lSPvbctWqWch8k1LcP4jR07ZVkV4CZO3ephVBFXXKpZm5tdXavugJ7RC3bmd+h1+ cCNb3J7+FZNEXEuQiCwFYzDV0sVdRbuxvhuC/HtvpYWcI/5ogSoDp64xICzwOBz5 Yr1/5MI0YkrzUjrzbi/ZD5iUCw= 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:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=QX0SrG3rVbMtB3UeHrB2r+p 4tSY=; b=immNVcf0C6yz/YCZ5PSn8Z27C3ALYSC3VQNI43T15BV9p+jcbnyf2Ao 9s0FS99iU++Q4uHbKBhs1DBXtUBpsWsJx+k4l7jOCpxOCv2kiniNyXIha8qbZG7A eWJTox6px9+IEZAPyx0MmV8kCMxI/ZydpFOAXKROEU27RQx6XudM= Received: (qmail 14488 invoked by alias); 21 Mar 2016 13:07:45 -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 14430 invoked by uid 89); 21 Mar 2016 13:07:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=0x100, risk X-HELO: mail-pf0-f196.google.com Received: from mail-pf0-f196.google.com (HELO mail-pf0-f196.google.com) (209.85.192.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 21 Mar 2016 13:07:35 +0000 Received: by mail-pf0-f196.google.com with SMTP id n5so29911271pfn.1 for ; Mon, 21 Mar 2016 06:07:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Wcz+LmCffHUTPAXui6e/HTwOJl1IkmIEaGYgEPHhUz4=; b=DW5f6aY6FW90VWt8bmbcKiIL5BQQEOZ0sXRn0CRXp+LY7afoX/4+pjTzvOIjdQRlOq 4hRN+BO2h+HiIV4j/kKg2qGg3igZZHioKRcTtSB9Sp2vbU3KNZc7DM6ddt2/zliHjQAH 7Cry0MQaD41cv9+FWRZNIdIik02MEIqwJ5RgGOqL87GMavMrDOvaTaaURKIZPHXrHnb0 Yh5UVLS0kunbTDU6DS44W7n3KoDas6kq7RuBPs7Rs+5cWB98iTQv4r01bewG2cNkJqGd y6jnGHLTxBAElGXrI4uFnr4vaEDNWfr8SVTD+BahZHvXWdBrLNJvAlyDZfTzlpH0bySa Px+Q== X-Gm-Message-State: AD7BkJLhLjvou24YscZ8GjJaexc8e0qT6QXhjpgFdoQCRK4HQycMQVrrmjT+fKkq+Y8NVg== X-Received: by 10.98.67.199 with SMTP id l68mr44617181pfi.18.1458565653973; Mon, 21 Mar 2016 06:07:33 -0700 (PDT) Received: from bubble.grove.modra.org (CPE-58-160-146-233.sa.bigpond.net.au. [58.160.146.233]) by smtp.gmail.com with ESMTPSA id se8sm40776221pac.44.2016.03.21.06.07.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Mar 2016 06:07:33 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id E8262EA0153; Mon, 21 Mar 2016 23:37:29 +1030 (ACDT) Date: Mon, 21 Mar 2016 23:37:29 +1030 From: Alan Modra To: gcc-patches@gcc.gnu.org Cc: David Edelsohn Subject: [PATCH 3/4] [RS6000] Split SAVRES_STRATEGY Message-ID: <20160321130729.GO22605@bubble.grove.modra.org> References: <20160321130459.GL22605@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160321130459.GL22605@bubble.grove.modra.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes No functional change here. A single bit becomes two bits, which always have the same value at the moment. In preparation for the next patch. * config/rs6000/rs6000.c (SAVRES_MULTIPLE): Replace with.. (SAVE_STRATEGY, REST_STRATEGY): ..this. Renumber and sort enum. Update all uses. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 99473bd..0b0c864 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -23031,16 +23031,17 @@ fixed_regs_p (unsigned first, unsigned last) /* Determine the strategy for savings/restoring registers. */ enum { - SAVRES_MULTIPLE = 0x1, - SAVE_INLINE_FPRS = 0x2, - SAVE_INLINE_GPRS = 0x4, - REST_INLINE_FPRS = 0x8, - REST_INLINE_GPRS = 0x10, - SAVE_NOINLINE_GPRS_SAVES_LR = 0x20, - SAVE_NOINLINE_FPRS_SAVES_LR = 0x40, - REST_NOINLINE_FPRS_DOESNT_RESTORE_LR = 0x80, - SAVE_INLINE_VRS = 0x100, - REST_INLINE_VRS = 0x200 + SAVE_MULTIPLE = 0x1, + SAVE_INLINE_GPRS = 0x2, + SAVE_INLINE_FPRS = 0x4, + SAVE_NOINLINE_GPRS_SAVES_LR = 0x8, + SAVE_NOINLINE_FPRS_SAVES_LR = 0x10, + SAVE_INLINE_VRS = 0x20, + REST_MULTIPLE = 0x100, + REST_INLINE_GPRS = 0x200, + REST_INLINE_FPRS = 0x400, + REST_NOINLINE_FPRS_DOESNT_RESTORE_LR = 0x800, + REST_INLINE_VRS = 0x1000 }; static int @@ -23055,7 +23056,7 @@ rs6000_savres_strategy (rs6000_stack_t *info, && !(TARGET_SPE_ABI && info->spe_64bit_regs_used) && info->first_gp_reg_save < 31 && !fixed_regs_p (info->first_gp_reg_save, 32)) - strategy |= SAVRES_MULTIPLE; + strategy |= SAVE_MULTIPLE | REST_MULTIPLE; if (crtl->calls_eh_return || cfun->machine->ra_need_lr) @@ -23071,7 +23072,7 @@ rs6000_savres_strategy (rs6000_stack_t *info, strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; if (info->first_gp_reg_save == 32 - || (!(strategy & SAVRES_MULTIPLE) + || (!(strategy & (SAVE_MULTIPLE | REST_MULTIPLE)) && fixed_regs_p (info->first_gp_reg_save, 32))) strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; @@ -23149,7 +23150,7 @@ rs6000_savres_strategy (rs6000_stack_t *info, /* If we are going to use store multiple, then don't even bother with the out-of-line routines, since the store-multiple instruction will always be smaller. */ - if ((strategy & SAVRES_MULTIPLE)) + if ((strategy & (SAVE_MULTIPLE | REST_MULTIPLE))) strategy |= SAVE_INLINE_GPRS; /* info->lr_save_p isn't yet set if the only reason lr needs to be @@ -23170,7 +23171,7 @@ rs6000_savres_strategy (rs6000_stack_t *info, LR, and we can't use the "exit" out-of-line gpr restore if we have saved some fprs; In those cases it is advantageous to use load multiple when available. */ - if ((strategy & SAVRES_MULTIPLE) + if ((strategy & (SAVE_MULTIPLE | REST_MULTIPLE)) && (!lr_save_p || info->first_fp_reg_save != 64)) strategy |= REST_INLINE_GPRS; @@ -23186,7 +23187,7 @@ rs6000_savres_strategy (rs6000_stack_t *info, restore if we've used store multiple or out-of-line routines in the prologue, i.e. if we've saved all the registers from first_gp_reg_save. Otherwise, we risk loading garbage. */ - if ((strategy & (SAVE_INLINE_GPRS | REST_INLINE_GPRS | SAVRES_MULTIPLE)) + if ((strategy & (SAVE_INLINE_GPRS | REST_INLINE_GPRS | SAVE_MULTIPLE | REST_MULTIPLE)) == SAVE_INLINE_GPRS) { int i; @@ -25586,7 +25587,7 @@ rs6000_emit_prologue (void) if (lr) END_USE (0); } - else if (!WORLD_SAVE_P (info) && (strategy & SAVRES_MULTIPLE)) + else if (!WORLD_SAVE_P (info) && (strategy & SAVE_MULTIPLE)) { rtvec p; int i; @@ -26498,7 +26499,7 @@ rs6000_emit_epilogue (int sibcall) } strategy = info->savres_strategy; - using_load_multiple = strategy & SAVRES_MULTIPLE; + using_load_multiple = strategy & REST_MULTIPLE; restoring_FPRs_inline = sibcall || (strategy & REST_INLINE_FPRS); restoring_GPRs_inline = sibcall || (strategy & REST_INLINE_GPRS); using_mtcr_multiple = (rs6000_cpu == PROCESSOR_PPC601