diff options
author | robert.bradford <robert.bradford@intel.com> | 2014-11-13 13:39:00 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-13 21:39:38 +0000 |
commit | 01686c1a7b233fcb8ab16b41ad3ffe58aef09cd1 (patch) | |
tree | 961c79cdea4a97b2993fb1f25513baf96d8bf109 /third_party/zlib | |
parent | 280a73d72981999b53035462d99dc5f31f1dc2ee (diff) | |
download | chromium_src-01686c1a7b233fcb8ab16b41ad3ffe58aef09cd1.zip chromium_src-01686c1a7b233fcb8ab16b41ad3ffe58aef09cd1.tar.gz chromium_src-01686c1a7b233fcb8ab16b41ad3ffe58aef09cd1.tar.bz2 |
Enable zlib SIMD optimisations on Mac OS X builds
With ninja builds generated from gyp on a Mac it is necessary to specify the
cflags to use as EXTRA_CFLAGS in an xcode_settings block in the gyp file. With
gn this is not necessary and led to confusion resulting in Mac builds not being
enabled in the original CL. As all Intel based Mac systems have SSE2 the
compiler does not require "-msse2" as it can always use that.
This change also initialised the global variables, as a result the variable is
moved from being a common symbol to being in the BSS section of the library.
This is necessary as unfortunately the linker on Mac cannot handle common
symbols with static libraries.
blink layout test inspector/layers/layer-canvas-log.html may start failing on
Mac with this change (See BUG below)
TEST=Build on Mac OS X and net_unittests --gtest_filter=*Compressed* run and
uses optimised code paths
BUG=430557
Review URL: https://codereview.chromium.org/705053002
Cr-Commit-Position: refs/heads/master@{#304089}
Diffstat (limited to 'third_party/zlib')
-rw-r--r-- | third_party/zlib/simd_stub.c | 2 | ||||
-rw-r--r-- | third_party/zlib/x86.c | 2 | ||||
-rw-r--r-- | third_party/zlib/zlib.gyp | 8 |
3 files changed, 7 insertions, 5 deletions
diff --git a/third_party/zlib/simd_stub.c b/third_party/zlib/simd_stub.c index bb2ddc3..796f1f6 100644 --- a/third_party/zlib/simd_stub.c +++ b/third_party/zlib/simd_stub.c @@ -7,7 +7,7 @@ #include "deflate.h" #include "x86.h" -int x86_cpu_enable_simd; +int x86_cpu_enable_simd = 0; void ZLIB_INTERNAL crc_fold_init(deflate_state *const s) { assert(0); diff --git a/third_party/zlib/x86.c b/third_party/zlib/x86.c index 35ec516..0649306 100644 --- a/third_party/zlib/x86.c +++ b/third_party/zlib/x86.c @@ -10,7 +10,7 @@ #include "x86.h" -int x86_cpu_enable_simd; +int x86_cpu_enable_simd = 0; #ifndef _MSC_VER #include <pthread.h> diff --git a/third_party/zlib/zlib.gyp b/third_party/zlib/zlib.gyp index 8c5ae44..22a48a3 100644 --- a/third_party/zlib/zlib.gyp +++ b/third_party/zlib/zlib.gyp @@ -8,9 +8,11 @@ 'target_name' : 'zlib_x86_simd', 'type': 'static_library', 'conditions': [ - # See http://crbug.com/420616 gyp on mac & ios doesn't apply cflags - ['OS!="ios" and OS!="mac" and (target_arch=="ia32" or target_arch=="x64")', { + ['OS!="ios" and (target_arch=="ia32" or target_arch=="x64")', { 'cflags' : ["-msse2", "-msse4.2", "-mpclmul"], + 'xcode_settings' : { + 'OTHER_CFLAGS' : ["-msse4.2", "-mpclmul"], + }, 'sources' : [ 'crc_folding.c', 'fill_window_sse.c'] }, { @@ -65,7 +67,7 @@ ], }, 'conditions': [ - ['OS!="ios" and OS!="mac" and (target_arch=="ia32" or target_arch=="x64")', { + ['OS!="ios" and (target_arch=="ia32" or target_arch=="x64")', { 'sources' : [ 'x86.c', ], }], ['OS!="win"', { |