From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id D0A3042379 for ; Mon, 14 Mar 2022 22:40:12 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 34CE168B192; Tue, 15 Mar 2022 00:40:10 +0200 (EET) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 058F368AFD2 for ; Tue, 15 Mar 2022 00:40:03 +0200 (EET) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 22EMdYLZ019627-22EMdYLa019627; Tue, 15 Mar 2022 00:39:34 +0200 Received: from foo.martin.st (host-97-187.parnet.fi [77.234.97.187]) by mail9.parnet.fi (Postfix) with ESMTPS id 536C4A150B; Tue, 15 Mar 2022 00:39:34 +0200 (EET) Date: Tue, 15 Mar 2022 00:39:34 +0200 (EET) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: "Pop, Sebastian" In-Reply-To: <1646667914236.71807@amazon.com> Message-ID: <8620d92-679d-7929-1d3a-1439a410395d@martin.st> References: <76da7cb539cd456aa3c25c8470c9c4b5@EX13D07UWB004.ant.amazon.com> <1646667914236.71807@amazon.com> MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM Subject: Re: [FFmpeg-devel] [PATCH] lavc/aarch64: add some neon pix_abs functions X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: "Swinney, Jonathan" , =?ISO-8859-15?Q?Cl=E9ment_B=BDsch?= , "ffmpeg-devel@ffmpeg.org" Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Mon, 7 Mar 2022, Pop, Sebastian wrote: > Here are a few suggestions: > >> + add d18, d17, d18 // add to the end result register >> [...] >> + mov w0, v18.S[0] // copy result to general purpose register > > I think you can use 32-bit register s18 instead of d18. > The mov with indexed vector is more expensive than fmov. Oh, I hadn't considered that. In a tight loop, I can indeed measure a quite significant difference between those. > add s18, s18, s17 > fmov w0, s18 > >> + subs w4, w4, #1 // decrement h and set flags for branch below >> [...] >> + b.ne 2b // branch based on subs instruction above > > Please avoid the flags register to branch. > Instead you could do: > > sub w4, w4, #1 > cbnz w4, 2b If there are other instructions between the sub and the b.ne, does this make any difference? (In most cases one can move the decrement into a suitable gap early in the loop anyway.) I.e. if the flags register already is set since long ago, naively I'd expect that b.ne would be faster (or at least not slower) than cbnz. Some benchmarking on Cortex A53, A72 and A73 seems to agree with my expectations too. (It'd be good if we'd have the patch at hand hooked up in checkasm, so that we could measure and compare exactly the function at hand.) // Martin _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".