Commit 9743ad34 authored by James Zern's avatar James Zern Committed by Chromium LUCI CQ

libgav1,BUILD.gn: split sse4 files to a separate target

this allows flagging the code with -msse4.1; fixes a build failure with
clang-cl as for msvc builds sse4 support is assumed, but clang-cl
requires the -m flag to enable it.

Bug: 1151489
Change-Id: I3d29e5c3d4985b76ad44e9ca15886c0428c5c140
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2561030
Commit-Queue: James Zern <jzern@google.com>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832690}
parent 03d8f4f7
......@@ -59,10 +59,31 @@ if (enable_libgav1_decoder || use_libgav1_parser) {
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":private_libgav1_config" ]
deps = [
":libgav1_dsp_sse4",
":libgav1_utils",
]
public_configs = [ ":public_libgav1_config" ]
sources = gav1_dsp_sources + gav1_dsp_headers_sources
}
# SSE4 sources are split to their own target as Chrome is currently built
# with -msse3.
source_set("libgav1_dsp_sse4") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":private_libgav1_config" ]
deps = [ ":libgav1_utils" ]
public_configs = [ ":public_libgav1_config" ]
sources = gav1_dsp_sources
if (current_cpu == "x86" || current_cpu == "x64") {
cflags = [ "-msse4.1" ]
}
sources = gav1_dsp_sse4_sources + gav1_dsp_sse4_headers_sources +
gav1_dsp_headers_sources
}
static_library("libgav1") {
......
......@@ -101,8 +101,28 @@ func main() {
found := false
for _, d := range topDirs {
if strings.HasPrefix(f, d) {
bd := filepath.Base(d)
m[bd] = append(m[bd], f)
var bd string
for _, asm := range []string{"sse4"} {
pattern := "*_" + asm + "*"
if match, err := filepath.Match(pattern, filepath.Base(f)); err != nil {
panic(err)
} else if match {
bd = filepath.Base(d) + "_" + asm
break
}
}
if bd == "" {
bd = filepath.Base(d)
}
// Split the dsp headers out to their own variables as the
// assembly may depend on both its headers and the top-level
// headers.
if strings.HasPrefix(bd, "dsp") && filepath.Ext(f) == ".h" {
m[bd+"_headers"] = append(m[bd+"_headers"], f)
} else {
m[bd] = append(m[bd], f)
}
found = true
break
}
......
......@@ -43,119 +43,128 @@ gav1_common_sources = [
gav1_dsp_sources = [
"//third_party/libgav1/src/src/dsp/arm/average_blend_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/average_blend_neon.h",
"//third_party/libgav1/src/src/dsp/arm/cdef_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/cdef_neon.h",
"//third_party/libgav1/src/src/dsp/arm/common_neon.h",
"//third_party/libgav1/src/src/dsp/arm/convolve_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/convolve_neon.h",
"//third_party/libgav1/src/src/dsp/arm/distance_weighted_blend_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/distance_weighted_blend_neon.h",
"//third_party/libgav1/src/src/dsp/arm/film_grain_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/film_grain_neon.h",
"//third_party/libgav1/src/src/dsp/arm/intra_edge_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/intra_edge_neon.h",
"//third_party/libgav1/src/src/dsp/arm/intrapred_cfl_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/intrapred_directional_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/intrapred_filter_intra_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/intrapred_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/intrapred_neon.h",
"//third_party/libgav1/src/src/dsp/arm/intrapred_smooth_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/inverse_transform_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/inverse_transform_neon.h",
"//third_party/libgav1/src/src/dsp/arm/loop_filter_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/loop_filter_neon.h",
"//third_party/libgav1/src/src/dsp/arm/loop_restoration_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/loop_restoration_neon.h",
"//third_party/libgav1/src/src/dsp/arm/mask_blend_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/mask_blend_neon.h",
"//third_party/libgav1/src/src/dsp/arm/motion_field_projection_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/motion_field_projection_neon.h",
"//third_party/libgav1/src/src/dsp/arm/motion_vector_search_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/motion_vector_search_neon.h",
"//third_party/libgav1/src/src/dsp/arm/obmc_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/obmc_neon.h",
"//third_party/libgav1/src/src/dsp/arm/super_res_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/super_res_neon.h",
"//third_party/libgav1/src/src/dsp/arm/warp_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/warp_neon.h",
"//third_party/libgav1/src/src/dsp/arm/weight_mask_neon.cc",
"//third_party/libgav1/src/src/dsp/arm/weight_mask_neon.h",
"//third_party/libgav1/src/src/dsp/average_blend.cc",
"//third_party/libgav1/src/src/dsp/average_blend.h",
"//third_party/libgav1/src/src/dsp/cdef.cc",
"//third_party/libgav1/src/src/dsp/constants.cc",
"//third_party/libgav1/src/src/dsp/convolve.cc",
"//third_party/libgav1/src/src/dsp/distance_weighted_blend.cc",
"//third_party/libgav1/src/src/dsp/dsp.cc",
"//third_party/libgav1/src/src/dsp/film_grain.cc",
"//third_party/libgav1/src/src/dsp/intra_edge.cc",
"//third_party/libgav1/src/src/dsp/intrapred.cc",
"//third_party/libgav1/src/src/dsp/inverse_transform.cc",
"//third_party/libgav1/src/src/dsp/loop_filter.cc",
"//third_party/libgav1/src/src/dsp/loop_restoration.cc",
"//third_party/libgav1/src/src/dsp/mask_blend.cc",
"//third_party/libgav1/src/src/dsp/motion_field_projection.cc",
"//third_party/libgav1/src/src/dsp/motion_vector_search.cc",
"//third_party/libgav1/src/src/dsp/obmc.cc",
"//third_party/libgav1/src/src/dsp/super_res.cc",
"//third_party/libgav1/src/src/dsp/warp.cc",
"//third_party/libgav1/src/src/dsp/weight_mask.cc",
]
gav1_dsp_headers_sources = [
"//third_party/libgav1/src/src/dsp/arm/average_blend_neon.h",
"//third_party/libgav1/src/src/dsp/arm/cdef_neon.h",
"//third_party/libgav1/src/src/dsp/arm/common_neon.h",
"//third_party/libgav1/src/src/dsp/arm/convolve_neon.h",
"//third_party/libgav1/src/src/dsp/arm/distance_weighted_blend_neon.h",
"//third_party/libgav1/src/src/dsp/arm/film_grain_neon.h",
"//third_party/libgav1/src/src/dsp/arm/intra_edge_neon.h",
"//third_party/libgav1/src/src/dsp/arm/intrapred_neon.h",
"//third_party/libgav1/src/src/dsp/arm/inverse_transform_neon.h",
"//third_party/libgav1/src/src/dsp/arm/loop_filter_neon.h",
"//third_party/libgav1/src/src/dsp/arm/loop_restoration_neon.h",
"//third_party/libgav1/src/src/dsp/arm/mask_blend_neon.h",
"//third_party/libgav1/src/src/dsp/arm/motion_field_projection_neon.h",
"//third_party/libgav1/src/src/dsp/arm/motion_vector_search_neon.h",
"//third_party/libgav1/src/src/dsp/arm/obmc_neon.h",
"//third_party/libgav1/src/src/dsp/arm/super_res_neon.h",
"//third_party/libgav1/src/src/dsp/arm/warp_neon.h",
"//third_party/libgav1/src/src/dsp/arm/weight_mask_neon.h",
"//third_party/libgav1/src/src/dsp/average_blend.h",
"//third_party/libgav1/src/src/dsp/cdef.h",
"//third_party/libgav1/src/src/dsp/common.h",
"//third_party/libgav1/src/src/dsp/constants.cc",
"//third_party/libgav1/src/src/dsp/constants.h",
"//third_party/libgav1/src/src/dsp/convolve.cc",
"//third_party/libgav1/src/src/dsp/convolve.h",
"//third_party/libgav1/src/src/dsp/distance_weighted_blend.cc",
"//third_party/libgav1/src/src/dsp/distance_weighted_blend.h",
"//third_party/libgav1/src/src/dsp/dsp.cc",
"//third_party/libgav1/src/src/dsp/dsp.h",
"//third_party/libgav1/src/src/dsp/film_grain.cc",
"//third_party/libgav1/src/src/dsp/film_grain.h",
"//third_party/libgav1/src/src/dsp/film_grain_common.h",
"//third_party/libgav1/src/src/dsp/intra_edge.cc",
"//third_party/libgav1/src/src/dsp/intra_edge.h",
"//third_party/libgav1/src/src/dsp/intrapred.cc",
"//third_party/libgav1/src/src/dsp/intrapred.h",
"//third_party/libgav1/src/src/dsp/inverse_transform.cc",
"//third_party/libgav1/src/src/dsp/inverse_transform.h",
"//third_party/libgav1/src/src/dsp/loop_filter.cc",
"//third_party/libgav1/src/src/dsp/loop_filter.h",
"//third_party/libgav1/src/src/dsp/loop_restoration.cc",
"//third_party/libgav1/src/src/dsp/loop_restoration.h",
"//third_party/libgav1/src/src/dsp/mask_blend.cc",
"//third_party/libgav1/src/src/dsp/mask_blend.h",
"//third_party/libgav1/src/src/dsp/motion_field_projection.cc",
"//third_party/libgav1/src/src/dsp/motion_field_projection.h",
"//third_party/libgav1/src/src/dsp/motion_vector_search.cc",
"//third_party/libgav1/src/src/dsp/motion_vector_search.h",
"//third_party/libgav1/src/src/dsp/obmc.cc",
"//third_party/libgav1/src/src/dsp/obmc.h",
"//third_party/libgav1/src/src/dsp/super_res.cc",
"//third_party/libgav1/src/src/dsp/super_res.h",
"//third_party/libgav1/src/src/dsp/warp.cc",
"//third_party/libgav1/src/src/dsp/warp.h",
"//third_party/libgav1/src/src/dsp/weight_mask.cc",
"//third_party/libgav1/src/src/dsp/weight_mask.h",
]
gav1_dsp_sse4_sources = [
"//third_party/libgav1/src/src/dsp/x86/average_blend_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/average_blend_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/cdef_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/cdef_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/common_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/convolve_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/convolve_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/distance_weighted_blend_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/distance_weighted_blend_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/intra_edge_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/intra_edge_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/intrapred_cfl_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/intrapred_smooth_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/intrapred_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/intrapred_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/inverse_transform_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/inverse_transform_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/loop_filter_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/loop_filter_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/loop_restoration_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/loop_restoration_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/mask_blend_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/mask_blend_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/motion_field_projection_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/motion_field_projection_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/motion_vector_search_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/motion_vector_search_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/obmc_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/obmc_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/super_res_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/warp_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/weight_mask_sse4.cc",
]
gav1_dsp_sse4_headers_sources = [
"//third_party/libgav1/src/src/dsp/x86/average_blend_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/cdef_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/common_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/convolve_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/distance_weighted_blend_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/intra_edge_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/intrapred_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/inverse_transform_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/loop_filter_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/loop_restoration_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/mask_blend_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/motion_field_projection_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/motion_vector_search_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/obmc_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/super_res_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/transpose_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/warp_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/warp_sse4.h",
"//third_party/libgav1/src/src/dsp/x86/weight_mask_sse4.cc",
"//third_party/libgav1/src/src/dsp/x86/weight_mask_sse4.h",
]
......
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