also this for -current and -stable
--
Sent from a phone, apologies for poor formatting.
--- Forwarded message ---
From: Brad Smith [email protected]
Date: 29 November 2026 03:01:18
Subject: Re: vvdec i386
To: Stuart Henderson [email protected]
On Sat, Nov 28, 2026 at 07:08:28PM +0000, Stuart Henderson wrote:
[73/82] /pobj/vvdec-3.3.0/bin/c++ -DTARGET_SIMD_X86=1 -DVVDEC_DYN_LINK
-DVVDEC_SOURCE -Dvvdec_EXPORTS
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/../../../include
-I/pobj/vvdec-3.3.0/build-i386
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/.
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/..
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/../DecoderLib
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/../CommonLib
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/../CommonLib/x86
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/../CommonLib/arm
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/../libmd5 -isystem
/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/../../../thirdparty -O2
-pipe -DNDEBUG -std=c++14 -flto=thin -fPIC -fvisibility=hidden
-fvisibility-inlines-hidden -Wall -Wno-unused-function
-Wno-enum-compare-switch -Wno-unknown-attributes -pedantic
-Wno-error=pedantic -Wno-c++2a-extensions -Wshorten-64-to-32 -MD -MT
source/Lib/vvdec/CMakeFiles/vvdec.dir/vvdecimpl.cpp.o -MF
source/Lib/vvdec/CMakeFiles/vvdec.dir/vvdecimpl.cpp.o.d -o
source/Lib/vvdec/CMakeFiles/vvdec.dir/vvdecimpl.cpp.o -c
/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/vvdecimpl.cpp
FAILED: source/Lib/vvdec/CMakeFiles/vvdec.dir/vvdecimpl.cpp.o
/pobj/vvdec-3.3.0/bin/c++ -DTARGET_SIMD_X86=1 -DVVDEC_DYN_LINK
-DVVDEC_SOURCE -Dvvdec_EXPORTS
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/../../../include
-I/pobj/vvdec-3.3.0/build-i386
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/.
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/..
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/../DecoderLib
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/../CommonLib
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/../CommonLib/x86
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/../CommonLib/arm
-I/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/../libmd5 -isystem
/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/../../../thirdparty -O2
-pipe -DNDEBUG -std=c++14 -flto=thin -fPIC -fvisibility=hidden
-fvisibility-inlines-hidden -Wall -Wno-unused-function
-Wno-enum-compare-switch -Wno-unknown-attributes -pedantic
-Wno-error=pedantic -Wno-c++2a-extensions -Wshorten-64-to-32 -MD -MT
source/Lib/vvdec/CMakeFiles/vvdec.dir/vvdecimpl.cpp.o -MF
source/Lib/vvdec/CMakeFiles/vvdec.dir/vvdecimpl.cpp.o.d -o
source/Lib/vvdec/CMakeFiles/vvdec.dir/vvdecimpl.cpp.o -c
/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/vvdecimpl.cpp
/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/vvdecimpl.cpp:861:31: error:
always_inline function '_mm_loadu_si128' requires target feature 'sse2',
but would be inlined into function 'copyComp' that is compiled without
support for 'sse2'
861 | const __m128i a = _mm_loadu_si128( (__m128i*) &pucSrc[x *
2] );
| ^
/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/vvdecimpl.cpp:862:31: error:
always_inline function '_mm_loadu_si128' requires target feature 'sse2',
but would be inlined into function 'copyComp' that is compiled without
support for 'sse2'
862 | const __m128i b = _mm_loadu_si128( (__m128i*) &pucSrc[x *
2 + 16] );
| ^
/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/vvdecimpl.cpp:863:55: error:
always_inline function '_mm_packus_epi16' requires target feature 'sse2',
but would be inlined into function 'copyComp' that is compiled without
support for 'sse2'
863 | _mm_storeu_si128( (__m128i*) &pucDest[x],
_mm_packus_epi16( a, b ) );
| ^
/pobj/vvdec-3.3.0/vvdec-3.3.0/source/Lib/vvdec/vvdecimpl.cpp:863:13: error:
always_inline function '_mm_storeu_si128' requires target feature 'sse2',
but would be inlined into function 'copyComp' that is compiled without
support for 'sse2'
863 | _mm_storeu_si128( (__m128i*) &pucDest[x],
_mm_packus_epi16( a, b ) );
| ^
4 errors generated.
ninja: build stopped: subcommand failed.
Index: patches/patch-source_Lib_vvdec_vvdecimpl_cpp
===================================================================
RCS file: patches/patch-source_Lib_vvdec_vvdecimpl_cpp
diff -N patches/patch-source_Lib_vvdec_vvdecimpl_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-source_Lib_vvdec_vvdecimpl_cpp 29 Nov 2026 02:57:38
-0000
@@ -0,0 +1,58 @@
+- Fix the build on i386 without SSE2 in copyComp()
+
+Index: source/Lib/vvdec/vvdecimpl.cpp
+--- source/Lib/vvdec/vvdecimpl.cpp.orig
++++ source/Lib/vvdec/vvdecimpl.cpp
+@@ -821,6 +821,30 @@ bool VVDecImpl::isNalUnitSlice( vvdecNalType t )
+ || t == VVC_NAL_UNIT_CODED_SLICE_GDR;
+ }
+
++#if ENABLE_SIMD_OPT && defined( TARGET_SIMD_X86 )
++# if defined( __i386__ ) && !defined( __SSE2__ )
++# define COPYCOMP_SSE2_TARGET __attribute__( ( target( "sse2" ) ) )
++# define COPYCOMP_SSE2_RUNTIME_CHECK 1
++# else
++# define COPYCOMP_SSE2_TARGET
++# define COPYCOMP_SSE2_RUNTIME_CHECK 0
++# endif
++
++static COPYCOMP_SSE2_TARGET unsigned int copyCompShortToChar_SSE2( const
unsigned char* pucSrc,
++
unsigned char* pucDest,
++
unsigned int uiWidth )
++{
++ unsigned int x;
++ for( x = 0; x < ( uiWidth & ~15 ); x += 16 )
++ {
++ const __m128i a = _mm_loadu_si128( (const __m128i*) &pucSrc[x * 2] );
++ const __m128i b = _mm_loadu_si128( (const __m128i*) &pucSrc[x * 2 +
16] );
++ _mm_storeu_si128( (__m128i*) &pucDest[x], _mm_packus_epi16( a, b ) );
++ }
++ return x;
++}
++#endif // ENABLE_SIMD_OPT && defined( TARGET_SIMD_X86 )
++
+ int VVDecImpl::copyComp( const unsigned char* pucSrc,
+ unsigned char* pucDest,
+ unsigned int uiWidth,
+@@ -851,16 +875,17 @@ int VVDecImpl::copyComp( const unsigned char* pucSrc,
+ {
+ CHECKD( iStrideDest > iStrideSrc, "copyComp only supports
narrowing conversions" );
+ // shift short->char
++#if ENABLE_SIMD_OPT && defined( TARGET_SIMD_X86 )
++ const bool useSSE2 = !COPYCOMP_SSE2_RUNTIME_CHECK ||
read_x86_extension_flags() > x86_simd::SCALAR;
++#endif // ENABLE_SIMD_OPT && defined( TARGET_SIMD_X86 )
+ for( unsigned int y=0; y < uiHeight; y++ )
+ {
+ unsigned int x = 0;
+
+ #if ENABLE_SIMD_OPT && defined( TARGET_SIMD_X86 )
+- for( x = 0; x < ( uiWidth & ~15 ); x += 16 )
++ if( useSSE2 )
+ {
+- const __m128i a = _mm_loadu_si128( (__m128i*) &pucSrc[x * 2] );
+- const __m128i b = _mm_loadu_si128( (__m128i*) &pucSrc[x * 2 +
16] );
+- _mm_storeu_si128( (__m128i*) &pucDest[x], _mm_packus_epi16(
a, b ) );
++ x = copyCompShortToChar_SSE2( pucSrc, pucDest, uiWidth );
+ }
+ #endif // ENABLE_SIMD_OPT && defined( TARGET_SIMD_X86 )
+