From patchwork Tue Mar 30 20:19:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1460240 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@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.a=rsa-sha256 header.s=default header.b=n69ySo/i; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F915Q2mQ3z9sRR for ; Wed, 31 Mar 2021 07:19:52 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BCFFD3857813; Tue, 30 Mar 2021 20:19:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BCFFD3857813 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1617135586; bh=6oQ/bq9WlBFSwhizVgVLmVJULZZ9ZCYi+Gx9q3KwVBc=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=n69ySo/ilmW1dzlMyn0ArQuMvjIOaOM14Qmt60VkJx4lHxRwGyOY2ONcfcOpmixZS XZLDt14BZ+/1eP5oDALUuGuFsMS5l6jaRSGV3r8X6VIK+BoIQZQjOKDn22/stLX8jD 2bb6UGCGGDre9IfVqKrdh4b6TNJWWRorU/l3P3vg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 714AB385802D for ; Tue, 30 Mar 2021 20:19:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 714AB385802D Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-505-0QwHbfJDPXKpuKvquY90xQ-1; Tue, 30 Mar 2021 16:19:40 -0400 X-MC-Unique: 0QwHbfJDPXKpuKvquY90xQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AC936801817; Tue, 30 Mar 2021 20:19:38 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-112-95.ams2.redhat.com [10.36.112.95]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0847EA4F9A; Tue, 30 Mar 2021 20:19:37 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 12UKJZAE1780352 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 30 Mar 2021 22:19:36 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 12UKJYJg1780351; Tue, 30 Mar 2021 22:19:34 +0200 Date: Tue, 30 Mar 2021 22:19:34 +0200 To: Richard Earnshaw , Richard Sandiford , Marcus Shawcroft , Kyrylo Tkachov Subject: [PATCH] aarch64: Fix up *add3_poly_1 [PR99813] Message-ID: <20210330201934.GN1179226@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi! As mentioned in the PR, Uai constraint stands for aarch64_sve_scalar_inc_dec_immediate while Uav for aarch64_sve_addvl_addpl_immediate. Both *add3_aarch64 and *add3_poly_1 patterns use * return aarch64_output_sve_scalar_inc_dec (operands[2]); * return aarch64_output_sve_addvl_addpl (operands[2]); in that order, but the former with Uai,Uav order, while the latter with Uav,Uai instead. This patch swaps the constraints so that they match the output. Bootstrapped/regtested on aarch64-linux, ok for trunk? 2021-03-30 Jakub Jelinek Richard Sandiford PR target/99813 * config/aarch64/aarch64.md (*add3_poly_1): Swap Uai and Uav constraints on operands[2] and similarly 0 and rk constraints on operands[1] corresponding to that. * g++.target/aarch64/sve/pr99813.C: New test. Jakub --- gcc/config/aarch64/aarch64.md.jj 2021-02-25 23:07:07.851319165 +0100 +++ gcc/config/aarch64/aarch64.md 2021-03-30 11:13:35.994077470 +0200 @@ -2050,8 +2050,8 @@ [(set (match_operand:GPI 0 "register_operand" "=r,r,r,r,r,r,&r") (plus:GPI - (match_operand:GPI 1 "register_operand" "%rk,rk,rk,rk,rk,0,rk") - (match_operand:GPI 2 "aarch64_pluslong_or_poly_operand" "I,r,J,Uaa,Uav,Uai,Uat")))] + (match_operand:GPI 1 "register_operand" "%rk,rk,rk,rk,0,rk,rk") + (match_operand:GPI 2 "aarch64_pluslong_or_poly_operand" "I,r,J,Uaa,Uai,Uav,Uat")))] "TARGET_SVE && operands[0] != stack_pointer_rtx" "@ add\\t%0, %1, %2 --- gcc/testsuite/g++.target/aarch64/sve/pr99813.C.jj 2021-03-30 11:22:13.430290522 +0200 +++ gcc/testsuite/g++.target/aarch64/sve/pr99813.C 2021-03-30 11:22:55.526819721 +0200 @@ -0,0 +1,27 @@ +// PR target/99813 +/* { dg-do assemble { target aarch64_asm_sve_ok } } */ +/* { dg-options "-O3 -march=armv8.2-a+sve -fvect-cost-model=unlimited -fno-tree-dominator-opts -mtune=cortex-a72" } */ + +long a, b; +bool c[2][14][2][16], f[2][14][2][16]; +bool d; +char e[2][4][2][6]; +void g() { + a = 0; + for (int h = 0; h < 2; ++h) + for (int i = 0; i < 14; ++i) + for (int j = 0; j < 2; ++j) + for (int k = 0; k < 16; ++k) + c[h][i][j][k] = 0; + d = 0; + for (int h; h < 2; ++h) + for (int i = 0; i < 4; ++i) + for (int j = 0; j < 2; ++j) + for (int k = 0; k < 6; ++k) + e[h][i][j][k] = 6; + for (int h = 0; h < 2; ++h) + for (int i = 0; i < 14; ++i) + for (int j = 0; j < 2; ++j) + for (int k = 0; k < 16; ++k) + f[h][i][j][k] = b = 9; +}