From patchwork Thu Sep 22 18:37:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= X-Patchwork-Id: 38172 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp515625pzh; Thu, 22 Sep 2022 11:39:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7xddSGbMyq0g1QJ1ByzFHAiT85yBxF/xNcBLcXpCvtvfZ1gma/J53DoTg7rDICAPqvy/tb X-Received: by 2002:aa7:d51a:0:b0:453:9086:fc37 with SMTP id y26-20020aa7d51a000000b004539086fc37mr4826952edq.174.1663871966568; Thu, 22 Sep 2022 11:39:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663871966; cv=none; d=google.com; s=arc-20160816; b=m+48QU5Wb+r35H/HaOzG1ZyNnNltm5Vcc9qHM7I+m1DvWSsfnEyEnDrvMbvuL/tpEy U6YXDb5S/hjumAhg40pVym2mLL7p6CYbsw0OyWpFVfmnvV5/ag3VQUTe6hZA0VVL7PEo tLNGLDmueU3Zl9SafOR5HjqQn0t6eTE0gdfcEodWzPDjSwOhG9li621yKlGQcJJJ7Mns 7vHUo90ygnoPdIAUrY7tWTjAlYByGVPZkXw6zKrc8oAAdC6GRUuvfdX0awW9bb3QwmNT Np+CfNAv8yDGQEbedginJGo20PqmGUzP37n/tWLy5u5HX7MXkDOyiWw2lQwaRcnQC7Xz 9Tlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=KafWOMGWK8X6JFzASheiByq7Z/FAq/fmw8macWyMzZw=; b=rkw4Z8itxzc5qZt2S0V5zTuIxEJRNncKTlhw3uQK+9Wsf4QjtsNR7k4rOvhXHz0+sC jAj2QqMZOZ47UFhmIVQtJ3PZT26vyN4gnN1s6w5iYoFlJJ1hjKL6QXI/niYvVX/mauBE p/j03y/+FRFc/IBzrDWW5D8zRe6h10yjmNRHI8TQ01YYoKFhP4Hx0K3A7Zjj/2pcHg50 u5TgJHUTlWU9SgjgJYGyy28MK2BLJT2qCDItYXKEWjSS8WS6gek97stwhBAIObteT7+p r2/ir0dbzBPgp7+t/8yV6Psg/+lLR/7db2Xm4jU7FgHPL8til+W5CNR2JJ4kYUuBORHr Doxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i22-20020a1709064fd600b0072b7fac8a7asi6340250ejw.926.2022.09.22.11.39.26; Thu, 22 Sep 2022 11:39:26 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5562F68BC02; Thu, 22 Sep 2022 21:37:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3A3F468BA31 for ; Thu, 22 Sep 2022 21:37:32 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id D8028C00BB for ; Thu, 22 Sep 2022 21:37:28 +0300 (EEST) From: remi@remlab.net To: ffmpeg-devel@ffmpeg.org Date: Thu, 22 Sep 2022 21:37:12 +0300 Message-Id: <20220922183726.38624-15-remi@remlab.net> X-Mailer: git-send-email 2.37.2 In-Reply-To: <12078904.O9o76ZdvQC@basile.remlab.net> References: <12078904.O9o76ZdvQC@basile.remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 15/29] lavu/floatdsp: RISC-V V vector_fmul_reversed 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: KZegJbvU8oDs From: RĂ©mi Denis-Courmont --- libavutil/riscv/float_dsp_init.c | 3 +++ libavutil/riscv/float_dsp_rvv.S | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/libavutil/riscv/float_dsp_init.c b/libavutil/riscv/float_dsp_init.c index f164b1308f..9b8fd9942b 100644 --- a/libavutil/riscv/float_dsp_init.c +++ b/libavutil/riscv/float_dsp_init.c @@ -33,6 +33,8 @@ void ff_vector_fmul_scalar_rvv(float *dst, const float *src, float mul, int len); void ff_vector_fmul_add_rvv(float *dst, const float *src0, const float *src1, const float *src2, int len); +void ff_vector_fmul_reverse_rvv(float *dst, const float *src0, + const float *src1, int len); void ff_butterflies_float_rvv(float *v1, float *v2, int len); void ff_vector_dmul_rvv(double *dst, const double *src0, const double *src1, @@ -52,6 +54,7 @@ av_cold void ff_float_dsp_init_riscv(AVFloatDSPContext *fdsp) fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_rvv; fdsp->vector_fmul_scalar = ff_vector_fmul_scalar_rvv; fdsp->vector_fmul_add = ff_vector_fmul_add_rvv; + fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_rvv; fdsp->butterflies_float = ff_butterflies_float_rvv; if (flags & AV_CPU_FLAG_RV_ZVE64D) { diff --git a/libavutil/riscv/float_dsp_rvv.S b/libavutil/riscv/float_dsp_rvv.S index 0366009213..6a1304d24a 100644 --- a/libavutil/riscv/float_dsp_rvv.S +++ b/libavutil/riscv/float_dsp_rvv.S @@ -96,6 +96,28 @@ func ff_vector_fmul_add_rvv, zve32f ret endfunc +// (a0) = (a1) * reverse(a2) [0..a3-1] +func ff_vector_fmul_reverse_rvv, zve32f + add t3, a3, -1 + li t2, -4 // byte stride + slli t3, t3, 2 + add a2, a2, t3 +1: + vsetvli t0, a3, e32, m1, ta, ma + slli t1, t0, 2 + vle32.v v16, (a1) + add a1, a1, t1 + vlse32.v v24, (a2), t2 + sub a2, a2, t1 + vfmul.vv v16, v16, v24 + sub a3, a3, t0 + vse32.v v16, (a0) + add a0, a0, t1 + bnez a3, 1b + + ret +endfunc + // (a0) = (a0) + (a1), (a1) = (a0) - (a1) [0..a2-1] func ff_butterflies_float_rvv, zve32f 1: