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
This commit is contained in:
mtklein 2015-03-26 05:30:44 -07:00 committed by Commit bot
parent ce86687310
commit dee3df930b
2 changed files with 11 additions and 0 deletions

View File

@ -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'] }],

View File

@ -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)
#