Split out skcms_sources into multiple GN targets.
This will allow us to have separate -march= flags for Haswell and Skylake pixel-conversion loops, which is important to dodge a Clang bug (https://github.com/llvm/llvm-project/issues/64706) Bug: b/310927123 Change-Id: I828f0cf591a1c4d0a6260fef786c80e95b38ead7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5038351 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com> Cr-Commit-Position: refs/heads/main@{#1226103}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
1cf7d6689e
commit
ff297868ea
@@ -242,27 +242,6 @@ source_set("skia_core_public_headers") {
|
|||||||
public = skia_core_public
|
public = skia_core_public
|
||||||
}
|
}
|
||||||
|
|
||||||
source_set("skcms") {
|
|
||||||
cflags = []
|
|
||||||
if (!is_win || is_clang) {
|
|
||||||
cflags += [
|
|
||||||
"-w",
|
|
||||||
"-std=c11",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
# LLVM automatically sets the equivalent of GCC's -mfp16-format=ieee on ARM
|
|
||||||
# builds by default, while GCC itself does not. We need it to enable support
|
|
||||||
# for half-precision floating point data types used by SKCMS on ARM.
|
|
||||||
if ((is_linux || is_chromeos) && !is_clang && current_cpu == "arm") {
|
|
||||||
cflags += [ "-mfp16-format=ieee" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
public = [ "//third_party/skia/modules/skcms/skcms.h" ]
|
|
||||||
include_dirs = [ "//third_party/skia/modules/skcms" ]
|
|
||||||
sources = rebase_path(skcms_sources, ".", "//third_party/skia/modules/skcms")
|
|
||||||
}
|
|
||||||
|
|
||||||
component("skia") {
|
component("skia") {
|
||||||
deps = []
|
deps = []
|
||||||
public = [
|
public = [
|
||||||
@@ -747,8 +726,7 @@ if (current_cpu == "x86" || current_cpu == "x64") {
|
|||||||
"-mf16c",
|
"-mf16c",
|
||||||
"-mfma",
|
"-mfma",
|
||||||
]
|
]
|
||||||
}
|
} else {
|
||||||
if (is_win) {
|
|
||||||
cflags = [ "/arch:AVX2" ]
|
cflags = [ "/arch:AVX2" ]
|
||||||
}
|
}
|
||||||
visibility = [ ":skia_opts" ]
|
visibility = [ ":skia_opts" ]
|
||||||
@@ -799,6 +777,77 @@ skia_source_set("skia_opts") {
|
|||||||
visibility = [ ":skia" ]
|
visibility = [ ":skia" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (current_cpu == "x64") {
|
||||||
|
skia_source_set("skcms_TransformHsw") {
|
||||||
|
sources = skcms_TransformHsw
|
||||||
|
if (!is_win) {
|
||||||
|
cflags = [
|
||||||
|
"-w",
|
||||||
|
"-march=haswell",
|
||||||
|
"-std=c11",
|
||||||
|
]
|
||||||
|
} else {
|
||||||
|
cflags = [ "/arch:AVX2" ]
|
||||||
|
}
|
||||||
|
visibility = [ ":skcms" ]
|
||||||
|
}
|
||||||
|
skia_source_set("skcms_TransformSkx") {
|
||||||
|
sources = skcms_TransformSkx
|
||||||
|
if (!is_win) {
|
||||||
|
cflags = [
|
||||||
|
"-w",
|
||||||
|
"-march=skylake-avx512",
|
||||||
|
"-std=c11",
|
||||||
|
]
|
||||||
|
} else {
|
||||||
|
cflags = [ "/arch:AVX512" ]
|
||||||
|
}
|
||||||
|
visibility = [ ":skcms" ]
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
skia_source_set("skcms_TransformHsw") {
|
||||||
|
sources = []
|
||||||
|
visibility = [ ":skcms" ]
|
||||||
|
}
|
||||||
|
skia_source_set("skcms_TransformSkx") {
|
||||||
|
sources = []
|
||||||
|
visibility = [ ":skcms" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
source_set("skcms_TransformBaseline_and_public") {
|
||||||
|
if (!is_win || is_clang) {
|
||||||
|
cflags = [
|
||||||
|
"-w",
|
||||||
|
"-std=c11",
|
||||||
|
]
|
||||||
|
} else {
|
||||||
|
cflags = []
|
||||||
|
}
|
||||||
|
|
||||||
|
# LLVM automatically sets the equivalent of GCC's -mfp16-format=ieee on ARM
|
||||||
|
# builds by default, while GCC itself does not. We need it to enable support
|
||||||
|
# for half-precision floating point data types used by SKCMS on ARM.
|
||||||
|
if ((is_linux || is_chromeos) && !is_clang && current_cpu == "arm") {
|
||||||
|
cflags += [ "-mfp16-format=ieee" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
sources = rebase_path(skcms_TransformBaseline + skcms_public,
|
||||||
|
".",
|
||||||
|
"//third_party/skia/modules/skcms")
|
||||||
|
}
|
||||||
|
|
||||||
|
source_set("skcms") {
|
||||||
|
deps = [
|
||||||
|
":skcms_TransformBaseline_and_public",
|
||||||
|
":skcms_TransformHsw",
|
||||||
|
":skcms_TransformSkx",
|
||||||
|
]
|
||||||
|
public =
|
||||||
|
rebase_path(skcms_public_headers, ".", "//third_party/skia/modules/skcms")
|
||||||
|
include_dirs = [ "//third_party/skia/modules/skcms" ]
|
||||||
|
}
|
||||||
|
|
||||||
# Split out Graphite sources because of conflicting file names with Ganesh.
|
# Split out Graphite sources because of conflicting file names with Ganesh.
|
||||||
# Split into separate private and public source sets because we want to allow
|
# Split into separate private and public source sets because we want to allow
|
||||||
# shared GPU code in ":skia" to include private Graphite headers, but want to
|
# shared GPU code in ":skia" to include private Graphite headers, but want to
|
||||||
|
Reference in New Issue
Block a user