diff --git a/BUILD.gn b/BUILD.gn index b61f3e5472..3c0405d01d 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -218,6 +218,19 @@ opts("hsw") { } } +opts("skx") { + enabled = is_x86 + sources = skia_opts.skx_sources + if (is_win) { + cflags = [ "/arch:AVX512" ] + } else { + cflags = [ "-march=skylake-avx512" ] + if (is_mac && is_debug) { + cflags += [ "-fno-stack-check" ] # Work around skia:9709 + } + } +} + # Any feature of Skia that requires third-party code should be optional and use this template. template("optional") { visibility = [ ":*" ] diff --git a/gn/gn_to_bp.py b/gn/gn_to_bp.py index 10a099511f..9e68d71d25 100755 --- a/gn/gn_to_bp.py +++ b/gn/gn_to_bp.py @@ -494,7 +494,8 @@ with open('Android.bp', 'w') as Android_bp: defs['sse41'] + defs['sse42'] + defs['avx' ] + - defs['hsw' ])), + defs['hsw' ] + + defs['skx' ])), 'dm_includes' : bpfmt(8, dm_includes), 'dm_srcs' : bpfmt(8, dm_srcs), diff --git a/gn/opts.gni b/gn/opts.gni index 4c0cead112..3d0f3896f3 100644 --- a/gn/opts.gni +++ b/gn/opts.gni @@ -18,3 +18,4 @@ sse41 = [ "$_src/opts/SkOpts_sse41.cpp" ] sse42 = [ "$_src/opts/SkOpts_sse42.cpp" ] avx = [ "$_src/opts/SkOpts_avx.cpp" ] hsw = [ "$_src/opts/SkOpts_hsw.cpp" ] +skx = [ "$_src/opts/SkOpts_skx.cpp" ] diff --git a/gn/shared_sources.gni b/gn/shared_sources.gni index 71500113a6..e710a0e0b6 100644 --- a/gn/shared_sources.gni +++ b/gn/shared_sources.gni @@ -26,4 +26,5 @@ skia_opts = { sse42_sources = sse42 avx_sources = avx hsw_sources = hsw + skx_sources = skx } diff --git a/src/opts/SkOpts_skx.cpp b/src/opts/SkOpts_skx.cpp new file mode 100644 index 0000000000..23f18e1f75 --- /dev/null +++ b/src/opts/SkOpts_skx.cpp @@ -0,0 +1,8 @@ +/* + * Copyright 2020 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +// Intentionally empty, to be filled in.