From patchwork Fri Nov 14 14:35:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco X-Patchwork-Id: 410854 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 065E014009B for ; Sat, 15 Nov 2014 01:35:56 +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:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=omU6cuUGVmpwyoj/ iiJBIFIbmc3z4ip+Gxf28Us/MYtyp0CQItTpPZP0PocMO+BxeC8EA92aE+3Ef71O zJ6ISLL3x4f1XTg1QwLvuc1GV9Uxanf59IWHIgm4QkMk52HjCfz76U7mmGWgIxA3 bSR4DyW9yAF4LMKt2rt9U52bfHE= 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:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=XLRLmCBR0g9KnX4o+45Ab6 RpMGI=; b=ok8+78zZwWXHQMtq88WtLiGEf6SfW2H3RSYXDeqEFxSkmQDwnS0U0p QtIWcPmyIEbHaESVzbMINAoDA92BJcDH+FJ4LstGyN/hTFl25mruOTAqgdvQ+Nmb cWZcMYYCdaynKRvHE7kabZhpSj3zD3/cOmNn0i2XLSO/sfAhE9IPE= Received: (qmail 6167 invoked by alias); 14 Nov 2014 14:35:48 -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 6153 invoked by uid 89); 14 Nov 2014 14:35:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, 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; Fri, 14 Nov 2014 14:35:45 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Fri, 14 Nov 2014 14:35:42 +0000 Received: from e103246vm ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 14 Nov 2014 14:35:42 +0000 From: "Wilco Dijkstra" To: Subject: [PATCH][AArch64] Adjust generic move costs Date: Fri, 14 Nov 2014 14:35:41 -0000 Message-ID: <000101d00018$449fc1c0$cddf4540$@com> MIME-Version: 1.0 X-MC-Unique: 114111414354211101 Hi, This patch adjusts the generic move costs to better reflect the INT<->FP move costs used in the various core specific cost tables. The intention of these generic costs is that they provide reasonable performance across a range of cores without unduly pessimizing any one specific core. This adjustment is sufficient to prevent the register allocator inserting huge amounts of unnecessary int<->FP moves. The GP2FP/FP2GP costs must be larger than the memory cost to avoid the worst of this issue. In sha2 this replaces all 642 redundant fp moves with 35 load and 7 store spills. OK for commit? ChangeLog: 2014-11-14 Wilco Dijkstra * gcc/config/aarch64/aarch64.c (generic_regmove_cost): Increase FP move cost. --- gcc/config/aarch64/aarch64.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index de53c94..cd30724 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -218,8 +218,10 @@ __extension__ static const struct cpu_regmove_cost generic_regmove_cost = { NAMED_PARAM (GP2GP, 1), - NAMED_PARAM (GP2FP, 2), - NAMED_PARAM (FP2GP, 2), + /* Avoid the use of slow int<->fp moves for spilling by setting + their cost higher than memmov_cost. */ + NAMED_PARAM (GP2FP, 5), + NAMED_PARAM (FP2GP, 5), NAMED_PARAM (FP2FP, 2) };