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: 450386 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 15FD014008F for ; Mon, 16 Mar 2015 16:36:31 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=AD4vRrzA; dkim-adsp=none (unprotected policy); 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 :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=Oigng7mSsbfDdOw9aN6/J1blmXP/qNnsUz1+9IlyUz7 y6VOjWwrUVM/8Eqta1JWSAtySUyTDUTG2F0du3HBOQF18xqeDNyz+DqazHpRrbi1 EkQJQbnUleRLBCRV/zJljTTMVeqM9ZZ6SIqVJo+NnKLg7xFzj/581f8Lm1b2D4DI = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=pnPhvdB0xhiNv4LodPRt0rNBi80=; b=AD4vRrzAEuidPtIpE Grv3BnrNx7Bhv/tcsRGF4gESU5GTHiect92l1IJmnFW0Yko95PK017yODmvxe3fB 7ZYeLLsmjfMgRPhEtcnVhLIrbiTL+1h4nFU/qKKPO3CBeOo9TmCXmmWL27Bc4kHz G1XtyG5A1EeQOl9CRFXed0XsHA= Received: (qmail 126546 invoked by alias); 16 Mar 2015 05:36:22 -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 126522 invoked by uid 89); 16 Mar 2015 05:36:21 -0000 Authentication-Results: sourceware.org; auth=none 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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type; bh=DSpzN7jEjuu8n2PF+ymAI61Ebg8RaTI+OeMqZf9mNpk=; b=dKuXyJouScuYfOHTLraYb4u2NgSLo0EFnKPV7/EJO+aSfMgB9LOv2ysmk6Ub4tWVBX wc4rOAl/U8gNBykMhI7ONmyysWcNtoMpzt5blHXPCFhA/BW7Jya+J0+V+o4FVTY77Syp zVpKMcxS0su51TQNx4dauY//QTKixOINfzPaRe4rEcl430p7HJWPF0feXY3nWjTEoHuK j0ztgmAxBEvPTqVy+e/wfBQ1B/ScvsQfCU5+B1KDa9zmycVJTMwKe+Ks5Dqp4DYlm9CK nkSauWm0DDhqHhWMeAZ94LZq3z9lhHxhfNWtuTuMZVxLU9M5r2oNZXIaHOMYxr7PRRRe Gf7g== X-Gm-Message-State: ALoCoQlVG4mWcn9xRmhso1VpC/1f3zhdyMpzqfaiTbBBfaZrz97xcODFyU9jQ2cK/e+zGmv7nX67 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 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: