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 development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 1/3] riscv: add CPU flags for the RISC-V Vector extension
Date: Sun, 04 Sep 2022 08:41:13 +0300
Message-ID: <4736989.GXAFRqVoOG@basile.remlab.net> (raw)
In-Reply-To: <NB4Hc1H--3-2@lynne.ee>

Le sunnuntaina 4. syyskuuta 2022, 0.38.32 EEST Lynne a écrit :
> I need to know the length in C, not assembly.

There may be some corner cases where that makes sense, but typically it 
doesn't. Even if you're dealing in fixed-size macro blocks, you should leverage 
the larger vectors to unroll and process multiple macro blocks in parallel.

And besides, how do you want to get the value if not with assembler? This is 
currently not found in ELF HWCAP and probably never will be.

So the only way to find out in pure C is in the embedded case, by checking out 
the __riscv_zlvXXXb preprocessor predefined constants. But that only tells what 
is the guaranteed minimum vector size for the compile-time target.

Outside of embedded world, that's currently always undefined because everybody 
uses RVA20 as the baseline, which does not require vector support. Going 
forward, RVA22 will require 128 bits, but that says nothing of what the run-
time CPU can actually do.

> I think it makes sense to support all code that's targetting RISC-V, not 
just the ones it's convenient to.

I disagree. There are currently no means to negotiate a vector length with the 
OS, so that seems highly premature. And even if there was such a mechanism, 
it's simply much faster to call VSETVL in an inline assembler macro where 
needed than to compute the whole set of CPU flags.

-- 
レミ・デニ-クールモン
http://www.remlab.net/



_______________________________________________
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:[~2022-09-04  5:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-03 19:01 [FFmpeg-devel] [PATCHv1 0/3] Float DSP for RISC-V Vector extension - part I Rémi Denis-Courmont
2022-09-03 19:01 ` [FFmpeg-devel] [PATCH 1/3] riscv: add CPU flags for the RISC-V Vector extension remi
2022-09-03 19:05   ` Rémi Denis-Courmont
2022-09-03 19:20   ` Lynne
2022-09-03 19:59     ` Rémi Denis-Courmont
2022-09-03 21:38       ` Lynne
2022-09-04  5:41         ` Rémi Denis-Courmont [this message]
2022-09-04  6:39           ` Lynne
2022-09-04  8:27             ` Rémi Denis-Courmont
2022-09-03 19:01 ` [FFmpeg-devel] [PATCH 2/3] riscv: initial common header for assembler macros remi
2022-09-03 19:01 ` [FFmpeg-devel] [PATCH 3/3] riscv: add float vector-scalar multiplication remi
2022-09-03 19:11   ` Lynne
2022-09-03 19:34     ` Rémi Denis-Courmont
2022-09-03 19:48       ` Lynne
2022-09-03 20:01         ` Rémi Denis-Courmont

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=4736989.GXAFRqVoOG@basile.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