Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Niklas Haas <ffmpeg@haasn.xyz>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 6/7] avutil/riscv/asm: add generic push/pop helpers
Date: Thu, 15 Aug 2024 14:13:57 +0200
Message-ID: <20240815141357.GB5114@haasn.xyz> (raw)
In-Reply-To: <468AD5AE-D1E9-4A50-B9F5-5BFD7A595DDB@remlab.net>

On Tue, 13 Aug 2024 18:55:24 +0300 Rémi Denis-Courmont <remi@remlab.net> wrote:
> 
> 
> Le 13 août 2024 17:03:35 GMT+03:00, "J. Dekker" <jdek@itanimul.li> a écrit :
> >From: Niklas Haas <git@haasn.dev>
> >
> >Generic helper macros to push/pop multiple registers at once. Expands to
> >a single `addi` plus a sequence of XLEN-sized stores/loads.
> >---
> > libavutil/riscv/asm.S | 37 +++++++++++++++++++++++++++++++++++++
> > 1 file changed, 37 insertions(+)
> >
> >diff --git a/libavutil/riscv/asm.S b/libavutil/riscv/asm.S
> >index db190e99ca..3955530e4e 100644
> >--- a/libavutil/riscv/asm.S
> >+++ b/libavutil/riscv/asm.S
> >@@ -288,3 +288,40 @@
> >         .macro  count_args args:vararg
> >         count_args_inner 0, \args
> >         .endm
> >+
> >+        /**
> >+         * Helper macro to iterate over constant sized elements in memory
> >+         * @param op operation to perform on each element (sized load/store)
> >+         * @param size size in bytes per element
> >+         * @param offset starting offset of first element
> >+         * @param addr base address to load/store
> >+         * @param regs registers to iterate over
> >+         */
> >+        .macro  for_mem op, size, offset, addr, reg, regs:vararg
> >+        .ifnb \reg
> >+        \op     \reg, \offset(\addr)
> >+        for_mem \op, \size, \offset + \size, \addr, \regs
> >+        .endif
> >+        .endm
> >+
> >+        /**
> >+         * Push a variable number of registers to the stack.
> >+         * @param n number of registers to push
> >+         * @param regs registers to push
> >+         */
> >+        .macro  push regs:vararg
> >+        count_args \regs
> >+        addi    sp, sp, -(num_args * (__riscv_xlen >> 3))
> >+        for_mem sx, __riscv_xlen >> 3, 0, sp, \regs
> >+        .endm
> 
> This is not in line with the psABI specification for RV32 and RV64. Ditto below.

Missing alignment to multiples of 16 bytes, what else?

> 
> It's also not in line with the RV128 ABI since that doesn't even exist yet.
> 
> >+
> >+        /**
> >+         * Pop a variable number of registers from the stack.
> >+         * @param n number of registers to pop
> >+         * @param[out] regs registers to pop
> >+         */
> >+        .macro  pop regs:vararg
> >+        count_args \regs
> >+        for_mem lx, __riscv_xlen >> 3, 0, sp, \regs
> >+        addi    sp, sp, num_args * (__riscv_xlen >> 3)
> >+        .endm
> _______________________________________________
> 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".
_______________________________________________
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".

  reply	other threads:[~2024-08-15 12:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 14:03 [FFmpeg-devel] [PATCH 1/7] checkasm: add csv/tsv bench output J. Dekker
2024-08-13 14:03 ` [FFmpeg-devel] [PATCH 2/7] checkasm: improve print format J. Dekker
2024-08-13 16:39   ` Lynne via ffmpeg-devel
2024-08-13 14:03 ` [FFmpeg-devel] [PATCH 3/7] checkasm: add wildcompares for test & functions J. Dekker
2024-08-13 14:03 ` [FFmpeg-devel] [PATCH 4/7] avutil/riscv/asm: add stack pushing helpers J. Dekker
2024-08-13 15:51   ` Rémi Denis-Courmont
2024-08-13 16:10     ` epirat07
2024-08-13 16:13       ` Rémi Denis-Courmont
2024-08-13 14:03 ` [FFmpeg-devel] [PATCH 5/7] avutil/riscv/asm: add helper macro to count varargs J. Dekker
2024-08-13 14:03 ` [FFmpeg-devel] [PATCH 6/7] avutil/riscv/asm: add generic push/pop helpers J. Dekker
2024-08-13 15:55   ` Rémi Denis-Courmont
2024-08-15 12:13     ` Niklas Haas [this message]
2024-08-13 14:03 ` [FFmpeg-devel] [PATCH 7/7] avcodec/riscv: add h264 qpel J. Dekker

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=20240815141357.GB5114@haasn.xyz \
    --to=ffmpeg@haasn.xyz \
    --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