Commit 6ecc9a80 authored by James Zern's avatar James Zern Committed by Commit Bot

libgav1,BUILD.gn: force optimize, arm flags

-O2 is ~11-17% faster than -Os on a pixel 3a using a ndk build of the
decoder (r21d)

Bug: 1047051
Change-Id: Ifa67bcd7352f535a71f726c32320d6c0353263d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2340497Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarJames Zern <jzern@google.com>
Commit-Queue: James Zern <jzern@google.com>
Cr-Commit-Position: refs/heads/master@{#796468}
parent 1ece4ccb
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/arm.gni")
import("//third_party/libgav1/libgav1_srcs.gni") import("//third_party/libgav1/libgav1_srcs.gni")
import("//third_party/libgav1/options.gni") import("//third_party/libgav1/options.gni")
...@@ -23,12 +24,28 @@ config("public_libgav1_config") { ...@@ -23,12 +24,28 @@ config("public_libgav1_config") {
] ]
} }
config("private_libgav1_config") {
configs = []
# dsp intrinsics will generate much better code when optimized for speed
# rather than size.
if (!is_debug) {
configs += [ "//build/config/compiler:optimize_max" ]
}
if (current_cpu == "arm64" ||
(current_cpu == "arm" && arm_version >= 7 && arm_use_neon)) {
# The default thumb mode will impact performance of dsp intrinsics.
configs += [ "//build/config/compiler:compiler_arm" ]
}
}
if (enable_libgav1_decoder) { if (enable_libgav1_decoder) {
# Separate from libgav1 because utils/constants.cc and dsp/constants.cc # Separate from libgav1 because utils/constants.cc and dsp/constants.cc
# generate the same object file, constants.o. # generate the same object file, constants.o.
source_set("libgav1_utils") { source_set("libgav1_utils") {
configs -= [ "//build/config/compiler:chromium_code" ] configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":private_libgav1_config" ]
public_configs = [ ":public_libgav1_config" ] public_configs = [ ":public_libgav1_config" ]
...@@ -40,6 +57,7 @@ if (enable_libgav1_decoder) { ...@@ -40,6 +57,7 @@ if (enable_libgav1_decoder) {
source_set("libgav1_dsp") { source_set("libgav1_dsp") {
configs -= [ "//build/config/compiler:chromium_code" ] configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":private_libgav1_config" ]
deps = [ ":libgav1_utils" ] deps = [ ":libgav1_utils" ]
public_configs = [ ":public_libgav1_config" ] public_configs = [ ":public_libgav1_config" ]
...@@ -49,6 +67,7 @@ if (enable_libgav1_decoder) { ...@@ -49,6 +67,7 @@ if (enable_libgav1_decoder) {
static_library("libgav1") { static_library("libgav1") {
configs -= [ "//build/config/compiler:chromium_code" ] configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":private_libgav1_config" ]
public_configs = [ ":public_libgav1_config" ] public_configs = [ ":public_libgav1_config" ]
public_deps = [ public_deps = [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment