diff options
author | Mike Klein <mtklein@chromium.org> | 2016-09-30 10:48:01 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-09-30 15:10:48 +0000 |
commit | 78d5a3bac5cbde50cd12d8b9ab6dd269324b5272 (patch) | |
tree | 45c0aed9c0a299b8a2151b47ce94e218dac00dc9 /gyp | |
parent | d214d6ae69c1dd9ef49fdce8fac699d00bffcdcd (diff) |
Add an SkOpts target for Haswell+ Intel chips.
Haswell brought a whole slew of handy new instructions for us (AVX2, FMA, BMI1+BMI2) and also feature F16C, which came one generation earlier on Ivybridge. We work with integers often enough that we really want to target AVX2 instead of AVX, and this means it's pretty practical to ask for all those other goodies along with it.
Chrome's GN files and Google3's BUILD file will need an update, before or after this CL.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2840
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
Change-Id: I826daf77b5104664c5d31ddaabee347e287b87a2
Reviewed-on: https://skia-review.googlesource.com/2840
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Diffstat (limited to 'gyp')
-rw-r--r-- | gyp/opts.gyp | 16 | ||||
-rw-r--r-- | gyp/opts.gypi | 8 |
2 files changed, 16 insertions, 8 deletions
diff --git a/gyp/opts.gyp b/gyp/opts.gyp index 21edd859b0..f872083e0f 100644 --- a/gyp/opts.gyp +++ b/gyp/opts.gyp @@ -34,7 +34,7 @@ 'conditions': [ [ '"x86" in skia_arch_type and skia_os != "ios"', { 'cflags': [ '-msse2' ], - 'dependencies': [ 'opts_ssse3', 'opts_sse41', 'opts_sse42', 'opts_avx', 'opts_avx2' ], + 'dependencies': [ 'opts_ssse3', 'opts_sse41', 'opts_sse42', 'opts_avx', 'opts_hsw' ], 'sources': [ '<@(sse2_sources)' ], }], @@ -171,8 +171,8 @@ ], }, { - 'target_name': 'opts_avx2', - 'product_name': 'skia_opts_avx2', + 'target_name': 'opts_hsw', + 'product_name': 'skia_opts_hsw', 'type': 'static_library', 'standalone_static_library': 1, 'dependencies': [ 'core.gyp:*' ], @@ -181,11 +181,15 @@ '../src/core', '../src/utils', ], - 'sources': [ '<@(avx2_sources)' ], + 'sources': [ '<@(hsw_sources)' ], 'msvs_settings': { 'VCCLCompilerTool': { 'EnableEnhancedInstructionSet': '5' } }, - 'xcode_settings': { 'OTHER_CPLUSPLUSFLAGS': [ '-mavx2' ] }, + 'xcode_settings': { + 'OTHER_CPLUSPLUSFLAGS': [ '-mavx2', '-mbmi', '-mbmi2', '-mf16c', '-mfma' ] + }, 'conditions': [ - [ 'not skia_android_framework', { 'cflags': [ '-mavx2' ] }], + [ 'not skia_android_framework', { + 'cflags': [ '-mavx2', '-mbmi', '-mbmi2', '-mf16c', '-mfma' ] + }], ], }, { diff --git a/gyp/opts.gypi b/gyp/opts.gypi index 9aeb7f34b2..530ff58fad 100644 --- a/gyp/opts.gypi +++ b/gyp/opts.gypi @@ -58,8 +58,12 @@ 'avx_sources': [ '<(skia_src_path)/opts/SkOpts_avx.cpp', ], - # These targets are empty, but XCode doesn't like that, so add an empty file to each. + 'hsw_sources': [ + '<(skia_src_path)/opts/SkOpts_hsw.cpp', + ], + + # TODO: clean up after updating Chrome build. 'avx2_sources': [ - '<(skia_src_path)/core/SkForceCPlusPlusLinking.cpp', + '<(skia_src_path)/opts/SkOpts_hsw.cpp', ], } |