From: "Rémi Denis-Courmont" <remi@remlab.net> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>, Lynne <dev@lynne.ee> Subject: Re: [FFmpeg-devel] [PATCH 05/31] lavu/cpu: CPU flags for the RISC-V Vector extension Date: Mon, 26 Sep 2022 12:38:27 +0300 Message-ID: <DFCB9D77-D93D-4B6D-8B88-33A026C46FA7@remlab.net> (raw) In-Reply-To: <NCsZCp1--3-2@lynne.ee> Le 26 septembre 2022 09:51:43 GMT+03:00, Lynne <dev@lynne.ee> a écrit : >Sep 25, 2022, 16:25 by remi@remlab.net: > >> From: Rémi Denis-Courmont <remi@remlab.net> >> - if ((flags & AV_CPU_FLAG_RVD) && !(flags & AV_CPU_FLAG_RVF)) { >> + if ((flags & AV_CPU_FLAG_RV_ZVE64D) && !(flags & AV_CPU_FLAG_RV_ZVE64X)) { >> + av_log(NULL, AV_LOG_WARNING, "RV%s implied by specified flags\n", >> + "_ZVE64X"); >> + flags |= AV_CPU_FLAG_RV_ZVE64X; >> + } >> + >> + if ((flags & AV_CPU_FLAG_RV_ZVE64D) && !(flags & AV_CPU_FLAG_RV_ZVE32F)) { >> + av_log(NULL, AV_LOG_WARNING, "RV%s implied by specified flags\n", >> + "_ZVE32F"); >> > >I remember someone complaining about NULL contexts in av_log (mkver?). >I think it's okay, but I have no opinion on this. I don't particularly like them either but there is nowhere to get the log context from, in this case. To fix this, I guess we would need to break the API and the ABI. This is the same as the existing x86 code anyhow. Any solution should be common to both platforms. > >> + flags |= AV_CPU_FLAG_RV_ZVE32F; >> + } >> + >> + if ((flags & (AV_CPU_FLAG_RV_ZVE64X | AV_CPU_FLAG_RV_ZVE32F)) >> + && !(flags & AV_CPU_FLAG_RV_ZVE32X)) { >> + av_log(NULL, AV_LOG_WARNING, "RV%s implied by specified flags\n", >> + "_ZVE32X"); >> + flags |= AV_CPU_FLAG_RV_ZVE32X; >> + } >> + >> + if ((flags & AV_CPU_FLAG_RV_ZVE64D) && !(flags & AV_CPU_FLAG_RVD)) { >> + av_log(NULL, AV_LOG_WARNING, "RV%s implied by specified flags\n", "D"); >> + flags |= AV_CPU_FLAG_RVD; >> + } >> + >> + if ((flags & (AV_CPU_FLAG_RVD | AV_CPU_FLAG_RV_ZVE32F)) >> + && !(flags & AV_CPU_FLAG_RVF)) { >> av_log(NULL, AV_LOG_WARNING, "RV%s implied by specified flags\n", "F"); >> flags |= AV_CPU_FLAG_RVF; >> } >> @@ -50,6 +75,11 @@ int ff_get_cpu_flags_riscv(void) >> ret |= AV_CPU_FLAG_RVF; >> if (hwcap & HWCAP_RV('D')) >> ret |= AV_CPU_FLAG_RVD; >> + >> + /* The V extension implies all Zve* functional subsets */ >> + if (hwcap & HWCAP_RV('V')) >> + ret |= AV_CPU_FLAG_RV_ZVE32X | AV_CPU_FLAG_RV_ZVE64X >> + | AV_CPU_FLAG_RV_ZVE32F | AV_CPU_FLAG_RV_ZVE64D; >> #endif >> >> #ifdef __riscv_i >> @@ -60,6 +90,20 @@ int ff_get_cpu_flags_riscv(void) >> #if (__riscv_flen >= 64) >> ret |= AV_CPU_FLAG_RVD; >> #endif >> +#endif >> + >> + /* If RV-V is enabled statically at compile-time, check the details. */ >> +#ifdef __riscv_vectors >> + ret |= AV_CPU_FLAG_RV_ZVE32X; >> +#if __riscv_v_elen >= 64 >> + ret |= AV_CPU_FLAG_RV_ZVE64X; >> +#endif >> +#if __riscv_v_elen_fp >= 32 >> + ret |= AV_CPU_FLAG_RV_ZVE32F; >> +#if __riscv_v_elen_fp >= 64 >> + ret |= AV_CPU_FLAG_RV_ZVE64F; >> +#endif >> +#endif >> #endif >> >> return ret; >> diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c >> index e1135a84ac..f7d108e8ea 100644 >> --- a/tests/checkasm/checkasm.c >> +++ b/tests/checkasm/checkasm.c >> @@ -233,9 +233,13 @@ static const struct { >> { "VSX", "vsx", AV_CPU_FLAG_VSX }, >> { "POWER8", "power8", AV_CPU_FLAG_POWER8 }, >> #elif ARCH_RISCV >> - { "RVI", "rvi", AV_CPU_FLAG_RVI }, >> - { "RVF", "rvf", AV_CPU_FLAG_RVF }, >> - { "RVD", "rvd", AV_CPU_FLAG_RVD }, >> + { "RVI", "rvi", AV_CPU_FLAG_RVI }, >> + { "RVF", "rvf", AV_CPU_FLAG_RVF }, >> + { "RVD", "rvd", AV_CPU_FLAG_RVD }, >> + { "RV_Zve32x", "rv_zve32x", AV_CPU_FLAG_RV_ZVE32X }, >> + { "RV_Zve32f", "rv_zve32f", AV_CPU_FLAG_RV_ZVE32F }, >> + { "RV_Zve64x", "rv_zve64x", AV_CPU_FLAG_RV_ZVE64X }, >> + { "RV_Zve64d", "rv_zve64d", AV_CPU_FLAG_RV_ZVE64D }, >> > >I get that this is the official name for the extension, but... what about >simplifying it to something less like a password, like RVV32I/RVV32F/RVV64I/RVV64F? There are 2 prefixes: Zve for vector element, and Zvl for vector bit length. If we drop the E of element, it gets confusing. Maybe we could use RVV_{I,F}{32,64} if you want to drop the gratuitous Z... ? Inline... _______________________________________________ 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:[~2022-09-26 9:38 UTC|newest] Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-09-25 14:25 [FFmpeg-devel] [PATCHv5 00/31] RISC-V CPU extensions Rémi Denis-Courmont 2022-09-25 14:25 ` [FFmpeg-devel] [PATCH 01/31] lavu/cpu: detect RISC-V base extensions remi 2022-09-25 14:25 ` [FFmpeg-devel] [PATCH 02/31] lavu/riscv: initial common header for assembler macros remi 2022-09-25 14:25 ` [FFmpeg-devel] [PATCH 03/31] lavc/audiodsp: RISC-V F vector_clipf remi 2022-09-25 14:25 ` [FFmpeg-devel] [PATCH 04/31] lavc/pixblockdsp: RISC-V I get_pixels remi 2022-09-25 14:25 ` [FFmpeg-devel] [PATCH 05/31] lavu/cpu: CPU flags for the RISC-V Vector extension remi 2022-09-26 6:51 ` Lynne 2022-09-26 8:02 ` Andreas Rheinhardt 2022-09-26 9:38 ` Rémi Denis-Courmont [this message] 2022-09-25 14:25 ` [FFmpeg-devel] [PATCH 06/31] configure: probe " remi 2022-09-25 14:25 ` [FFmpeg-devel] [PATCH 07/31] lavu/riscv: fallback macros for SH{1, 2, 3}ADD remi 2022-09-25 14:25 ` [FFmpeg-devel] [PATCH 08/31] lavu/floatdsp: RISC-V V vector_fmul_scalar remi 2022-09-25 14:25 ` [FFmpeg-devel] [PATCH 09/31] lavu/floatdsp: RISC-V V vector_dmul_scalar remi 2022-09-26 6:53 ` Lynne 2022-09-26 9:42 ` Rémi Denis-Courmont 2022-09-25 14:25 ` [FFmpeg-devel] [PATCH 10/31] lavu/floatdsp: RISC-V V vector_fmul remi 2022-09-25 14:25 ` [FFmpeg-devel] [PATCH 11/31] lavu/floatdsp: RISC-V V vector_dmul remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 12/31] lavu/floatdsp: RISC-V V vector_fmac_scalar remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 13/31] lavu/floatdsp: RISC-V V vector_dmac_scalar remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 14/31] lavu/floatdsp: RISC-V V vector_fmul_add remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 15/31] lavu/floatdsp: RISC-V V butterflies_float remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 16/31] lavu/floatdsp: RISC-V V vector_fmul_reverse remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 17/31] lavu/floatdsp: RISC-V V vector_fmul_window remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 18/31] lavu/floatdsp: RISC-V V scalarproduct_float remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 19/31] lavu/fixeddsp: RISC-V V butterflies_fixed remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 20/31] lavc/audiodsp: RISC-V V vector_clip_int32 remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 21/31] lavc/audiodsp: RISC-V V vector_clipf remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 22/31] lavc/audiodsp: RISC-V V scalarproduct_int16 remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 23/31] lavc/fmtconvert: RISC-V V int32_to_float_fmul_scalar remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 24/31] lavc/fmtconvert: RISC-V V int32_to_float_fmul_array8 remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 25/31] lavc/vorbisdsp: RISC-V V inverse_coupling remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 26/31] lavc/aacpsdsp: RISC-V V add_squares remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 27/31] lavc/aacpsdsp: RISC-V V mul_pair_single remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 28/31] lavc/aacpsdsp: RISC-V V hybrid_analysis remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 29/31] lavc/aacpsdsp: RISC-V V hybrid_analysis_ileave remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 30/31] lavc/aacpsdsp: RISC-V V hybrid_synthesis_deint remi 2022-09-25 14:26 ` [FFmpeg-devel] [PATCH 31/31] lavc/aacpsdsp: RISC-V V stereo_interpolate[0] remi 2022-09-26 7:05 ` [FFmpeg-devel] [PATCHv5 00/31] RISC-V CPU extensions Lynne 2022-09-26 12:01 ` Rémi Denis-Courmont 2022-09-26 14:52 [FFmpeg-devel] [PATCHv6 00/31] initial " Rémi Denis-Courmont 2022-09-26 14:52 ` [FFmpeg-devel] [PATCH 05/31] lavu/cpu: CPU flags for the RISC-V Vector extension remi
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=DFCB9D77-D93D-4B6D-8B88-33A026C46FA7@remlab.net \ --to=remi@remlab.net \ --cc=dev@lynne.ee \ --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