Skip to content

Commit

Permalink
Explicitly add -mfpu=neon to all targets that use NEON
Browse files Browse the repository at this point in the history
Remove obsolete comment about Chromium not defining NEON for Android.

Semi-related fix: don't use `rtc_remove_configs` directly, `suppressed_configs` is the "public interface".

Bug: webrtc:9579
Change-Id: I512628feb462a29432f1356cfef00efe1ddaf84f
Reviewed-on: https://webrtc-review.googlesource.com/91761
Reviewed-by: Mirko Bonadei <[email protected]>
Reviewed-by: Per Åhgren <[email protected]>
Commit-Queue: Oleh Prypin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#24165}
  • Loading branch information
oprypin authored and Commit Bot committed Aug 1, 2018
1 parent 7a1c7f7 commit d2f4e8b
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 25 deletions.
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ if (!build_with_chromium) {

sources = []
complete_static_lib = true
rtc_remove_configs = [ "//build/config/compiler:thin_archive" ]
suppressed_configs += [ "//build/config/compiler:thin_archive" ]
defines = []

deps = [
Expand Down
8 changes: 2 additions & 6 deletions common_audio/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,7 @@ if (rtc_build_with_neon) {
]

if (current_cpu != "arm64") {
# Enable compilation for the NEON instruction set. This is needed
# since //build/config/arm.gni only enables NEON for iOS, not Android.
# This provides the same functionality as webrtc/build/arm_neon.gypi.
# Enable compilation for the NEON instruction set.
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}
Expand Down Expand Up @@ -325,9 +323,7 @@ if (rtc_build_with_neon) {
]

if (current_cpu != "arm64") {
# Enable compilation for the NEON instruction set. This is needed
# since //build/config/arm.gni only enables NEON for iOS, not Android.
# This provides the same functionality as webrtc/build/arm_neon.gypi.
# Enable compilation for the NEON instruction set.
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}
Expand Down
11 changes: 8 additions & 3 deletions modules/audio_coding/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,13 @@ rtc_source_set("isac_fix_c") {

if (rtc_build_with_neon) {
deps += [ ":isac_neon" ]

# TODO(bugs.webrtc.org/9579): Consider moving the usage of NEON from
# pitch_estimator_c.c into the "isac_neon" target and delete this flag:
if (current_cpu != "arm64") {
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}
}

if (current_cpu == "arm" && arm_version >= 7) {
Expand Down Expand Up @@ -733,9 +740,7 @@ if (rtc_build_with_neon) {
]

if (current_cpu != "arm64") {
# Enable compilation for the NEON instruction set. This is needed
# since //build/config/arm.gni only enables NEON for iOS, not Android.
# This provides the same functionality as webrtc/build/arm_neon.gypi.
# Enable compilation for the NEON instruction set.
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}
Expand Down
4 changes: 1 addition & 3 deletions modules/audio_processing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,7 @@ rtc_source_set("audio_processing_c") {
sources += [ "ns/nsx_core_neon.c" ]

if (current_cpu != "arm64") {
# Enable compilation for the NEON instruction set. This is needed
# since //build/config/arm.gni only enables NEON for iOS, not Android.
# This provides the same functionality as webrtc/build/arm_neon.gypi.
# Enable compilation for the NEON instruction set.
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}
Expand Down
4 changes: 1 addition & 3 deletions modules/audio_processing/aec/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ rtc_source_set("aec_core") {
sources += [ "aec_core_neon.cc" ]

if (current_cpu != "arm64") {
# Enable compilation for the NEON instruction set. This is needed
# since //build/config/arm.gni only enables NEON for iOS, not Android.
# This provides the same functionality as webrtc/build/arm_neon.gypi.
# Enable compilation for the NEON instruction set.
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags += [ "-mfpu=neon" ]
}
Expand Down
5 changes: 5 additions & 0 deletions modules/audio_processing/aec3/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ rtc_static_library("aec3") {
]

defines = []
if (rtc_build_with_neon && current_cpu != "arm64") {
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}

deps = [
"..:apm_logging",
"..:audio_processing",
Expand Down
4 changes: 1 addition & 3 deletions modules/audio_processing/aecm/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ rtc_source_set("aecm_core") {
sources += [ "aecm_core_neon.cc" ]

if (current_cpu != "arm64") {
# Enable compilation for the NEON instruction set. This is needed
# since //build/config/arm.gni only enables NEON for iOS, not Android.
# This provides the same functionality as webrtc/build/arm_neon.gypi.
# Enable compilation for the NEON instruction set.
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags += [ "-mfpu=neon" ]
}
Expand Down
4 changes: 1 addition & 3 deletions modules/audio_processing/agc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ rtc_source_set("agc_legacy_c") {

if (rtc_build_with_neon) {
if (current_cpu != "arm64") {
# Enable compilation for the NEON instruction set. This is needed
# since //build/config/arm.gni only enables NEON for iOS, not Android.
# This provides the same functionality as webrtc/build/arm_neon.gypi.
# Enable compilation for the NEON instruction set.
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags = [ "-mfpu=neon" ]
}
Expand Down
4 changes: 1 addition & 3 deletions modules/audio_processing/utility/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ rtc_source_set("ooura_fft") {
deps += [ "../../../common_audio" ]

if (current_cpu != "arm64") {
# Enable compilation for the NEON instruction set. This is needed
# since //build/config/arm.gni only enables NEON for iOS, not Android.
# This provides the same functionality as webrtc/build/arm_neon.gypi.
# Enable compilation for the NEON instruction set.
suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
cflags += [ "-mfpu=neon" ]
}
Expand Down

0 comments on commit d2f4e8b

Please sign in to comment.