From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [PATCH 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 Date: Thu, 3 Nov 2022 15:19:15 +0100 Message-ID: <AS8P250MB0744D1FA5A85C8D771912A6B8F389@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw) In-Reply-To: <604794cb-6ad6-0223-2280-75a7513fedef@amyspark.me> L. E. Segovia: > Hi! > > Thanks for the review. The comments will be fixed in the next version of > the patchset. Just a couple remarks: > > re dcadsp_init -- this one comes from 4.4.x having a clause there to > support SSE, which also checks for the x86-32 architecture [1]. I've > removed it for the current version. > > re flacdsp_init -- ff_flac_decorrelate_indep8_16_avx and > ff_flac_decorrelate_indep8_32_avx are from their inception only > generated for x86-64 [2][3]. This check was missing from the C side, > implying it relied on DCE to pass linking. > Sorry, I somehow did not recognize that there were already ARCH_X86_64 checks for these flacdsp functions. > [1]: > https://github.com/FFmpeg/FFmpeg/blob/release/4.4/libavcodec/x86/dcadsp_init.c#L40-L41 > > [2]: > https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/x86/flacdsp.asm#L315-L318 > > [3]: > https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/x86/flacdsp.asm#L323-L326 > Another idea that I had is as follows: Instead of using if (EXTERNAL_MMX(cpu_flags)) { ... } we add a macro IF_EXTERNAL_MMX(cpu_flags, ...) that expands to "if (cpu_flags & AV_CPU_FLAG_MMX) { __VA_ARGS__ }" if HAVE_EXTERNAL_MMX is true and to nothing (or a null statement) of it is not. Advantages of this approach are that it does not involve sprinkling the codebase with many #ifs and that it automatically checks the right stuff -- namely the corresponding HAVE_* instead of just HAVE_X86ASM as you do in the last patch; notice that if an assembler is present, we expect it to be able to assemble MMX(EXT), SSE etc., but not AVX, and consequently mostly don't check for it in the .asm files, but as has been said AVX(2) and XOP are an exception to this, so that one would still get linker errors with your patchset if one used an assembler that does not support AVX(2) (or if one disabled it via configure). Disadvantages of it are that one can not add more #if checks to the "..." of these macros and that there would be some calls to av_get_cpu_flags() where the return value would be unused (we might have to mark the variable as av_unused or mark said function as av_pure to make the compiler optimize that away and not emit warnings for it). But it would still be usable for the common case where there are no further #if checks. - Andreas _______________________________________________ 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-11-03 14:19 UTC|newest] Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-01 21:59 [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE L. E. Segovia 2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia 2022-11-01 22:28 ` Andreas Rheinhardt 2022-11-03 12:55 ` L. E. Segovia 2022-11-03 14:19 ` Andreas Rheinhardt [this message] 2022-11-03 21:59 ` Carl Eugen Hoyos 2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia 2022-11-02 0:38 ` Andreas Rheinhardt 2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia 2022-11-02 0:42 ` Andreas Rheinhardt 2022-11-01 21:59 ` [FFmpeg-devel] [PATCH 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia 2022-11-02 0:26 ` Andreas Rheinhardt 2022-11-02 1:08 ` [FFmpeg-devel] [PATCH 0/4] Fix FFmpeg compilation without DCE Andreas Rheinhardt 2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 0/5] " L. E. Segovia 2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 1/5] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia 2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 2/5] avcodec/x86/hevcdsp_init: Fix indentation after the ARCH_FOO changes L. E. Segovia 2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 3/5] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia 2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 4/5] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia 2022-11-03 15:30 ` [FFmpeg-devel] [PATCH v2 5/5] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia 2022-11-03 15:55 ` Lynne 2022-11-14 9:01 ` L. E. Segovia 2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia 2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 1/5] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia 2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 2/5] avcodec/x86/hevcdsp_init: Fix indentation after the ARCH_FOO changes L. E. Segovia 2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 3/5] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia 2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 4/5] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia 2022-11-03 16:36 ` [FFmpeg-devel] [PATCH v3 5/5] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia 2022-11-07 14:48 ` [FFmpeg-devel] [PATCH v3 0/5] Fix FFmpeg compilation without DCE L. E. Segovia 2022-11-17 22:45 ` L. E. Segovia 2022-11-26 19:17 ` L. E. Segovia 2022-11-27 15:51 ` Carl Eugen Hoyos 2022-11-27 16:29 ` Soft Works 2022-11-27 16:46 ` Carl Eugen Hoyos 2022-11-27 17:16 ` Soft Works 2022-11-27 17:45 ` Carl Eugen Hoyos 2022-11-27 19:23 ` Soft Works 2022-11-27 17:50 ` Hendrik Leppkes 2022-11-27 18:28 ` Soft Works 2023-07-28 1:37 ` [FFmpeg-devel] [PATCH v4 0/4] Fix MSVC build without optimizations L. E. Segovia 2023-07-28 10:40 ` Reimar Döffinger 2023-07-28 10:48 ` Reimar Döffinger 2023-07-28 10:55 ` Nicolas George 2023-07-28 13:21 ` Matt Oliver 2023-07-29 18:57 ` L. E. Segovia 2023-07-29 19:07 ` [FFmpeg-devel] [PATCH v5 " L. E. Segovia [not found] ` <cover.1690657578.git.amy@amyspark.me> 2023-07-29 19:07 ` [FFmpeg-devel] [PATCH v5 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia 2023-07-31 18:28 ` Michael Niedermayer 2023-07-29 19:07 ` [FFmpeg-devel] [PATCH v5 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia 2023-07-29 19:07 ` [FFmpeg-devel] [PATCH v5 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia 2023-07-29 19:08 ` [FFmpeg-devel] [PATCH v5 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia [not found] ` <cover.1690508131.git.amy@amyspark.me> 2023-07-28 1:37 ` [FFmpeg-devel] [PATCH v4 1/4] all: Replace if (ARCH_FOO) checks by #if ARCH_FOO, part 2 L. E. Segovia 2023-07-28 1:38 ` [FFmpeg-devel] [PATCH v4 2/4] all: Replace if (CONFIG_FOO) checks by #if CONFIG_FOO L. E. Segovia 2023-07-28 1:38 ` [FFmpeg-devel] [PATCH v4 3/4] all: Guard if (INLINE*) checks with #if HAVE_INLINE_ASM L. E. Segovia 2023-07-28 1:38 ` [FFmpeg-devel] [PATCH v4 4/4] all: Guard if (EXTERNAL*) checks with #if HAVE_X86ASM L. E. Segovia
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=AS8P250MB0744D1FA5A85C8D771912A6B8F389@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \ --to=andreas.rheinhardt@outlook.com \ --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