From: "Rémi Denis-Courmont" <remi@remlab.net>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 4/7] avutil/riscv/asm: add stack pushing helpers
Date: Tue, 13 Aug 2024 19:13:24 +0300
Message-ID: <C43FE435-F154-4E3A-A18C-DCE7B539DBBC@remlab.net> (raw)
In-Reply-To: <496E8EC4-3C0C-4936-A3EC-4E5D3986ACEA@gmail.com>
Le 13 août 2024 19:10:48 GMT+03:00, epirat07@gmail.com a écrit :
>On 13 Aug 2024, at 17:51, Rémi Denis-Courmont wrote:
>
>> Le 13 août 2024 17:03:33 GMT+03:00, "J. Dekker" <jdek@itanimul.li> a écrit :
>>> From: Niklas Haas <git@haasn.dev>
>>>
>>> Instead of duplicating these common macros in every file, add them to
>>> the shared utility file. Also add a base case for sanity.
>>
>> Is `#error` a standard directive of C11?
>
>The #error directive dates back to C89:
>https://en.cppreference.com/w/c/preprocessor/error
Ok thanks. Any reason not to use an assembler directive though?
>>
>>> ---
>>> libavcodec/riscv/h264addpx_rvv.S | 10 ----------
>>> libavcodec/riscv/h264idct_rvv.S | 10 ----------
>>> libavcodec/riscv/startcode_rvb.S | 10 ----------
>>> libavutil/riscv/asm.S | 34 ++++++++++++++++++++++++++++++++
>>> 4 files changed, 34 insertions(+), 30 deletions(-)
>>>
>>> diff --git a/libavcodec/riscv/h264addpx_rvv.S b/libavcodec/riscv/h264addpx_rvv.S
>>> index 82739881d9..cf3b742294 100644
>>> --- a/libavcodec/riscv/h264addpx_rvv.S
>>> +++ b/libavcodec/riscv/h264addpx_rvv.S
>>> @@ -26,16 +26,6 @@
>>>
>>> #include "libavutil/riscv/asm.S"
>>>
>>> - .macro sx rd, addr
>>> -#if (__riscv_xlen == 32)
>>> - sw \rd, \addr
>>> -#elif (__riscv_xlen == 64)
>>> - sd \rd, \addr
>>> -#else
>>> - sq \rd, \addr
>>> -#endif
>>> - .endm
>>> -
>>> func ff_h264_add_pixels4_8_rvv, zve32x
>>> lpad 0
>>> vsetivli zero, 4, e8, mf4, ta, ma
>>> diff --git a/libavcodec/riscv/h264idct_rvv.S b/libavcodec/riscv/h264idct_rvv.S
>>> index d2f77a5b47..076935a5d5 100644
>>> --- a/libavcodec/riscv/h264idct_rvv.S
>>> +++ b/libavcodec/riscv/h264idct_rvv.S
>>> @@ -29,16 +29,6 @@
>>>
>>> #include "libavutil/riscv/asm.S"
>>>
>>> - .macro sx rd, addr
>>> -#if (__riscv_xlen == 32)
>>> - sw \rd, \addr
>>> -#elif (__riscv_xlen == 64)
>>> - sd \rd, \addr
>>> -#else
>>> - sq \rd, \addr
>>> -#endif
>>> - .endm
>>> -
>>> .variant_cc ff_h264_idct4_rvv
>>> func ff_h264_idct4_rvv, zve32x
>>> vsra.vi v5, v1, 1
>>> diff --git a/libavcodec/riscv/startcode_rvb.S b/libavcodec/riscv/startcode_rvb.S
>>> index eec92d3340..c131ebdf59 100644
>>> --- a/libavcodec/riscv/startcode_rvb.S
>>> +++ b/libavcodec/riscv/startcode_rvb.S
>>> @@ -26,16 +26,6 @@
>>>
>>> #include "libavutil/riscv/asm.S"
>>>
>>> - .macro lx rd, addr
>>> -#if (__riscv_xlen == 32)
>>> - lw \rd, \addr
>>> -#elif (__riscv_xlen == 64)
>>> - ld \rd, \addr
>>> -#else
>>> - lq \rd, \addr
>>> -#endif
>>> - .endm
>>> -
>>> func ff_startcode_find_candidate_rvb, zbb
>>> lpad 0
>>> add a1, a0, a1
>>> diff --git a/libavutil/riscv/asm.S b/libavutil/riscv/asm.S
>>> index ec68a042d1..175f2a8672 100644
>>> --- a/libavutil/riscv/asm.S
>>> +++ b/libavutil/riscv/asm.S
>>> @@ -237,3 +237,37 @@
>>> .macro vntypei rd, rs, n=1
>>> vwtypei \rd, \rs, -(\n)
>>> .endm
>>> +
>>> + /**
>>> + * Write an XLEN-sized register to an address.
>>> + * @param rs source register
>>> + * @param addr address to write to
>>> + */
>>> + .macro sx rs, addr
>>> +#if (__riscv_xlen == 32)
>>> + sw \rs, \addr
>>> +#elif (__riscv_xlen == 64)
>>> + sd \rs, \addr
>>> +#elif (__riscv_xlen == 128)
>>> + sq \rs, \addr
>>> +#else
>>> +#error Unhandled value of XLEN
>>> +#endif
>>> + .endm
>>> +
>>> + /**
>>> + * Read an XLEN-sized register from an address.
>>> + * @param[out] rd destination register
>>> + * @param addr address to read from
>>> + */
>>> + .macro lx rd, addr
>>> +#if (__riscv_xlen == 32)
>>> + lw \rd, \addr
>>> +#elif (__riscv_xlen == 64)
>>> + ld \rd, \addr
>>> +#elif (__riscv_xlen == 128)
>>> + lq \rd, \addr
>>> +#else
>>> +#error Unhandled value of XLEN
>>> +#endif
>>> + .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".
_______________________________________________
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".
next prev parent reply other threads:[~2024-08-13 16:13 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 [this message]
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
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=C43FE435-F154-4E3A-A18C-DCE7B539DBBC@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