Enable x86 optimizations for zlib

These were intended to be enabled previously, but GYP uses “ia32” and
“x64” for x86 and x86_64, and zlib.gyp erroneously used “x86” and
“amd64” instead.

In order to make this work, gcc and clang need -mpclmul to enable the
pclmul extension used by crc_folding.c. The optimized code will only be
used if, at runtime, SSE2, SSE4.2, and PCLMULQDQ support is detected.

Change-Id: Ic709cd2a6c38892083c44c4004573a64b3581eb5
Reviewed-on: https://chromium-review.googlesource.com/553337
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Mark Mentovai 2017-06-28 15:57:45 -04:00 committed by Commit Bot
parent 6823f67830
commit 3d6f7bcf90

View File

@ -103,10 +103,20 @@
'zlib_crashpad.h',
],
'conditions': [
['target_arch=="x86" or target_arch=="amd64"', {
['target_arch=="ia32" or target_arch=="x64"', {
'sources!': [
'zlib/simd_stub.c',
],
'cflags': [
'-msse4.2',
'-mpclmul',
],
'xcode_settings': {
'OTHER_CFLAGS': [
'-msse4.2',
'-mpclmul',
],
},
}, {
'sources!': [
'zlib/crc_folding.c',