diff options
author | 2015-03-26 05:30:44 -0700 | |
---|---|---|
committer | 2015-03-26 05:30:44 -0700 | |
commit | dee3df930b83751577d5a3489d402c0c9e284495 (patch) | |
tree | af780a041b4ef1af8b969941246a21ce13dfd3d2 /gyp | |
parent | ce866873102e70421d9e532f19cf56905482054e (diff) |
Add a go-fast button to Skia GYP configs.
./gyp_skia -Dskia_fast=1 will
- always optimize for the current machine as much as possible
- drop the frame pointer
- optimize floating point arithmetic ignoring IEEE compliance
This allows things like 3-argument VEX prefix SSE instructions and
NEON autovectorization, and can give some seriously helpful clues
about how to rearrange floating point math for speed.
I've been having trouble with LTO linking, so I'll leave that out for now.
I don't think we should set up bots with this mode. -ffast-math means
I'm forced to run DM with --match ~Blend ~Path ~Rect ~Math ~Scalar
~Matrix ~Point before it passes, which is a disconcerting chunk of tests
to disable (including all of PathOps).
BUG=skia:
Review URL: https://codereview.chromium.org/1036533003
Diffstat (limited to 'gyp')
-rw-r--r-- | gyp/common_conditions.gypi | 3 | ||||
-rw-r--r-- | gyp/common_variables.gypi | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi index b9a9296ba4..a38c92d6bd 100644 --- a/gyp/common_conditions.gypi +++ b/gyp/common_conditions.gypi @@ -2,6 +2,7 @@ # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. + # conditions used in both common.gypi and skia.gyp in chromium # { @@ -229,6 +230,7 @@ '-Wno-invalid-offsetof', # GCC <4.6 is old-school strict about what is POD. ], 'conditions': [ + [ 'skia_fast', { 'cflags': [ '<@(skia_fast_flags)' ] }], [ 'skia_os != "chromeos"', { 'conditions': [ [ 'skia_arch_type == "x86_64" and not skia_android_framework', { @@ -529,6 +531,7 @@ }, 'xcode_settings': { 'conditions': [ + [ 'skia_fast', { 'WARNING_CFLAGS': [ '<@(skia_fast_flags)' ] } ], [ 'skia_warnings_as_errors', { 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES' }], [ 'skia_arch_width == 32', { 'ARCHS': ['i386'] }], [ 'skia_arch_width == 64', { 'ARCHS': ['x86_64'] }], diff --git a/gyp/common_variables.gypi b/gyp/common_variables.gypi index 60dcccc1a9..1031b52a1d 100644 --- a/gyp/common_variables.gypi +++ b/gyp/common_variables.gypi @@ -239,6 +239,14 @@ 'skia_moz2d%': 0, 'skia_is_bot%': '<!(python -c "import os; print os.environ.get(\'CHROME_HEADLESS\', 0)")', 'skia_egl%': '<(skia_egl)', + 'skia_fast%': 0, + 'skia_fast_flags': [ + '-O3', # Even for Debug builds. + '-march=native', # Use all features of and optimize for THIS machine. + '-fomit-frame-pointer', # Sometimes an extra register is nice, and cuts a push/pop. + '-ffast-math', # Optimize float math even when it breaks IEEE compliance. + #'-flto' # Enable link-time optimization. + ], # These are referenced by our .gypi files that list files (e.g. core.gypi) # |