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 1CDB947E7E for ; Sun, 29 Oct 2023 20:26:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0F6A968CC75; Sun, 29 Oct 2023 22:26:09 +0200 (EET) Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B0DBA68CC64 for ; Sun, 29 Oct 2023 22:26:00 +0200 (EET) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 4FAE0C01A3 for ; Sun, 29 Oct 2023 22:26:00 +0200 (EET) From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Sun, 29 Oct 2023 22:25:59 +0200 Message-ID: <20231029202559.95350-3-remi@remlab.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231029202559.95350-1-remi@remlab.net> References: <20231029202559.95350-1-remi@remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] lavc/sbrdsp: R-V V neg_odd_64 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: With 128-bit vectors, this is mostly pointless but also harmless. Performance gains should be more noticeable with larger vector sizes. neg_odd_64_c: 76.2 neg_odd_64_rvv_i64: 74.7 --- libavcodec/riscv/sbrdsp_init.c | 5 +++++ libavcodec/riscv/sbrdsp_rvv.S | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/libavcodec/riscv/sbrdsp_init.c b/libavcodec/riscv/sbrdsp_init.c index e0e62278b0..1b85b2cae9 100644 --- a/libavcodec/riscv/sbrdsp_init.c +++ b/libavcodec/riscv/sbrdsp_init.c @@ -25,6 +25,7 @@ void ff_sbr_sum64x5_rvv(float *z); float ff_sbr_sum_square_rvv(float (*x)[2], int n); +void ff_sbr_neg_odd_64_rvv(float *x); av_cold void ff_sbrdsp_init_riscv(SBRDSPContext *c) { @@ -35,5 +36,9 @@ av_cold void ff_sbrdsp_init_riscv(SBRDSPContext *c) c->sum64x5 = ff_sbr_sum64x5_rvv; c->sum_square = ff_sbr_sum_square_rvv; } +#if __riscv_xlen >= 64 + if ((flags & AV_CPU_FLAG_RVV_I64) && (flags & AV_CPU_FLAG_RVB_ADDR)) + c->neg_odd_64 = ff_sbr_neg_odd_64_rvv; +#endif #endif } diff --git a/libavcodec/riscv/sbrdsp_rvv.S b/libavcodec/riscv/sbrdsp_rvv.S index 4684630953..b510190b15 100644 --- a/libavcodec/riscv/sbrdsp_rvv.S +++ b/libavcodec/riscv/sbrdsp_rvv.S @@ -67,3 +67,20 @@ func ff_sbr_sum_square_rvv, zve32f NOHWF fmv.x.w a0, fa0 ret endfunc + +#if __riscv_xlen >= 64 +func ff_sbr_neg_odd_64_rvv, zve64x + li a1, 32 + li t1, 1 << 63 +1: + vsetvli t0, a1, e64, m8, ta, ma + vle64.v v8, (a0) + sub a1, a1, t0 + vxor.vx v8, v8, t1 + vse64.v v8, (a0) + sh3add a0, t0, a0 + bnez t0, 1b + + ret +endfunc +#endif -- 2.42.0 _______________________________________________ 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".