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] gcc: Don't disable '-ftree-vectorize' on GCC >= 13 on major architectures (PR #20120)
Date: Wed, 06 Aug 2025 12:42:12 +0700
Message-ID: <D4752EAA-213D-49EE-9DF8-4A6436C85BF5@remlab.net> (raw)
In-Reply-To: <20250805141526.67B6368C25D@ffbox0-bg.ffmpeg.org>

Hi,

FWIW I don't really care personally but judging by the original author and their affiliation, the intent was most probably to enable this for RISC-V / RVA23.

On that platform it is *probably* safe to enable vectorisation on all GCC versions but I have not tested it. In fact, I don't have an RVA23-conformant board.

Le 5 août 2025 21:15:26 GMT+07:00, "Martin Storsjö" <code@ffmpeg.org> a écrit :
>PR #20120 opened by Martin Storsjö (mstorsjo)
>URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20120
>Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20120.patch
>
>This changes configure to stop disabling -ftree-vectorize on
>GCC versions 13 and newer, on major architectures.
>
>Background:
>- Original `-fno-tree-vectorize` was added in 2009 in commit
>  973859f5230e to avoid compiler errors.
>- Re-enabled in 2016 in commit cb8646af24bd but caused failures due
>  to inline CABAC assembly issues and was disabled again in
>  fd6dbc53855fb.
>- Commit 182663a58a7a in 2023 fixed the inline CABAC assembly issues.
>- Recent versions of GCC, in particular 13 and newer, seem to
>  generally work reliably with respect to vectorization, although bugs
>  have been observed on Loongarch.
>
>Cautiously allow the GCC default of having vectorization enabled,
>on major architectures where we expect to see enough testing. If
>further issues are observed, they should be reported and noted here in
>configure, so the workarounds can be scoped and version limited.
>
>
>From f95261fab763cae5723513c9281d073048284ed4 Mon Sep 17 00:00:00 2001
>From: Jiawei <jiawei@iscas.ac.cn>
>Date: Mon, 14 Jul 2025 19:29:57 +0800
>Subject: [PATCH] gcc: Don't disable '-ftree-vectorize' on GCC >= 13 on major
> architectures
>
>This changes configure to stop disabling -ftree-vectorize on
>GCC versions 13 and newer, on major architectures.
>
>Background:
>- Original `-fno-tree-vectorize` was added in 2009 in commit
>  973859f5230e to avoid compiler errors.
>- Re-enabled in 2016 in commit cb8646af24bd but caused failures due
>  to inline CABAC assembly issues and was disabled again in
>  fd6dbc53855fb.
>- Commit 182663a58a7a in 2023 fixed the inline CABAC assembly issues.
>- Recent versions of GCC, in particular 13 and newer, seem to
>  generally work reliably with respect to vectorization, although bugs
>  have been observed on Loongarch.
>
>Cautiously allow the GCC default of having vectorization enabled,
>on major architectures where we expect to see enough testing. If
>further issues are observed, they should be reported and noted here in
>configure, so the workarounds can be scoped and version limited.
>---
> Changelog |  1 +
> configure | 20 +++++++++++++++++++-
> 2 files changed, 20 insertions(+), 1 deletion(-)
>
>diff --git a/Changelog b/Changelog
>index 04db8e15b2..b7704604f4 100644
>--- a/Changelog
>+++ b/Changelog
>@@ -26,6 +26,7 @@ version <next>:
> - OpenHarmony hardware decoder/encoder
> - Colordetect filter
> - Add vf_scale_d3d11 filter
>+- No longer disabling GCC autovectorization, on X86, ARM and AArch64
> 
> 
> version 7.1:
>diff --git a/configure b/configure
>index c0a4c3c87c..760e27fd70 100755
>--- a/configure
>+++ b/configure
>@@ -7714,7 +7714,25 @@ if enabled icc; then
>             disable aligned_stack
>     fi
> elif enabled gcc; then
>-    check_optflags -fno-tree-vectorize
>+    gcc_version=$($cc -dumpversion)
>+    major_version=${gcc_version%%.*}
>+    if [ $major_version -lt 13 ]; then
>+        # Disable tree-vectorize for GCC <13 - it has historically been buggy.
>+        check_optflags -fno-tree-vectorize
>+    else
>+        case $arch in
>+        x86|arm|aarch64)
>+            # Allow the default of having tree-vectorize enabled on well tested
>+            # architectures.
>+            ;;
>+        *)
>+            # Disable tree-vectorize on potentially less tested
>+            # architectures. Known issues:
>+            # - https://gcc.gnu.org/PR121064 on Loongarch
>+            check_optflags -fno-tree-vectorize
>+            ;;
>+        esac
>+    fi
>     check_cflags -Werror=format-security
>     check_cflags -Werror=implicit-function-declaration
>     check_cflags -Werror=missing-prototypes
>-- 
>2.49.1
>
>_______________________________________________
>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:[~2025-08-06  5:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250805141526.67B6368C25D@ffbox0-bg.ffmpeg.org>
2025-08-06  5:42 ` Rémi Denis-Courmont [this message]
2025-08-06  7:10   ` Martin Storsjö
2025-08-05 14:15 Martin Storsjö

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=D4752EAA-213D-49EE-9DF8-4A6436C85BF5@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