This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new b57ff00bcf configure/x86: split 7-register check from EBP availability
b57ff00bcf is described below

commit b57ff00bcf485ad06b1619d31499a6db27a636b0
Author:     Kirill A. Korinsky <[email protected]>
AuthorDate: Fri Jun 19 23:31:20 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Sat Jun 20 11:46:49 2026 +0000

    configure/x86: split 7-register check from EBP availability
    
    LLVM commit
    
https://github.com/llvm/llvm-project/commit/0d471b3f64d3116bd57c79d872f7384fff80daa5
    made Clang save and restore EBP around inline asm that only
    clobbers it. This can make the existing EBP crash probe pass even
    when the compiler still cannot allocate the 7-register i386 inline
    asm used behind HAVE_7REGS.
    
    Keep ebp_available for HAVE_6REGS and add a separate
    x86_32_7regs probe for HAVE_7REGS.
    
    Discussion:
    https://marc.info/?t=178015389900001&r=1&w=2
---
 configure           | 12 ++++++++++++
 libavutil/x86/asm.h |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index db98f049ed..a6bbb86807 100755
--- a/configure
+++ b/configure
@@ -2656,6 +2656,7 @@ TOOLCHAIN_FEATURES="
     symver_asm_label
     symver_gnu_asm
     vfp_args
+    x86_32_7regs
     xform_asm
     xmm_clobbers
 "
@@ -6849,6 +6850,14 @@ EOF
     check_inline_asm ebx_available '""::"b"(0)' &&
         check_inline_asm ebx_available '"":::"%ebx"'
 
+    # check whether 7 registers are available on x86-32
+    # Since 
https://github.com/llvm/llvm-project/commit/0d471b3f64d3116bd57c79d872f7384fff80daa5,
+    # Clang can save/restore EBP around clobber-only asm, so the EBP
+    # crash probe alone can be a false positive for 7-register asm.
+    disable x86_32_7regs
+    enabled_all x86_32 ebx_available ebp_available &&
+        check_inline_asm x86_32_7regs '"" :: "r"(0), "r"(1), "r"(2), "r"(3), 
"g"(4), "r"(5) : "%eax", "%edx"'
+
     # check whether xmm clobbers are supported
     check_inline_asm xmm_clobbers '"":::"%xmm0"'
 
@@ -8509,6 +8518,9 @@ if enabled x86; then
     echo "EBX available             ${ebx_available-no}"
     echo "EBP available             ${ebp_available-no}"
 fi
+if enabled x86_32; then
+    echo "7 registers available     ${x86_32_7regs-no}"
+fi
 if enabled aarch64; then
     echo "NEON enabled              ${neon-no}"
     echo "DOTPROD enabled           ${dotprod-no}"
diff --git a/libavutil/x86/asm.h b/libavutil/x86/asm.h
index f06ea25035..fc9f50b1a9 100644
--- a/libavutil/x86/asm.h
+++ b/libavutil/x86/asm.h
@@ -71,7 +71,7 @@ typedef int32_t x86_reg;
 typedef int x86_reg;
 #endif
 
-#define HAVE_7REGS (ARCH_X86_64 || (HAVE_EBX_AVAILABLE && HAVE_EBP_AVAILABLE))
+#define HAVE_7REGS (ARCH_X86_64 || HAVE_X86_32_7REGS)
 #define HAVE_6REGS (ARCH_X86_64 || (HAVE_EBX_AVAILABLE || HAVE_EBP_AVAILABLE))
 
 #if ARCH_X86_64 && defined(PIC)

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

Reply via email to