Skip to content

Commit

Permalink
Merge pull request #482 from K-os/fix_arm_shared_build
Browse files Browse the repository at this point in the history
Fix arm shared build
  • Loading branch information
adamjw24 authored Dec 4, 2024
2 parents 231422f + 717112a commit 693d52a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
}
- {
name: "Windows MSVC 32 Bit",
os: windows-2019,
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars32.bat",
generators: "Visual Studio 16 2019",
os: windows-2022,
environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars32.bat",
generators: "Visual Studio 17 2022",
msvc_arch: Win32
}
- {
Expand Down Expand Up @@ -67,16 +67,16 @@ jobs:
- name: Ubuntu/Mac OS X/MinGW build
if: ${{ !contains( matrix.config.generators, 'Visual Studio' ) }}
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release "-DCMAKE_OSX_ARCHITECTURES=${{ matrix.config.osx_arch }}"
cmake --build .
cmake -S . -B build/static -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 "-DCMAKE_OSX_ARCHITECTURES=${{ matrix.config.osx_arch }}"
cmake --build build/static
cmake -S . -B build/shared -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 "-DCMAKE_OSX_ARCHITECTURES=${{ matrix.config.osx_arch }}"
cmake --build build/shared
- name: MSVC build
if: contains( matrix.config.generators, 'Visual Studio' )
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DVVENC_OVERRIDE_COMPILER_CHECK=ON -A "${{ matrix.config.msvc_arch }}"
cmake --build . --config Release
cmake -S . -B build/static -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 -DVVENC_OVERRIDE_COMPILER_CHECK=ON -A "${{ matrix.config.msvc_arch }}"
cmake --build build/static --config Release
cmake -S . -B build/shared -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 -DVVENC_OVERRIDE_COMPILER_CHECK=ON -A "${{ matrix.config.msvc_arch }}"
cmake --build build/shared --config Release
shell: cmd
4 changes: 4 additions & 0 deletions source/Lib/CommonLib/arm/BufferARM.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ void applyLut_SIMD( const Pel* src, const ptrdiff_t srcStride, Pel* dst, const p
{
for( int x = 0; x < width; x += 8 )
{
GCC_WARNING_DISABLE_maybe_uninitialized

xtmp1 = vsetq_lane_s16( lut[ src[ x + 0 ] ], xtmp1, 0 );
xtmp1 = vsetq_lane_s16( lut[ src[ x + 1 ] ], xtmp1, 1 );
xtmp1 = vsetq_lane_s16( lut[ src[ x + 2 ] ], xtmp1, 2 );
Expand Down Expand Up @@ -361,6 +363,8 @@ void applyLut_SIMD( const Pel* src, const ptrdiff_t srcStride, Pel* dst, const p
xtmp4 = vsetq_lane_s16( lut[ src[ x + 3 * srcStride + 6 ] ], xtmp4, 6 );
xtmp4 = vsetq_lane_s16( lut[ src[ x + 3 * srcStride + 7 ] ], xtmp4, 7 );

GCC_WARNING_RESET

vst1q_s16( &dst[ x ], xtmp1 );
vst1q_s16( &dst[ x + 1 * dstStride ], xtmp2 );
vst1q_s16( &dst[ x + 2 * dstStride ], xtmp3 );
Expand Down
10 changes: 5 additions & 5 deletions source/Lib/vvenc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if( VVENC_ENABLE_ARM_SIMD )
file( GLOB ARM_INC_FILES CONFIGURE_DEPENDS "../CommonLib/arm/*.h" )

file( GLOB ARM_NEON_SRC_FILES CONFIGURE_DEPENDS "../CommonLib/arm/neon/*.cpp" )
file( GLOB ARM_SVE_SRC_FILES CONFIGURE_DEPENDS "../CommonLib/arm/sve/*.cpp" )
file( GLOB ARM_SVE_SRC_FILES CONFIGURE_DEPENDS "../CommonLib/arm/sve/*.cpp" )
file( GLOB ARM_SVE2_SRC_FILES CONFIGURE_DEPENDS "../CommonLib/arm/sve2/*.cpp" )
endif()

Expand Down Expand Up @@ -142,21 +142,21 @@ if( VVENC_ENABLE_ARM_SIMD )
set_if_compiler_supports_flag( FLAG_mfpu_neon "-mfpu=neon" )
set_property( SOURCE ${ARM_NEON_SRC_FILES} APPEND PROPERTY COMPILE_FLAGS "${FLAG_mfpu_neon}" )
endif()
list(APPEND ARM_SRC_FILES ${ARM_NEON_SRC_FILES})
list( APPEND ARM_SIMD_SRC_FILES ${ARM_NEON_SRC_FILES} )

if( VVENC_ENABLE_ARM_SIMD_SVE )
set_property( SOURCE ${ARM_SVE_SRC_FILES} APPEND PROPERTY COMPILE_DEFINITIONS USE_NEON USE_SVE )
set_property( SOURCE ${ARM_SVE_SRC_FILES} APPEND PROPERTY COMPILE_FLAGS ${FLAG_sve} )
list(APPEND ARM_SRC_FILES ${ARM_SVE_SRC_FILES})
list( APPEND ARM_SIMD_SRC_FILES ${ARM_SVE_SRC_FILES} )
endif()

if( VVENC_ENABLE_ARM_SIMD_SVE2 )
set_property( SOURCE ${ARM_SVE2_SRC_FILES} APPEND PROPERTY COMPILE_DEFINITIONS USE_NEON USE_SVE USE_SVE2 )
set_property( SOURCE ${ARM_SVE2_SRC_FILES} APPEND PROPERTY COMPILE_FLAGS ${FLAG_sve2} )
list(APPEND ARM_SRC_FILES ${ARM_SVE2_SRC_FILES})
list( APPEND ARM_SIMD_SRC_FILES ${ARM_SVE2_SRC_FILES} )
endif()

add_library( ${LIB_NAME}_arm_simd OBJECT ${ARM_SRC_FILES} )
add_library( ${LIB_NAME}_arm_simd OBJECT ${ARM_SIMD_SRC_FILES} )

# Disable LTO for the files compiled with special architecture flags.
set_target_properties( ${LIB_NAME}_arm_simd PROPERTIES
Expand Down

0 comments on commit 693d52a

Please sign in to comment.