From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69858 invoked by alias); 4 May 2016 16:20:22 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 69275 invoked by uid 89); 4 May 2016 16:20:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=dfp, Hx-languages-length:2074, H*M:114, H*MI:114 X-HELO: e38.co.us.ibm.com Received: from e38.co.us.ibm.com (HELO e38.co.us.ibm.com) (32.97.110.159) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Wed, 04 May 2016 16:20:20 +0000 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 May 2016 10:20:17 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 4 May 2016 10:20:14 -0600 X-IBM-Helo: d03dlp03.boulder.ibm.com X-IBM-MailFrom: acsawdey@linux.vnet.ibm.com X-IBM-RcptTo: gcc-patches@gcc.gnu.org Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 3E4CE19D8051 for ; Wed, 4 May 2016 10:19:58 -0600 (MDT) Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u44GKEoh45416466 for ; Wed, 4 May 2016 09:20:14 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 39EEA78043 for ; Wed, 4 May 2016 10:20:14 -0600 (MDT) Received: from ragesh3a (unknown [9.80.87.242]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id A8C8878041 for ; Wed, 4 May 2016 10:20:13 -0600 (MDT) Message-ID: <1462378812.7759.114.camel@linux.vnet.ibm.com> Subject: [PATCH] add reassociation width target function for power8 From: Aaron Sawdey To: "gcc-patches@gcc.gnu.org" Date: Wed, 04 May 2016 16:20:00 -0000 Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16050416-0029-0000-0000-0000279C35FE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00324.txt.bz2 Hi, This patch enables TARGET_SCHED_REASSOCIATION_WIDTH for power8 and up. The widths returned are derived from testing with SPEC 2006 and some simple tests on power8. Bootstrapped and regtested on powerpc64le-unknown-linux-gnu, ok for trunk? 2016-05-04 Aaron Sawdey * config/rs6000/rs6000.c (rs6000_reassociation_width): Add function for TARGET_SCHED_REASSOCIATION_WIDTH to enable parallel reassociation for power8 and forward. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 235841) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -1755,6 +1755,9 @@ #undef TARGET_CONDITIONAL_REGISTER_USAGE #define TARGET_CONDITIONAL_REGISTER_USAGE rs6000_conditional_register_usage +#undef TARGET_SCHED_REASSOCIATION_WIDTH +#define TARGET_SCHED_REASSOCIATION_WIDTH rs6000_reassociation_width + #undef TARGET_TRAMPOLINE_INIT #define TARGET_TRAMPOLINE_INIT rs6000_trampoline_init @@ -8633,6 +8636,40 @@ true, worst_case); } +/* Determine the reassociation width to be used in reassociate_bb. + This takes into account how many parallel operations we + can actually do of a given type, and also the latency. + P8: + int add/sub 6/cycle + mul 2/cycle + vect add/sub/mul 2/cycle + fp add/sub/mul 2/cycle + dfp 1/cycle +*/ + +static int +rs6000_reassociation_width (unsigned int opc ATTRIBUTE_UNUSED, + enum machine_mode mode) +{ + switch (rs6000_cpu) + { + case PROCESSOR_POWER8: + case PROCESSOR_POWER9: + if (DECIMAL_FLOAT_MODE_P (mode)) + return 1; + if (VECTOR_MODE_P (mode)) + return 4; + if (INTEGRAL_MODE_P (mode)) + return opc == MULT_EXPR ? 4 : 6; + if (FLOAT_MODE_P (mode)) + return 4; + break; + default: + break; + } + return 1; +} + /* Change register usage conditional on target flags. */ static void rs6000_conditional_register_usage (void) -- Aaron Sawdey, Ph.D. acsawdey@linux.vnet.ibm.com 050-2/C113 (507) 253-7520 home: 507/263-0782 IBM Linux Technology Center - PPC Toolchain