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 64DCC4516F for ; Mon, 12 Jun 2023 08:09:17 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E7BD868C32C; Mon, 12 Jun 2023 11:09:14 +0300 (EEST) Received: from mail8.parnet.fi (mail8.parnet.fi [77.234.108.134]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B7BD868BF72 for ; Mon, 12 Jun 2023 11:09:07 +0300 (EEST) Received: from mail9.parnet.fi (mail9.parnet.fi [77.234.108.21]) by mail8.parnet.fi with ESMTP id 35C8969Y020317-35C8969Z020317; Mon, 12 Jun 2023 11:09:06 +0300 Received: from foo.martin.st (host-97-187.parnet.fi [77.234.97.187]) by mail9.parnet.fi (Postfix) with ESMTPS id DE3D0A145F; Mon, 12 Jun 2023 11:09:06 +0300 (EEST) Date: Mon, 12 Jun 2023 11:09:06 +0300 (EEST) From: =?ISO-8859-15?Q?Martin_Storsj=F6?= To: FFmpeg development discussions and patches In-Reply-To: <20230604041756.5196-3-Logan.Lyu@myais.com.cn> Message-ID: <8d881143-3f72-3aee-375-9254f993ee25@martin.st> References: <20230604041756.5196-1-Logan.Lyu@myais.com.cn> <20230604041756.5196-3-Logan.Lyu@myais.com.cn> MIME-Version: 1.0 X-FE-Policy-ID: 3:14:2:SYSTEM Subject: Re: [FFmpeg-devel] [PATCH 3/5] lavc/aarch64: new optimization for 8-bit hevc_epel_uni_w_v 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: Logan Lyu 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, 4 Jun 2023, Logan.Lyu@myais.com.cn wrote: > From: Logan Lyu > > Signed-off-by: Logan Lyu > --- > libavcodec/aarch64/hevcdsp_epel_neon.S | 504 ++++++++++++++++++++++ > libavcodec/aarch64/hevcdsp_init_aarch64.c | 6 + > 2 files changed, 510 insertions(+) > > diff --git a/libavcodec/aarch64/hevcdsp_epel_neon.S b/libavcodec/aarch64/hevcdsp_epel_neon.S > index fe494dd843..4841f49dab 100644 > --- a/libavcodec/aarch64/hevcdsp_epel_neon.S > +++ b/libavcodec/aarch64/hevcdsp_epel_neon.S > +function ff_hevc_put_hevc_epel_uni_w_v48_8_neon, export=1 > + stp q8, q9, [sp, #-32] > + stp q10, q11, [sp, #-64] This backs up values on the stack without decrementing the stack pointer, i.e. storing it in the red zone. Whether this is supported depends on the platform ABI. Linux and macOS have a 128 byte red zone on aarch64, while Windows only has 16 bytes. So for portability, don't rely on a red zone at all. I.e., here please decrement the stack pointer like in a previous patch: stp q8, q9, [sp, #-64]! stp q10, q11, [sp, #32] And inversely when restoring it. > + EPEL_UNI_W_V_HEADER > + > + ld1 {v16.16b, v17.16b, v18.16b}, [x2], x3 > + ld1 {v19.16b, v20.16b, v21.16b}, [x2], x3 > + ld1 {v22.16b, v23.16b, v24.16b}, [x2], x3 > +1: > + ld1 {v25.16b, v26.16b, v27.16b}, [x2], x3 > + > + EPEL_UNI_W_V16_CALC v4, v6, v16, v19, v22, v25, v8, v9, v10, v11 > + EPEL_UNI_W_V16_CALC v5, v7, v17, v20, v23, v26, v8, v9, v10, v11 > + EPEL_UNI_W_V16_CALC v6, v7, v18, v21, v24, v27, v8, v9, v10, v11 > + st1 {v4.16b, v5.16b, v6.16b}, [x0], x1 > + subs w4, w4, #1 > + b.eq 2f > + ld1 {v16.16b, v17.16b, v18.16b}, [x2], x3 > + EPEL_UNI_W_V16_CALC v4, v6, v19, v22, v25, v16, v8, v9, v10, v11 > + EPEL_UNI_W_V16_CALC v5, v7, v20, v23, v26, v17, v8, v9, v10, v11 > + EPEL_UNI_W_V16_CALC v6, v7, v21, v24, v27, v18, v8, v9, v10, v11 > + st1 {v4.16b, v5.16b, v6.16b}, [x0], x1 > + subs w4, w4, #1 > + b.eq 2f > + ld1 {v19.16b, v20.16b, v21.16b}, [x2], x3 > + EPEL_UNI_W_V16_CALC v4, v6, v22, v25, v16, v19, v8, v9, v10, v11 > + EPEL_UNI_W_V16_CALC v5, v7, v23, v26, v17, v20, v8, v9, v10, v11 > + EPEL_UNI_W_V16_CALC v6, v7, v24, v27, v18, v21, v8, v9, v10, v11 > + st1 {v4.16b, v5.16b, v6.16b}, [x0], x1 > + subs w4, w4, #1 > + b.eq 2f > + ld1 {v22.16b, v23.16b, v24.16b}, [x2], x3 > + EPEL_UNI_W_V16_CALC v4, v6, v25, v16, v19, v22, v8, v9, v10, v11 > + EPEL_UNI_W_V16_CALC v5, v7, v26, v17, v20, v23, v8, v9, v10, v11 > + EPEL_UNI_W_V16_CALC v6, v7, v27, v18, v21, v24, v8, v9, v10, v11 > + st1 {v4.16b, v5.16b, v6.16b}, [x0], x1 > + subs w4, w4, #1 > + b.hi 1b > +2: > + ldp q8, q9, [sp, #-32] > + ldp q10, q11, [sp, #-64] > + ret > +endfunc > + > +function ff_hevc_put_hevc_epel_uni_w_v64_8_neon, export=1 > + stp q8, q9, [sp, #-32] > + stp q10, q11, [sp, #-64] > + stp q12, q13, [sp, #-96] > + stp q14, q15, [sp, #-128] Same thing here. // 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".