Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Rémi Denis-Courmont" <remi@remlab.net>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 3/3] lavc/sbrdsp: R-V V neg_odd_64
Date: Sun, 29 Oct 2023 22:25:59 +0200
Message-ID: <20231029202559.95350-3-remi@remlab.net> (raw)
In-Reply-To: <20231029202559.95350-1-remi@remlab.net>

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".

      parent reply	other threads:[~2023-10-29 20:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-29 20:25 [FFmpeg-devel] [PATCH 1/3] lavc/sbrdsp: R-V V sum64x5 Rémi Denis-Courmont
2023-10-29 20:25 ` [FFmpeg-devel] [PATCH 2/3] lavc/sbrdsp: R-V V sum_square Rémi Denis-Courmont
2023-10-29 20:25 ` Rémi Denis-Courmont [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231029202559.95350-3-remi@remlab.net \
    --to=remi@remlab.net \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git