PR #24939 opened by t-boiko
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24939
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24939.patch

AVXSLOW is set for AMD family 15h/16h (Bulldozer/Jaguar). Unlike
SSE2SLOW and SSE3SLOW it was missing from checkasm's x86 cpuflags
table, so the C-pass leftover still contained AVXSLOW.

That leftover was not plain C. av_force_cpu_flags() implies MMX from
AVXSLOW, so MMX put_ ran under the _c name. Checkasm still treated the
pass as C and used checked_call instead of checked_call_emms, so it
did not restore x87 after MMX. fstenv then saw tag 0xaaaa and reported
missing emms.

Put AVXSLOW on the AVX row, the same way SSE2SLOW sits on SSE2. The C
pass strips it; the AVX pass restores it when the host has it, so
YMM-slow DSP selection is unchanged.

Reproduced with fate-checkasm-vc1dsp on an AVXSLOW CPU (an x64 emulator
whose CPUID is AuthenticAMD 00600F01, family 15h). The same leftover
applies to any family 15h/16h CPU.

# cat  tests/data/fate/checkasm-vc1dsp.err
checkasm:
 - CPU:                           Virtual CPU @ 4.00GHz (00600F01)
 - Random seed: 1322135992
MMX implied by specified flags
C:
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc11_16_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc21_16_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc31_16_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc12_16_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc22_16_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc32_16_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc13_16_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc23_16_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc33_16_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc11_8_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc21_8_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc31_8_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc12_8_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc22_8_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc32_8_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc13_8_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc23_8_c (missing emms, fpu tag = 
0xaaaa)
FAILURE: vc1dsp.put_vc1_mspel_pixels_tab_mc33_8_c (missing emms, fpu tag = 
0xaaaa)
 - vc1dsp.mspel_pixels    [FAILED]
MMXEXT:
 - vc1dsp.mspel_pixels    [OK]
SSE2:
 - vc1dsp.inv_trans       [OK]
 - vc1dsp.loop_filter     [OK]
 - vc1dsp.mspel_pixels    [OK]
SSSE3:
 - vc1dsp.loop_filter     [OK]
 - vc1dsp.mspel_pixels    [OK]
SSE4.1:
 - vc1dsp.loop_filter     [OK]
checkasm: 18 of 86 tests failed
threads=1



>From 1d45a7859a523a4617e863a75f488acf2921d2f5 Mon Sep 17 00:00:00 2001
From: Tymur Boiko <[email protected]>
Date: Thu, 8 Oct 2026 12:15:31 +0200
Subject: [PATCH] checkasm: bundle AVXSLOW with AVX so the C pass strips it

AVXSLOW is set for AMD family 15h/16h (Bulldozer/Jaguar). Unlike
SSE2SLOW and SSE3SLOW it was missing from checkasm's x86 cpuflags
table, so the C-pass leftover still contained AVXSLOW.

That leftover was not plain C. av_force_cpu_flags() implies MMX from
AVXSLOW, so MMX put_ ran under the _c name. Checkasm still treated the
pass as C and used checked_call instead of checked_call_emms, so it
did not restore x87 after MMX. fstenv then saw tag 0xaaaa and reported
missing emms.

Put AVXSLOW on the AVX row, the same way SSE2SLOW sits on SSE2. The C
pass strips it; the AVX pass restores it when the host has it, so
YMM-slow DSP selection is unchanged.

Reproduced with fate-checkasm-vc1dsp on an AVXSLOW CPU (an x64 emulator
whose CPUID is AuthenticAMD 00600F01, family 15h). The same leftover
applies to any family 15h/16h CPU.
---
 tests/checkasm/checkasm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index 3d34df656e..c40b6c8e12 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -374,7 +374,7 @@ static const CheckasmCpuInfo cpuflags[] = {
     { "SSE4.2",     "sse42",     AV_CPU_FLAG_SSE42 },
     { "AES-NI",     "aesni",     AV_CPU_FLAG_AESNI },
     { "CLMUL",      "clmul",     AV_CPU_FLAG_CLMUL },
-    { "AVX",        "avx",       AV_CPU_FLAG_AVX },
+    { "AVX",        "avx",       AV_CPU_FLAG_AVX|AV_CPU_FLAG_AVXSLOW },
     { "XOP",        "xop",       AV_CPU_FLAG_XOP },
     { "FMA3",       "fma3",      AV_CPU_FLAG_FMA3 },
     { "FMA4",       "fma4",      AV_CPU_FLAG_FMA4 },
-- 
2.52.0

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

Reply via email to