Skip to content

Commit ec9aac6

Browse files
dpinophiln
authored andcommitted
[LibWebRTC] Include AVX2 sources on Intel hosts
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
1 parent 80c6813 commit ec9aac6

3 files changed

Lines changed: 4 additions & 79 deletions

File tree

Source/ThirdParty/libwebrtc/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,8 +1855,8 @@ if (WTF_CPU_X86_64 OR WTF_CPU_X86)
18551855
)
18561856
endif()
18571857

1858-
if (WTF_CPU_X86_64 AND WTF_CPU_HAS_AVX2)
1859-
list(APPEND webrtc_SOURCES
1858+
if (WTF_CPU_X86_64 OR WTF_CPU_X86)
1859+
list(APPEND webrtc_avx_SOURCES
18601860
Source/webrtc/common_audio/fir_filter_avx2.cc
18611861
Source/webrtc/common_audio/resampler/sinc_resampler_avx2.cc
18621862
Source/webrtc/modules/audio_processing/aec3/adaptive_fir_filter_avx2.cc
@@ -1866,7 +1866,8 @@ if (WTF_CPU_X86_64 AND WTF_CPU_HAS_AVX2)
18661866
Source/webrtc/modules/audio_processing/aec3/vector_math_avx2.cc
18671867
Source/webrtc/modules/audio_processing/agc2/rnn_vad/vector_math_avx2.cc
18681868
)
1869-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mno-avx512f")
1869+
set_source_files_properties(webrtc_avx_SOURCES PROPERTIES COMPILE_OPTIONS "-mavx2;-mfma")
1870+
list(APPEND webrtc_SOURCES webrtc_avx_SOURCES)
18701871
add_definitions(-DWEBRTC_ENABLE_AVX2)
18711872
endif()
18721873

Source/cmake/DetectAVX2.cmake

Lines changed: 0 additions & 69 deletions
This file was deleted.

Source/cmake/WebKitCommon.cmake

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,6 @@ if (NOT HAS_RUN_WEBKIT_COMMON)
125125
set(WTF_CPU_UNKNOWN 1)
126126
endif ()
127127

128-
if (WTF_CPU_X86_64 AND NOT CMAKE_CROSSCOMPILING)
129-
include(DetectAVX2)
130-
if (AVX2_SUPPORT_FOUND)
131-
set(WTF_CPU_HAS_AVX2 1)
132-
endif ()
133-
endif ()
134-
135128
# -----------------------------------------------------------------------------
136129
# Determine the operating system
137130
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)