From patchwork Mon Mar 16 05:36:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 45821 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EE67621547 for ; Mon, 16 Mar 2015 05:36:40 +0000 (UTC) Received: by wggx13 with SMTP id x13sf24506637wgg.0 for ; Sun, 15 Mar 2015 22:36:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:message-id:date:from:user-agent:mime-version:to:cc :subject:content-type:x-original-sender :x-original-authentication-results; bh=8g5vrjtktihedlHEvpt9nSpq8zqXdOhmDCSMrwNOZeY=; b=EkVIGHRf5C4EwSTVwptDiyebsrUQSratpqeitFrG96MIxd8jWAqnhGjAOQ3yonZyda +4mjAKAmTIuzpO2JfzcBToHAyoR6O7/YnEURsvImbcy4tOdGQGV5nCKg2pnM3yENpOf2 KwQ96ldBcp4tA5bUuu879IbWqhv/Ri7I6nrZavH3OyLClaTKuQi6y/jVY6bcNnNYExXT o7hgt5qDKlbQ931Ud9H/sJQfnRExdLBe6zjwKVpPSDXjUloc8AqaNbQyKc424aoiL+1i 5yN4pH664nAtZ86giats24z4DzG2IUFo48u+Y3Hd15Mka71Td+bTTXvgJ8CfXmN/F+kH FxrA== X-Gm-Message-State: ALoCoQnu1LfzCRfvz4TOjJgEYqW2DP1oNzkFMBu9sJUHOfvVhDtw5aw53kkElzm3fo2C5YQ767LX X-Received: by 10.180.90.175 with SMTP id bx15mr5564070wib.3.1426484200198; Sun, 15 Mar 2015 22:36:40 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.103 with SMTP id s7ls523249lag.105.gmail; Sun, 15 Mar 2015 22:36:40 -0700 (PDT) X-Received: by 10.112.67.107 with SMTP id m11mr28654545lbt.43.1426484200038; Sun, 15 Mar 2015 22:36:40 -0700 (PDT) Received: from mail-lb0-x22a.google.com (mail-lb0-x22a.google.com. [2a00:1450:4010:c04::22a]) by mx.google.com with ESMTPS id od8si7172987lbc.43.2015.03.15.22.36.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Mar 2015 22:36:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22a as permitted sender) client-ip=2a00:1450:4010:c04::22a; Received: by lbcds1 with SMTP id ds1so24119516lbc.3 for ; Sun, 15 Mar 2015 22:36:39 -0700 (PDT) X-Received: by 10.152.8.15 with SMTP id n15mr26404889laa.41.1426484199603; Sun, 15 Mar 2015 22:36:39 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp2361582lbj; Sun, 15 Mar 2015 22:36:38 -0700 (PDT) X-Received: by 10.66.228.132 with SMTP id si4mr130430941pac.134.1426484197564; Sun, 15 Mar 2015 22:36:37 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id fu7si19938314pdb.48.2015.03.15.22.36.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Mar 2015 22:36:37 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-393560-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 126546 invoked by alias); 16 Mar 2015 05:36:22 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 126522 invoked by uid 89); 16 Mar 2015 05:36:21 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f178.google.com Received: from mail-pd0-f178.google.com (HELO mail-pd0-f178.google.com) (209.85.192.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 16 Mar 2015 05:36:20 +0000 Received: by pdnc3 with SMTP id c3so48087881pdn.0 for ; Sun, 15 Mar 2015 22:36:18 -0700 (PDT) X-Received: by 10.66.166.39 with SMTP id zd7mr115005290pab.117.1426484178520; Sun, 15 Mar 2015 22:36:18 -0700 (PDT) Received: from [10.1.1.4] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by mx.google.com with ESMTPSA id yt8sm15062889pab.22.2015.03.15.22.36.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Mar 2015 22:36:17 -0700 (PDT) Message-ID: <55066BCC.4010900@linaro.org> Date: Mon, 16 Mar 2015 16:36:12 +1100 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Marcus Shawcroft , Richard Earnshaw , Jim Wilson Subject: [AArch64][PR65375] Fix RTX cost for vector SET X-IsSubscribed: yes X-Original-Sender: kugan.vivekanandarajah@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22a as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 AArch64 RTX cost for vector SET is causing PR65375. Lower subreg is using this rtx_cost to compute the cost of moves, and splitting anything larger than word size, 64-bits in this case. The aarch64 rtx_costs is returning 2 * COST_N_INSNS(1) for vector moves, so they get split. Attach patch fixes this. With the patch the testcase in the PR: #include void hello_vst2(float* fout, float *fin) { float32x4x2_t a; a = vld2q_f32 (fin); vst2q_f32 (fout, a); } Changes to: hello_vst2: - ld2 {v0.4s - v1.4s}, [x1] - sub sp, sp, #32 - umov x1, v0.d[0] - umov x2, v0.d[1] - str q1, [sp, 16] - mov x5, x1 - stp x5, x2, [sp] - ld1 {v0.16b - v1.16b}, [sp] + ld2 {v2.4s - v3.4s}, [x1] + orr v0.16b, v2.16b, v2.16b + orr v1.16b, v3.16b, v3.16b st2 {v0.4s - v1.4s}, [x0] - add sp, sp, 32 ret lower-subreg.c:compute_costs() only cares about the cost of a (set (reg) (const_int )) move but I think the intention, at least for now, is to return extra_cost->vect.alu for all the vector operations. Regression tested on aarch64-linux-gnu with no new regression. Is this OK for trunk? Thanks, Kugan gcc/ChangeLog: 2015-03-16 Kugan Vivekanandarajah Jim Wilson PR target/65375 * config/aarch64/aarch64.c (aarch64_rtx_costs): Return extra_cost->vect.alu for SET. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index cba3c1a..db69979 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -5517,6 +5517,13 @@ aarch64_rtx_costs (rtx x, int code, int outer ATTRIBUTE_UNUSED, op0 = SET_DEST (x); op1 = SET_SRC (x); + /* Sets don't have a mode, so we must recompute this here. */ + if (VECTOR_MODE_P (GET_MODE (op0))) + { + *cost += extra_cost->vect.alu; + return true; + } + switch (GET_CODE (op0)) { case MEM: