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 1798D46AC3 for ; Sun, 2 Jul 2023 20:18:55 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D28BF68C424; Sun, 2 Jul 2023 23:18:52 +0300 (EEST) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2DA0B68C3FC for ; Sun, 2 Jul 2023 23:18:46 +0300 (EEST) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 362KIjtc013623-362KIjtd013623; Sun, 2 Jul 2023 23:18:45 +0300 Received: from foo.martin.st (host-97-187.parnet.fi [77.234.97.187]) by mail9.parnet.fi (Postfix) with ESMTPS id 349FEA146B; Sun, 2 Jul 2023 23:18:44 +0300 (EEST) Date: Sun, 2 Jul 2023 23:18:44 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: FFmpeg development discussions and patches In-Reply-To: <4dk2aitjmvbkevaogr2knejgvt293ksajc@4ax.com> Message-ID: References: <20230629175729.224383-1-jc@kynesim.co.uk> <20230629175729.224383-5-jc@kynesim.co.uk> <4dk2aitjmvbkevaogr2knejgvt293ksajc@4ax.com> MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM Subject: Re: [FFmpeg-devel] [PATCH 04/15] avfilter/vf_bwdif: Add neon for filter_intra 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: thomas.mundt@hr.de 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 Sun, 2 Jul 2023, John Cox wrote: > On Sun, 2 Jul 2023 00:37:35 +0300 (EEST), you wrote: > >>> + >>> + uaddl v20.8h, v31.8b, v30.8b >>> + uaddl2 v21.8h, v31.16b, v30.16b >>> + >>> + UMULL4K v2, v3, v4, v5, v20, v21, v0.h[6] >>> + >>> + uaddl v20.8h, v29.8b, v28.8b >>> + uaddl2 v21.8h, v29.16b, v28.16b >>> + >>> + UMLSL4K v2, v3, v4, v5, v20, v21, v0.h[7] >>> + >>> +// dst[0] = av_clip(interpol, 0, clip_max); >>> + SQSHRUNN v2, v2, v3, v4, v5, 13 >>> + str q2, [x0], #16 >>> + >>> +// dst++; >>> +// cur++; >>> +// } >>> + >>> + subs w2, w2, #16 >>> + add x1, x1, #16 >> >> For in-order cores, it might be good to update these variables sometime >> sooner, e.g. before the str instruction. But such scheduling breaks your >> mapping between neat C code and assembly. > > I take your point but there is at least 1 instruction between set and > use which is normally enough. True, in most cases, it's enough, but sometimes you can save more if there's a stall bubble elsewhere too. > I did my benching on a Pi4 and found, to my surprise, that in most cases > reordering instructions to interleavse operations made life worse and > seeing as Pi4 is my target platform I stopped trying to do that and > stuck with code that was easier to read! (Also filter_intra seems to be > much more memory b/w limited than code limited on a Pi4.) A Raspberry Pi 4 is Cortex A72, and that one has got out of order execution, so you generally won't be able to notice most of the effects of instruction scheduling. On actual in-order cores, like Cortex A53 (found in e..g the Pi3 and lots of other places), scheduling can have a fairly dramatic effect though. In any case, here it's not a big concern, and one instruction inbetween usually is good enough indeed. // 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".