From patchwork Mon Oct 9 22:56:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 823595 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-463837-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="OATxsPlK"; dkim-atps=neutral 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 3y9wbv1LPJz9t63 for ; Tue, 10 Oct 2017 09:56:57 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=C/HZWL7PzjZB vIGyA+kRMJgaY6zrVaMING9HAwlEUtFwFXiI6DmJN4C7WFKbbDD9XZ+CQpS0nUG8 S5fKHe0ZJGeasSSUnnHRb9ejAWl6amWQoC/ZEH76Ux806PxjYRIYR4uBVQF0chy2 QmXNESrbS9ncHHWamC9KgRz1h2c5Uy4= 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:from :to:cc:subject:date:message-id; s=default; bh=CMU354klvdjkJCz7ft vRePgu+4A=; b=OATxsPlKVvPFGQ8g3Gu9CGkSzi7l/z4ijnSZ/+qvvob3zfuXnW b9Vx/Vpg/aQYNGWpfgCQ72vsuefdrC3tbgl8YeFS+6TIeJMjHdi72WsIJL2ckDNc 9vCSv9l7zWJPAvBytGypnt7+vi1B0dVJw28JgFrG/P4NuAdpV6tDbiVtQ= Received: (qmail 122680 invoked by alias); 9 Oct 2017 22:56: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 122428 invoked by uid 89); 9 Oct 2017 22:56:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: gcc1-power7.osuosl.org Received: from gcc1-power7.osuosl.org (HELO gcc1-power7.osuosl.org) (140.211.15.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Oct 2017 22:56:44 +0000 Received: by gcc1-power7.osuosl.org (Postfix, from userid 10019) id 7545E12402CC; Mon, 9 Oct 2017 22:56:42 +0000 (UTC) From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com, Segher Boessenkool Subject: [PATCH] rs6000: Move processor_costs to header Date: Mon, 9 Oct 2017 22:56:40 +0000 Message-Id: <64315aad61ce7d43cad09e36a274965669486d3b.1507589412.git.segher@kernel.crashing.org> X-IsSubscribed: yes This moves the processor_costs structure declaration to the rs6000.h header file, so that things in other files can use it (not just things in rs6000.c). Tested as usual; committing. 2010-10-09 Segher Boessenkool * config/rs6000/rs6000.c (processor_costs): Move to ... * config/rs6000/rs6000.h: ... here. (rs6000_cost): Declare. --- gcc/config/rs6000/rs6000.c | 23 +---------------------- gcc/config/rs6000/rs6000.h | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 104f2ed..f98ef93 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -637,31 +637,10 @@ mode_supports_vsx_dform_quad (machine_mode mode) } -/* Target cpu costs. */ - -struct processor_costs { - const int mulsi; /* cost of SImode multiplication. */ - const int mulsi_const; /* cost of SImode multiplication by constant. */ - const int mulsi_const9; /* cost of SImode mult by short constant. */ - const int muldi; /* cost of DImode multiplication. */ - const int divsi; /* cost of SImode division. */ - const int divdi; /* cost of DImode division. */ - const int fp; /* cost of simple SFmode and DFmode insns. */ - const int dmul; /* cost of DFmode multiplication (and fmadd). */ - const int sdiv; /* cost of SFmode division (fdivs). */ - const int ddiv; /* cost of DFmode division (fdiv). */ - const int cache_line_size; /* cache line size in bytes. */ - const int l1_cache_size; /* size of l1 cache, in kilobytes. */ - const int l2_cache_size; /* size of l2 cache, in kilobytes. */ - const int simultaneous_prefetches; /* number of parallel prefetch - operations. */ - const int sfdf_convert; /* cost of SF->DF conversion. */ -}; +/* Processor costs (relative to an add) */ const struct processor_costs *rs6000_cost; -/* Processor costs (relative to an add) */ - /* Instruction size costs on 32bit processors. */ static const struct processor_costs size32_cost = { diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 6021972..21e536b 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -2065,6 +2065,29 @@ extern scalar_int_mode rs6000_pmode; #define REVERSE_CONDITION(CODE, MODE) rs6000_reverse_condition (MODE, CODE) +/* Target cpu costs. */ + +struct processor_costs { + const int mulsi; /* cost of SImode multiplication. */ + const int mulsi_const; /* cost of SImode multiplication by constant. */ + const int mulsi_const9; /* cost of SImode mult by short constant. */ + const int muldi; /* cost of DImode multiplication. */ + const int divsi; /* cost of SImode division. */ + const int divdi; /* cost of DImode division. */ + const int fp; /* cost of simple SFmode and DFmode insns. */ + const int dmul; /* cost of DFmode multiplication (and fmadd). */ + const int sdiv; /* cost of SFmode division (fdivs). */ + const int ddiv; /* cost of DFmode division (fdiv). */ + const int cache_line_size; /* cache line size in bytes. */ + const int l1_cache_size; /* size of l1 cache, in kilobytes. */ + const int l2_cache_size; /* size of l2 cache, in kilobytes. */ + const int simultaneous_prefetches; /* number of parallel prefetch + operations. */ + const int sfdf_convert; /* cost of SF->DF conversion. */ +}; + +extern const struct processor_costs *rs6000_cost; + /* Control the assembler format that we output. */ /* A C string constant describing how to begin a comment in the target