From patchwork Sun Sep 4 13:55:00 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: 37646 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp2093265pzh; Sun, 4 Sep 2022 06:55:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR4hbadQzskFDEAcA0ZoYe4PYDJjmer57Aw8RJSXhGOPpohVsPWz9u3HNcXK1VLrHuUjT4Z0 X-Received: by 2002:a17:907:3e07:b0:741:7db9:eb74 with SMTP id hp7-20020a1709073e0700b007417db9eb74mr23662687ejc.83.1662299734056; Sun, 04 Sep 2022 06:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662299734; cv=none; d=google.com; s=arc-20160816; b=BhDvXrQh440NTNA9gNjgHekI9POBZbVDGqA3MDJNEAs0mh6whr8GH0E5QGpCFC/hmm RloMkEb9lcbxbH9i24++dR0OMJSyJkZ8qs1tzUvwOvdJNTzXET7z2dcOOC8gCwrQN9m7 rdD6+mipuTUv9QutZCYZUGcPnxUjwnkmDmTH5eta2OeY6ieL2DZTciiRzI0S4ICrfwG3 Vy9Fls7Lg7srgFGslwv2yBkMEU+XHgZfVcltMfVhiJ41kvEdW33Ck5UUSaQqT6g29VPw dp8tOWX42DSSBpBiIg8/vym1es6cuHC2o3OwaroiqirzlbyHG9CPudhGOh2htgwV4oBn LIRg== 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=2y9TGIhqDkFBImbF4f7P6zj0QylSAws/7ZnVI9KOkk0=; b=jYidqL25ItUoANQaQLH5Vz9c6awKM8ZPkJ+PdZ+NdjqEUxCUDjyKF6ZCnRVVA7bJYb ZdJU09oFFP5TplmR1r4GmqxIx1sNbJ9nBkhlO3jPID35zGZWR89pHHnJTmJgFNARRRUz 3jq7hyjQ+iZvlgnvPBI+DEF96c7r4qWVaoKZuWWpd47LG8UBB3COV52zouvXEbA9m4h0 i2NJxru9rA5nqKdJVhsZ4LRUBl/maGVANs2oWRsteXMl1w6mE/dCtIwVPm9gJ42Lw6g3 k9Vo6DsuYWVYeArMyZqVhQWcGaLO+Q1SVOakyGqzvM+hTSv+5CvcRgcuGHM9rGLa3yBO 1pow== 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 w10-20020a056402268a00b00448da245f3bsi6717400edd.6.2022.09.04.06.55.33; Sun, 04 Sep 2022 06:55:34 -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 8846B68BAAA; Sun, 4 Sep 2022 16:55:08 +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 B994E68BA9F for ; Sun, 4 Sep 2022 16:55:04 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 791E6C00AD for ; Sun, 4 Sep 2022 16:55:04 +0300 (EEST) From: remi@remlab.net To: ffmpeg-devel@ffmpeg.org Date: Sun, 4 Sep 2022 16:55:00 +0300 Message-Id: <20220904135503.116704-7-remi@remlab.net> X-Mailer: git-send-email 2.37.2 In-Reply-To: <3372981.QJadu78ljV@basile.remlab.net> References: <3372981.QJadu78ljV@basile.remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 07/10] riscv: float vector sum-and-difference with RVV 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: iaUNBXwXJfyT From: RĂ©mi Denis-Courmont --- libavutil/riscv/float_dsp_init.c | 2 ++ libavutil/riscv/float_dsp_rvv.S | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/libavutil/riscv/float_dsp_init.c b/libavutil/riscv/float_dsp_init.c index 8539fe9ac5..2165394585 100644 --- a/libavutil/riscv/float_dsp_init.c +++ b/libavutil/riscv/float_dsp_init.c @@ -30,6 +30,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); @@ -47,6 +48,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_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 27190c21ff..61beb868b0 100644 --- a/libavutil/riscv/float_dsp_rvv.S +++ b/libavutil/riscv/float_dsp_rvv.S @@ -98,6 +98,24 @@ func ff_vector_fmul_add_rvv ret endfunc +// (a0) = (a0) + (a1), (a1) = (a0) - (a1) [0..a2-1] +func ff_butterflies_float_rvv +1: vsetvli t0, a2, e32, m8, 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 1: vsetvli t0, a3, e64, m8, ta, ma