Skip to content

Commit

Permalink
[LibWebRTC] Include AVX2 sources on Intel hosts
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=258708

Reviewed by Carlos Alberto Lopez Perez.

This partially reverts 265646@main.

Include AVX2 sources if host is X86 or X64.
Build AVX2 sources with build flags '-mavx2' and '-mfma'.

* Source/ThirdParty/libwebrtc/CMakeLists.txt:
* Source/cmake/DetectAVX2.cmake: Removed.
* Source/cmake/WebKitCommon.cmake:

Canonical link: https://commits.webkit.org/265754@main
  • Loading branch information
dpino committed Jul 4, 2023
1 parent 532bc8b commit 0de2717
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 79 deletions.
7 changes: 4 additions & 3 deletions Source/ThirdParty/libwebrtc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1780,8 +1780,8 @@ if (WTF_CPU_X86_64 OR WTF_CPU_X86)
)
endif()

if (WTF_CPU_X86_64 AND WTF_CPU_HAS_AVX2)
list(APPEND webrtc_SOURCES
if (WTF_CPU_X86_64 OR WTF_CPU_X86)
list(APPEND webrtc_avx_SOURCES
Source/webrtc/common_audio/fir_filter_avx2.cc
Source/webrtc/common_audio/resampler/sinc_resampler_avx2.cc
Source/webrtc/modules/audio_processing/aec3/adaptive_fir_filter_avx2.cc
Expand All @@ -1791,7 +1791,8 @@ if (WTF_CPU_X86_64 AND WTF_CPU_HAS_AVX2)
Source/webrtc/modules/audio_processing/aec3/vector_math_avx2.cc
Source/webrtc/modules/audio_processing/agc2/rnn_vad/vector_math_avx2.cc
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mno-avx512f")
set_source_files_properties(webrtc_avx_SOURCES PROPERTIES COMPILE_OPTIONS "-mavx2;-mfma")
list(APPEND webrtc_SOURCES webrtc_avx_SOURCES)
add_definitions(-DWEBRTC_ENABLE_AVX2)
endif()

Expand Down
69 changes: 0 additions & 69 deletions Source/cmake/DetectAVX2.cmake

This file was deleted.

7 changes: 0 additions & 7 deletions Source/cmake/WebKitCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,6 @@ if (NOT HAS_RUN_WEBKIT_COMMON)
set(WTF_CPU_UNKNOWN 1)
endif ()

if (WTF_CPU_X86_64 AND NOT CMAKE_CROSSCOMPILING)
include(DetectAVX2)
if (AVX2_SUPPORT_FOUND)
set(WTF_CPU_HAS_AVX2 1)
endif ()
endif ()

# -----------------------------------------------------------------------------
# Determine the operating system
# -----------------------------------------------------------------------------
Expand Down

0 comments on commit 0de2717

Please sign in to comment.