Skip to content

Commit

Permalink
Add the fix version of MSVC AVX2 issue (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjw24 authored Feb 20, 2024
1 parent 7dae9ea commit fb7db94
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ set( VVENC_ENABLE_X86_SIMD TRUE CACHE BOOL "enable x86 intr
set( VVENC_ENABLE_ARM_SIMD ${VVENC_ARM_SIMD_DEFAULT} CACHE BOOL "enable ARM intrinsics" )

include( vvencCompilerSupport )
check_problematic_compiler( VVENC_PROBLEMATIC_COMPILER "MSVC" 19.38 "" )
check_problematic_compiler( VVENC_PROBLEMATIC_COMPILER "MSVC" 19.38 19.39 )

if( VVENC_PROBLEMATIC_COMPILER )
set( VVENC_OVERRIDE_COMPILER_CHECK OFF CACHE BOOL "Build with known problematic compiler version" )
Expand Down
2 changes: 1 addition & 1 deletion source/Lib/CommonLib/x86/InitX86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void RdCost::initRdCostX86()
switch (vext){
case AVX512:
case AVX2:
#if defined( _MSC_VER ) && _MSC_VER >= 1938
#if defined( _MSC_VER ) && _MSC_VER >= 1938 && _MSC_VER < 1939
#else
_initRdCostX86<AVX2>();
break;
Expand Down
4 changes: 2 additions & 2 deletions source/Lib/EncoderLib/EncLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ void EncLib::initEncoderLib( const vvenc_config& encCfg )
// copy config parameter
const_cast<VVEncCfg&>(m_encCfg) = encCfg;

#if defined( REAL_TARGET_X86 ) && defined( _MSC_VER ) && _MSC_VER >= 1938
#if defined( REAL_TARGET_X86 ) && defined( _MSC_VER ) && _MSC_VER >= 1938 && _MSC_VER < 1939
if( read_x86_extension_flags() >= x86_simd::AVX2 )
{
msg.log( VVENC_WARNING, "WARNING: MSVC version >= 17.8 produces invalid AVX2 code, partially disabling AVX2!\n" );
msg.log( VVENC_WARNING, "WARNING: MSVC version 17.8 produces invalid AVX2 code, partially disabling AVX2!\n" );
}

#endif
Expand Down

0 comments on commit fb7db94

Please sign in to comment.