PR #25196 opened by Kacper Michajłow (kasper93)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25196
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25196.patch

Forgejo CI runs FATE on ppc64, mips64 and riscv64 with GCC 16 under
QEMU, and FATE has native ppc64le (GCC 15) and riscv64 (GCC 14) clients,
so these architectures get the same coverage as x86, arm and aarch64.
On loongarch GCC 14.0-14.3 and 15.0-15.1 miscompile vector permutations
(GCC PR121064), fixed in 14.4, 15.2 and newer, so vectorization is
disabled only for those versions.


From fabaf82ba23c7392ad6956851bd6a166ad06b6c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Sun, 18 Oct 2026 20:10:45 +0200
Subject: [PATCH] configure: allow GCC tree-vectorize on ppc, riscv, mips and
 loongarch
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Forgejo CI runs FATE on ppc64, mips64 and riscv64 with GCC 16 under
QEMU, and FATE has native ppc64le (GCC 15) and riscv64 (GCC 14) clients,
so these architectures get the same coverage as x86, arm and aarch64.
On loongarch GCC 14.0-14.3 and 15.0-15.1 miscompile vector permutations
(GCC PR121064), fixed in 14.4, 15.2 and newer, so vectorization is
disabled only for those versions.

Signed-off-by: Kacper Michajłow <[email protected]>
---
 Changelog |  1 +
 configure | 21 +++++++++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/Changelog b/Changelog
index 32e7c8bfe7..b26b70eb40 100644
--- a/Changelog
+++ b/Changelog
@@ -19,6 +19,7 @@ version <next>:
 - Panasonic RW2 decoder
 - xHE-AAC encoding via libfdk-xhe-aac
 - jpegapp bitstream filter
+- No longer disabling GCC autovectorization on PowerPC, RISC-V, MIPS and 
LoongArch
 
 
 version 9.0:
diff --git a/configure b/configure
index b724e10929..771888be61 100755
--- a/configure
+++ b/configure
@@ -8002,21 +8002,30 @@ if enabled icc; then
             disable aligned_stack
     fi
 elif enabled gcc; then
-    gcc_version=$($cc -dumpversion)
+    gcc_version=$($cc -dumpfullversion -dumpversion)
     major_version=${gcc_version%%[!0-9]*}
+    minor_version=${gcc_version#$major_version}
+    minor_version=${minor_version#.}
+    minor_version=${minor_version%%[!0-9]*}
     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.
+        x86|arm|aarch64|ppc|riscv|mips)
+            # Allow the default of having tree-vectorize enabled on
+            # architectures covered by CI and FATE.
+            ;;
+        loongarch)
+            # GCC 14.0-14.3 and 15.0-15.1 miscompile vector permutations,
+            # see https://gcc.gnu.org/PR121064. Fixed in 14.4, 15.2 and newer.
+            case $major_version.${minor_version:-0} in
+            14.[0-3]|15.[01]) check_optflags -fno-tree-vectorize ;;
+            esac
             ;;
         *)
             # Disable tree-vectorize on potentially less tested
-            # architectures. Known issues:
-            # - https://gcc.gnu.org/PR121064 on Loongarch
+            # architectures.
             check_optflags -fno-tree-vectorize
             ;;
         esac
-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to