From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 31D4638618F3 for ; Thu, 21 Jan 2021 13:19:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 31D4638618F3 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D937111B3; Thu, 21 Jan 2021 05:19:24 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 48D393F68F; Thu, 21 Jan 2021 05:19:24 -0800 (PST) From: Richard Sandiford To: Joel Hutton via Gcc-patches Mail-Followup-To: Joel Hutton via Gcc-patches , Joel Hutton , rguenther@suse.de, richard.sandiford@arm.com Cc: Joel Hutton , rguenther@suse.de Subject: Re: [AArch64] Remove backend support for widen-sub References: Date: Thu, 21 Jan 2021 13:19:22 +0000 In-Reply-To: (Joel Hutton via Gcc-patches's message of "Thu, 21 Jan 2021 11:36:01 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, 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-List-Received-Date: Thu, 21 Jan 2021 13:19:26 -0000 Joel Hutton via Gcc-patches writes: > Hi all,=20 > > This patch removes support for the widening subtract operation in the aar= ch64 backend as it is causing a performance regression. > > In the following example: > > #include > extern void wdiff( int16_t d[16], uint8_t *restrict pix1, uint8_t *restri= ct pix2) > { > =C2=A0 =C2=A0for( int y =3D 0; y < 4; y++ ) > =C2=A0 { =C2=A0 =C2=A0 > =C2=A0 =C2=A0 for( int x =3D 0; x < 4; x++ ) > =C2=A0 =C2=A0 =C2=A0 d[x + y*4] =3D pix1[x] - pix2[x]; > =C2=A0 =C2=A0 pix1 +=3D 16; =C2=A0 > =C2=A0 =C2=A0 pix2 +=3D 16; > =C2=A0} > > The widening minus pattern is recognized and substituted, but cannot be u= sed due to the input vector type chosen in slp vectorization. This results = in an attempt to do an 8 byte->8 short widening subtract operation, which i= s not supported.=20 > > The issue is documented in PR 98772. IMO removing just the sub patterns is too arbitrary. Like you say, the PR affects all widening instructions. but it happens that the first encountered regression used subtraction. I think we should try to fix the PR instead. The widening operations can only be used for SLP if the group_size is at least double the number of elements in the vectype, so one idea (not worked through) is to make the vect_build_slp_tree family of routines undo pattern recognition for widening operations if the group size is less than that. Richi would know better than me though. Thanks, Richard > > > [AArch64] Remove backend support for widen-sub > > This patch removes support for the widening subtract operation in the aar= ch64 backend as it is causing a performance regression. > > gcc/ChangeLog: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 * config/aarch64/aarch64-simd.md =C2=A0 =C2=A0 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 (vec_widen_subl_lo_): Removed. > =C2=A0 =C2=A0 =C2=A0 =C2=A0 (vec_widen_subl_hi_): Removed. > > gcc/testsuite/ChangeLog: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 * gcc.target/aarch64/vect-widen-sub.c: Remove= d.