update CMake and Google3 builds for AVX/AVX2
The _avx.cpp code was working in a degraded (SSE2/SSSE3) mode silently.
This CL will make the _avx.cpp code start using AVX.
There is currently no _avx2.cpp code, but I'm writing some now,
and this change will make it work properly from the start.
Chrome and Android builds should already be okay.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1535443003
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot
Review URL: https://codereview.chromium.org/1535443003
diff --git a/BUILD.public b/BUILD.public
index d20eb23..b184f72 100644
--- a/BUILD.public
+++ b/BUILD.public
@@ -84,6 +84,8 @@
# Included in :opts_sse4 library.
"src/opts/*SSE4*",
"src/opts/*sse4*",
+ # Included in :opts_avx or :opts_avx2
+ "src/opts/*avx*",
"src/opts/SkBitmapProcState_opts_none.cpp",
"src/opts/SkBlitMask_opts_none.cpp",
"src/opts/SkBlitRow_opts_none.cpp",
@@ -123,6 +125,7 @@
"src/opts/*ssse3*",
"src/opts/*SSE4*",
"src/opts/*sse4*",
+ "src/opts/*avx*",
"src/opts/*x86*",
"src/opts/SkBitmapProcState_opts_none.cpp",
"src/opts/SkBlitMask_opts_none.cpp",
@@ -165,6 +168,7 @@
"src/opts/*ssse3*",
"src/opts/*SSE4*",
"src/opts/*sse4*",
+ "src/opts/*avx*",
"src/opts/*x86*",
"src/opts/SkBitmapProcState_opts_none.cpp",
"src/opts/SkBlitMask_opts_none.cpp",
@@ -212,6 +216,18 @@
],
)
+AVX_SRCS = glob(
+ [
+ "src/opts/*_avx.cpp",
+ ],
+)
+
+AVX2_SRCS = glob(
+ [
+ "src/opts/*_avx2.cpp",
+ ],
+)
+
BASE_HDRS = glob(
[
"include/**/*.h",
@@ -229,6 +245,8 @@
# Dependencies.
BASE_DEPS_UNIX = [
+ ":opts_avx2",
+ ":opts_avx",
":opts_sse4",
":opts_ssse3",
]
@@ -424,6 +442,24 @@
deps = EXTERNAL_DEPS_ALL,
)
+cc_library(
+ name = "opts_avx",
+ srcs = AVX_SRCS,
+ copts = COPTS + ["-mavx"],
+ defines = DEFINES,
+ includes = INCLUDES,
+ deps = EXTERNAL_DEPS_ALL,
+)
+
+cc_library(
+ name = "opts_avx2",
+ srcs = AVX2_SRCS,
+ copts = COPTS + ["-mavx2"],
+ defines = DEFINES,
+ includes = INCLUDES,
+ deps = EXTERNAL_DEPS_ALL,
+)
+
# If you need Ganesh (GPU) support in Skia, please contact skia-team@google.com
# for help.
cc_library(