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 40FBE46AC0 for ; Sun, 2 Jul 2023 20:07:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D298C68C492; Sun, 2 Jul 2023 23:07:44 +0300 (EEST) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9630D68C335 for ; Sun, 2 Jul 2023 23:07:37 +0300 (EEST) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 362K7aJw013455-362K7aJx013455; Sun, 2 Jul 2023 23:07:36 +0300 Received: from foo.martin.st (host-97-187.parnet.fi [77.234.97.187]) by mail9.parnet.fi (Postfix) with ESMTPS id ACBC7A146B; Sun, 2 Jul 2023 23:07:35 +0300 (EEST) Date: Sun, 2 Jul 2023 23:07:33 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: John Cox In-Reply-To: Message-ID: References: <20230629175729.224383-1-jc@kynesim.co.uk> <20230629175729.224383-3-jc@kynesim.co.uk> <41d6b9bd-803-a12c-8e90-84dc9dc9beb0@martin.st> MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM Subject: Re: [FFmpeg-devel] [PATCH 02/15] avfilter/vf_bwdif: Add common macros and consts for aarch64 neon 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, FFmpeg development discussions and patches 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:35:14 +0300 (EEST), you wrote: > >> On Thu, 29 Jun 2023, John Cox wrote: >> >>> Add macros for dual scalar half->single multiply and accumulate >>> Add macro for shift, saturate and shorten single to byte >>> Add filter constants >>> >>> Signed-off-by: John Cox >>> --- >>> libavfilter/aarch64/vf_bwdif_neon.S | 46 +++++++++++++++++++++++++++++ >>> 1 file changed, 46 insertions(+) >>> >>> diff --git a/libavfilter/aarch64/vf_bwdif_neon.S b/libavfilter/aarch64/vf_bwdif_neon.S >>> index 639ab22998..a8f0ed525a 100644 >>> --- a/libavfilter/aarch64/vf_bwdif_neon.S >>> +++ b/libavfilter/aarch64/vf_bwdif_neon.S >>> @@ -23,3 +23,49 @@ >>> >>> #include "libavutil/aarch64/asm.S" >>> >>> +.macro SQSHRUNN b, s0, s1, s2, s3, n >>> + sqshrun \s0\().4h, \s0\().4s, #\n - 8 >>> + sqshrun2 \s0\().8h, \s1\().4s, #\n - 8 >>> + sqshrun \s1\().4h, \s2\().4s, #\n - 8 >>> + sqshrun2 \s1\().8h, \s3\().4s, #\n - 8 >>> + uzp2 \b\().16b, \s0\().16b, \s1\().16b >>> +.endm >>> + >>> +.macro SMULL4K a0, a1, a2, a3, s0, s1, k >>> + smull \a0\().4s, \s0\().4h, \k >>> + smull2 \a1\().4s, \s0\().8h, \k >>> + smull \a2\().4s, \s1\().4h, \k >>> + smull2 \a3\().4s, \s1\().8h, \k >>> +.endm >>> + >>> +.macro UMULL4K a0, a1, a2, a3, s0, s1, k >>> + umull \a0\().4s, \s0\().4h, \k >>> + umull2 \a1\().4s, \s0\().8h, \k >>> + umull \a2\().4s, \s1\().4h, \k >>> + umull2 \a3\().4s, \s1\().8h, \k >>> +.endm >>> + >>> +.macro UMLAL4K a0, a1, a2, a3, s0, s1, k >>> + umlal \a0\().4s, \s0\().4h, \k >>> + umlal2 \a1\().4s, \s0\().8h, \k >>> + umlal \a2\().4s, \s1\().4h, \k >>> + umlal2 \a3\().4s, \s1\().8h, \k >>> +.endm >>> + >>> +.macro UMLSL4K a0, a1, a2, a3, s0, s1, k >>> + umlsl \a0\().4s, \s0\().4h, \k >>> + umlsl2 \a1\().4s, \s0\().8h, \k >>> + umlsl \a2\().4s, \s1\().4h, \k >>> + umlsl2 \a3\().4s, \s1\().8h, \k >>> +.endm >>> + >>> +// static const uint16_t coef_lf[2] = { 4309, 213 }; >>> +// static const uint16_t coef_hf[3] = { 5570, 3801, 1016 }; >>> +// static const uint16_t coef_sp[2] = { 5077, 981 }; >>> + >>> + .align 16 >> >> Note that .align for arm is power of two; this triggers a 2^16 byte >> alignment here, which certainly isn't intended. > > Yikes! I'll swap that for a .balign now I've looked that up > >> But in general, the usual way of defining constants is with a >> const/endconst block, which places them in the right rdata section instead >> of in the text section. But that then requires you to use a movrel macro >> for accessing the data, instead of a plain ldr instruction. > > Yeah - arm has a history of mixing text & const - I went with the > simpler code. Is this a deal breaker or can I leave it as is? I wouldn't treat it as a deal breaker as long as it works across all platforms - even if consistency with the code style elsewhere is preferred, but IIRC there may be issues with MS armasm (after passed through gas-preprocessor). IIRC there might be issues with starting out with straight up content without the full setup made by the function/const macros. OTOH I might have fixed that in gas-preprocessor too... Last time around, the patchset failed building in that configuration due ot the out of range alignment, I'll see how it fares now. // 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".