From patchwork Tue Sep 20 14:40:01 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: 38085 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3b1c:b0:96:9ee8:5cfd with SMTP id c28csp1989219pzh; Tue, 20 Sep 2022 07:41:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Ym6z5NL6eYJjuAgP0nbMdlll27IiJB6Ji6xgSsO9KxNN83MBjxGVetr6Y/0egymTZkjNv X-Received: by 2002:a05:6402:1ad1:b0:44e:8dfb:2d04 with SMTP id ba17-20020a0564021ad100b0044e8dfb2d04mr20100398edb.400.1663684906755; Tue, 20 Sep 2022 07:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663684906; cv=none; d=google.com; s=arc-20160816; b=0+waj5/XHbynMcrBu8EGWp0+CMQgrhZ9lpUddNjoXuTv/A84m5D6bP7u0ffK/VGml5 K2GvoU71m1DX3lphlc7JPOBVjP7zA6YAwE7Km/PAT0mBVlNlCVldRD8vuH9+XJmG5EUs qTggAaWqg5s8NnsAPFoShLUhS5vx0s+rhOiKvuAoNcChYE0Vr1Slj3PC92aHVgCPte0Z tNBCDszdmaPotKCr6YfKZFQ/ilR5ukWrmtChqPqLEpq8mXu71ZxD0Dx/kTU+Io1IFsAf u2niZhIKe2u1bmy8kTCD2Pl50KPYg+C11Su+tyvRBtwZpQMfjcbqoft3RIljHiJFTeIO SHJA== 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=m+iYu17eYDStbCcyU4pKfVecoF7rqEky1WwbPJkJ1t4=; b=cOTAvWSIttFn6rlP51LQz4VYt//Duiar9Ej65vVPbiRgrQRbye76pjlfiw8D0wz5g8 BTxK1hn5EDjVJJBdAoAjefxerSF/jpfpEe7hAM3/6OP5+vTZU2RXanbg0jm/9GFa9IUq 9i1tgqTFFOn2oYbZNaXiGKk0kVb7HjieSSlE1CeZrQx2yzt1Y9Td0JonU181IpzX4iCj yLZi/Vt0FILXy+rvcVdgh/MQmA7Dcn+B+P+KJdEfbmEBErz+G1EM+nqlAsIOQ6158bR5 Kcho7X4U16axf0/ly15D10Pdv3TZY85BcrG4ilkTzijCf2/KS7baakFxMXp2owhXGxCA nhEw== 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 cr5-20020a056402222500b0044eecc780fasi218111edb.188.2022.09.20.07.41.46; Tue, 20 Sep 2022 07:41:46 -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 07B0168BB98; Tue, 20 Sep 2022 17:40:30 +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 1D29668BA9B for ; Tue, 20 Sep 2022 17:40:20 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 6FF26C00BA for ; Tue, 20 Sep 2022 17:40:16 +0300 (EEST) From: remi@remlab.net To: ffmpeg-devel@ffmpeg.org Date: Tue, 20 Sep 2022 17:40:01 +0300 Message-Id: <20220920144013.4959-14-remi@remlab.net> X-Mailer: git-send-email 2.37.2 In-Reply-To: <5602865.DvuYhMxLoT@basile.remlab.net> References: <5602865.DvuYhMxLoT@basile.remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 14/26] lavu/floatdsp: RISC-V V butterflies_float 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: lFpS31/mpz+y From: RĂ©mi Denis-Courmont --- libavutil/riscv/float_dsp_init.c | 2 ++ libavutil/riscv/float_dsp_rvv.S | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/libavutil/riscv/float_dsp_init.c b/libavutil/riscv/float_dsp_init.c index 2ddd2050f7..f164b1308f 100644 --- a/libavutil/riscv/float_dsp_init.c +++ b/libavutil/riscv/float_dsp_init.c @@ -33,6 +33,7 @@ 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_butterflies_float_rvv(float *v1, float *v2, int len); void ff_vector_dmul_rvv(double *dst, const double *src0, const double *src1, int len); @@ -51,6 +52,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->butterflies_float = ff_butterflies_float_rvv; if (flags & AV_CPU_FLAG_RV_ZVE64D) { fdsp->vector_dmul = ff_vector_dmul_rvv; diff --git a/libavutil/riscv/float_dsp_rvv.S b/libavutil/riscv/float_dsp_rvv.S index 9b68187e01..0366009213 100644 --- a/libavutil/riscv/float_dsp_rvv.S +++ b/libavutil/riscv/float_dsp_rvv.S @@ -96,6 +96,25 @@ func ff_vector_fmul_add_rvv, zve32f ret endfunc +// (a0) = (a0) + (a1), (a1) = (a0) - (a1) [0..a2-1] +func ff_butterflies_float_rvv, zve32f +1: + vsetvli t0, a2, e32, m1, ta, ma + slli t1, t0, 2 + vle32.v v16, (a0) + vle32.v v24, (a1) + vfadd.vv v0, v16, v24 + vfsub.vv v8, v16, v24 + sub a2, a2, t0 + vse32.v v0, (a0) + add a0, a0, t1 + vse32.v v8, (a1) + add a1, a1, t1 + bnez a2, 1b + + ret +endfunc + // (a0) = (a1) * (a2) [0..a3-1] func ff_vector_dmul_rvv, zve64d 1: