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 104F848201 for ; Sun, 12 Nov 2023 20:14:14 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9781068CC5D; Sun, 12 Nov 2023 22:14:12 +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 A77C668CA9B for ; Sun, 12 Nov 2023 22:14:11 +0200 (EET) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 03AE3C009A for ; Sun, 12 Nov 2023 22:14:10 +0200 (EET) From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Sun, 12 Nov 2023 22:14:08 +0200 Message-ID: <20231112201410.25525-2-remi@remlab.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231112201410.25525-1-remi@remlab.net> References: <20231112201410.25525-1-remi@remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] lavc/llauddsp: R-V V scalarproduct_and_madd_int32 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: scalarproduct_and_madd_int32_c: 10899.7 scalarproduct_and_madd_int32_rvv_i32: 1749.0 --- libavcodec/riscv/llauddsp_init.c | 4 ++++ libavcodec/riscv/llauddsp_rvv.S | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/libavcodec/riscv/llauddsp_init.c b/libavcodec/riscv/llauddsp_init.c index ea023f73e6..1924b36821 100644 --- a/libavcodec/riscv/llauddsp_init.c +++ b/libavcodec/riscv/llauddsp_init.c @@ -27,6 +27,9 @@ int32_t ff_scalarproduct_and_madd_int16_rvv(int16_t *v1, const int16_t *v2, const int16_t *v3, int len, int mul); +int32_t ff_scalarproduct_and_madd_int32_rvv(int16_t *v1, const int32_t *v2, + const int16_t *v3, int len, + int mul); av_cold void ff_llauddsp_init_riscv(LLAudDSPContext *c) { @@ -35,6 +38,7 @@ av_cold void ff_llauddsp_init_riscv(LLAudDSPContext *c) if ((flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB_ADDR)) { c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_rvv; + c->scalarproduct_and_madd_int32 = ff_scalarproduct_and_madd_int32_rvv; } #endif } diff --git a/libavcodec/riscv/llauddsp_rvv.S b/libavcodec/riscv/llauddsp_rvv.S index 74adb338a9..5569864832 100644 --- a/libavcodec/riscv/llauddsp_rvv.S +++ b/libavcodec/riscv/llauddsp_rvv.S @@ -43,3 +43,29 @@ func ff_scalarproduct_and_madd_int16_rvv, zve32x vmv.x.s a0, v0 ret endfunc + +func ff_scalarproduct_and_madd_int32_rvv, zve32x + vsetvli t0, zero, e32, m8, ta, ma + vmv.v.x v0, zero +1: + vsetvli t0, a3, e32, m8, tu, ma + vle16.v v8, (a0) + sub a3, a3, t0 + vsext.vf2 v24, v8 + vle32.v v16, (a1) + sh2add a1, t0, a1 + vmacc.vv v0, v16, v24 + vsetvli zero, zero, e16, m4, ta, ma + vle16.v v24, (a2) + sh1add a2, t0, a2 + vmacc.vx v8, a4, v24 + vse16.v v8, (a0) + sh1add a0, t0, a0 + bnez a3, 1b + + vsetvli t0, zero, e32, m8, ta, ma + vmv.s.x v8, zero + vredsum.vs v0, v0, v8 + vmv.x.s a0, v0 + ret +endfunc -- 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".