diff --git a/common.gypi b/common.gypi index d39668b100d33c..dd4f22a38c5fc6 100644 --- a/common.gypi +++ b/common.gypi @@ -2,6 +2,7 @@ 'variables': { 'configuring_node%': 0, 'asan%': 0, + 'arm_version%': 0, # ARM architecture version (6 or 7) 'werror': '', # Turn off -Werror in V8 build. 'visibility%': 'hidden', # V8's visibility setting 'target_arch%': 'ia32', # set v8's target architecture @@ -268,6 +269,17 @@ 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin 'conditions': [ + [ 'arm_version==7', { + 'target_conditions': [ + ['_toolset=="target"', { + # Any Cortex-A that can run V8 supports at least armv7-a+neon. + 'cflags': [ + '-march=armv7-a', + '-mfpu=neon', # Implies VFPv3. + ], + }], + ], + }], [ 'configuring_node', { 'msvs_configuration_attributes': { 'OutputDirectory': '<(DEPTH)/out/$(Configuration)/', diff --git a/configure.py b/configure.py index 008056de087501..284fabb87029f6 100755 --- a/configure.py +++ b/configure.py @@ -51,8 +51,6 @@ 'android', 'aix', 'cloudabi') valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'mips64el', 'ppc', 'ppc64', 'x32','x64', 'x86', 'x86_64', 's390x') -valid_arm_float_abi = ('soft', 'softfp', 'hard') -valid_arm_fpu = ('vfp', 'vfpv3', 'vfpv3-d16', 'neon') valid_mips_arch = ('loongson', 'r1', 'r2', 'r6', 'rx') valid_mips_fpu = ('fp32', 'fp64', 'fpxx') valid_mips_float_abi = ('soft', 'hard') @@ -382,20 +380,6 @@ dest='v8_options', help='v8 options to pass, see `node --v8-options` for examples.') -parser.add_option('--with-arm-float-abi', - action='store', - dest='arm_float_abi', - choices=valid_arm_float_abi, - help='specifies which floating-point ABI to use ({0}).'.format( - ', '.join(valid_arm_float_abi))) - -parser.add_option('--with-arm-fpu', - action='store', - dest='arm_fpu', - choices=valid_arm_fpu, - help='ARM FPU mode ({0}) [default: %default]'.format( - ', '.join(valid_arm_fpu))) - parser.add_option('--with-mips-arch-variant', action='store', dest='mips_arch_variant', @@ -883,28 +867,6 @@ def cc_macros(cc=None): return k -def is_arch_armv7(): - """Check for ARMv7 instructions""" - cc_macros_cache = cc_macros() - return cc_macros_cache.get('__ARM_ARCH') == '7' - - -def is_arch_armv6(): - """Check for ARMv6 instructions""" - cc_macros_cache = cc_macros() - return cc_macros_cache.get('__ARM_ARCH') == '6' - - -def is_arm_hard_float_abi(): - """Check for hardfloat or softfloat eabi on ARM""" - # GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify - # the Floating Point ABI used (PCS stands for Procedure Call Standard). - # We use these as well as a couple of other defines to statically determine - # what FP ABI used. - - return '__ARM_PCS_VFP' in cc_macros() - - def host_arch_cc(): """Host architecture check using the CC command.""" @@ -957,29 +919,10 @@ def host_arch_win(): def configure_arm(o): - if options.arm_float_abi: - arm_float_abi = options.arm_float_abi - elif is_arm_hard_float_abi(): - arm_float_abi = 'hard' - else: - arm_float_abi = 'default' - - arm_fpu = 'vfp' - - if is_arch_armv7(): - arm_fpu = 'vfpv3' - o['variables']['arm_version'] = '7' - else: - o['variables']['arm_version'] = '6' if is_arch_armv6() else 'default' - - o['variables']['arm_thumb'] = 0 # -marm - o['variables']['arm_float_abi'] = arm_float_abi - - if options.dest_os == 'android': - arm_fpu = 'vfpv3' - o['variables']['arm_version'] = '7' - - o['variables']['arm_fpu'] = options.arm_fpu or arm_fpu + armv7 = options.dest_os == 'android' or cc_macros().get('__ARM_ARCH') == '7' + # ARMv6 is primarily the ARM1176 CPU used in the Broadcom BCM2835 SoC of + # first-gen Raspberry Pis and the Pi Zero. It supports VFP2 but not NEON. + o['variables']['arm_version'] = '7' if armv7 else '6' def configure_mips(o): diff --git a/deps/zlib/zlib.gyp b/deps/zlib/zlib.gyp index c73b9adba902de..44a5912f9ad2fa 100644 --- a/deps/zlib/zlib.gyp +++ b/deps/zlib/zlib.gyp @@ -5,7 +5,6 @@ { 'variables': { 'use_system_zlib%': 0, - 'arm_fpu%': '', 'llvm_version%': '0.0', }, 'conditions': [ @@ -64,7 +63,8 @@ 'USE_FILE32API' ], }], - ['(target_arch in "ia32 x64 x32" and OS!="ios") or arm_fpu=="neon"', { + ['(target_arch in "arm64 ia32 x64 x32" and OS!="ios") or ' + 'arm_version==7', { 'sources': [ 'adler32_simd.c', 'adler32_simd.h', @@ -112,7 +112,18 @@ }, { 'sources': [ 'simd_stub.c', ], }], - ['arm_fpu=="neon"', { + ['arm_version==7', { + 'defines': [ + 'ADLER32_SIMD_NEON', + 'INFLATE_CHUNK_SIMD_NEON', + ], + 'sources': [ + 'contrib/optimizations/slide_hash_neon.h', + 'crc32_simd.c', + 'crc32_simd.h', + ], + }], + ['target_arch=="arm64"', { 'defines': [ 'ADLER32_SIMD_NEON', 'INFLATE_CHUNK_SIMD_NEON', @@ -136,7 +147,7 @@ ['OS=="linux"', { 'defines': [ 'ARMV8_OS_LINUX' ], }], - ['OS="win"', { + ['OS=="win"', { 'defines': [ 'ARMV8_OS_WINDOWS' ], }], ['OS!="android" and OS!="win" and llvm_version=="0.0"', { diff --git a/tools/v8_gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi index 10709fab1fbc0c..482604d7b4450e 100644 --- a/tools/v8_gypfiles/toolchain.gypi +++ b/tools/v8_gypfiles/toolchain.gypi @@ -176,27 +176,13 @@ 'V8_TARGET_ARCH_ARM', ], 'conditions': [ - [ 'arm_version==7 or arm_version=="default"', { + # ARMv7 supports NEON+VFP3, ARMv6 only supports VFP2. + [ 'arm_version==7', { 'defines': [ 'CAN_USE_ARMV7_INSTRUCTIONS', - ], - }], - [ 'arm_fpu=="vfpv3-d16" or arm_fpu=="default"', { - 'defines': [ - 'CAN_USE_VFP3_INSTRUCTIONS', - ], - }], - [ 'arm_fpu=="vfpv3"', { - 'defines': [ - 'CAN_USE_VFP3_INSTRUCTIONS', + 'CAN_USE_NEON', 'CAN_USE_VFP32DREGS', - ], - }], - [ 'arm_fpu=="neon"', { - 'defines': [ 'CAN_USE_VFP3_INSTRUCTIONS', - 'CAN_USE_VFP32DREGS', - 'CAN_USE_NEON', ], }], [ 'arm_test_noprobe=="on"', { @@ -205,94 +191,6 @@ ], }], ], - 'target_conditions': [ - ['_toolset=="host"', { - 'conditions': [ - ['v8_target_arch==host_arch', { - # Host built with an Arm CXX compiler. - 'conditions': [ - [ 'arm_version==7', { - 'cflags': ['-march=armv7-a',], - }], - [ 'arm_version==7 or arm_version=="default"', { - 'conditions': [ - [ 'arm_fpu!="default"', { - 'cflags': ['-mfpu=<(arm_fpu)',], - }], - ], - }], - [ 'arm_float_abi!="default"', { - 'cflags': ['-mfloat-abi=<(arm_float_abi)',], - }], - [ 'arm_thumb==1', { - 'cflags': ['-mthumb',], - }], - [ 'arm_thumb==0', { - 'cflags': ['-marm',], - }], - ], - }, { - # 'v8_target_arch!=host_arch' - # Host not built with an Arm CXX compiler (simulator build). - 'conditions': [ - [ 'arm_float_abi=="hard"', { - 'defines': [ - 'USE_EABI_HARDFLOAT=1', - ], - }], - [ 'arm_float_abi=="softfp" or arm_float_abi=="default"', { - 'defines': [ - 'USE_EABI_HARDFLOAT=0', - ], - }], - ], - }], - ], - }], # _toolset=="host" - ['_toolset=="target"', { - 'conditions': [ - ['v8_target_arch==target_arch', { - # Target built with an Arm CXX compiler. - 'conditions': [ - [ 'arm_version==7', { - 'cflags': ['-march=armv7-a',], - }], - [ 'arm_version==7 or arm_version=="default"', { - 'conditions': [ - [ 'arm_fpu!="default"', { - 'cflags': ['-mfpu=<(arm_fpu)',], - }], - ], - }], - [ 'arm_float_abi!="default"', { - 'cflags': ['-mfloat-abi=<(arm_float_abi)',], - }], - [ 'arm_thumb==1', { - 'cflags': ['-mthumb',], - }], - [ 'arm_thumb==0', { - 'cflags': ['-marm',], - }], - ], - }, { - # 'v8_target_arch!=target_arch' - # Target not built with an Arm CXX compiler (simulator build). - 'conditions': [ - [ 'arm_float_abi=="hard"', { - 'defines': [ - 'USE_EABI_HARDFLOAT=1', - ], - }], - [ 'arm_float_abi=="softfp" or arm_float_abi=="default"', { - 'defines': [ - 'USE_EABI_HARDFLOAT=0', - ], - }], - ], - }], - ], - }], # _toolset=="target" - ], }], # v8_target_arch=="arm" ['v8_target_arch=="arm64"', { 'defines': [