From 2bdd088cde0f77a9deed580c5c102faa05297ed1 Mon Sep 17 00:00:00 2001 From: "m.m.capewell@googlemail.com" Date: Mon, 12 May 2014 09:25:32 +0000 Subject: [PATCH] ARM: update defaults for flags R=bmeurer@chromium.org, ulan@chromium.org BUG= Review URL: https://codereview.chromium.org/264593002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21258 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- Makefile | 13 +------------ build/standalone.gypi | 1 - build/toolchain.gypi | 50 +++++++++++++++++++++++++++++------------------- src/arm/assembler-arm.cc | 44 ++++++++++++++++++++---------------------- src/flag-definitions.h | 7 ++++++- 5 files changed, 58 insertions(+), 57 deletions(-) diff --git a/Makefile b/Makefile index a99b09c..caa9f08 100644 --- a/Makefile +++ b/Makefile @@ -156,11 +156,6 @@ ifeq ($(armv7), true) endif endif endif -# vfp2=off. Deprecated, use armfpu= -# vfp3=off. Deprecated, use armfpu= -ifeq ($(vfp3), off) - GYPFLAGS += -Darm_fpu=vfp -endif # hardfp=on/off. Deprecated, use armfloatabi ifeq ($(hardfp),on) GYPFLAGS += -Darm_float_abi=hard @@ -169,16 +164,10 @@ ifeq ($(hardfp),off) GYPFLAGS += -Darm_float_abi=softfp endif endif -# armneon=on/off -ifeq ($(armneon), on) - GYPFLAGS += -Darm_neon=1 -endif # fpu: armfpu=xxx # xxx: vfp, vfpv3-d16, vfpv3, neon. ifeq ($(armfpu),) -ifneq ($(vfp3), off) GYPFLAGS += -Darm_fpu=default -endif else GYPFLAGS += -Darm_fpu=$(armfpu) endif @@ -201,7 +190,7 @@ endif # armtest=on # With this flag set, by default v8 will only use features implied # by the compiler (no probe). This is done by modifying the default -# values of enable_armv7, enable_vfp2, enable_vfp3 and enable_32dregs. +# values of enable_armv7, enable_vfp3, enable_32dregs and enable_neon. # Modifying these flags when launching v8 will enable the probing for # the specified values. # When using the simulator, this flag is implied. diff --git a/build/standalone.gypi b/build/standalone.gypi index befa738..f774fac 100644 --- a/build/standalone.gypi +++ b/build/standalone.gypi @@ -124,7 +124,6 @@ ], # Default ARM variable settings. 'arm_version%': 'default', - 'arm_neon%': 0, 'arm_fpu%': 'vfpv3', 'arm_float_abi%': 'default', 'arm_thumb': 'default', diff --git a/build/toolchain.gypi b/build/toolchain.gypi index a9958ce..3182501 100644 --- a/build/toolchain.gypi +++ b/build/toolchain.gypi @@ -102,15 +102,8 @@ }], [ 'arm_version==7 or arm_version=="default"', { 'conditions': [ - [ 'arm_neon==1', { - 'cflags': ['-mfpu=neon',], - }, - { - 'conditions': [ - [ 'arm_fpu!="default"', { - 'cflags': ['-mfpu=<(arm_fpu)',], - }], - ], + [ 'arm_fpu!="default"', { + 'cflags': ['-mfpu=<(arm_fpu)',], }], ], }], @@ -153,10 +146,11 @@ 'CAN_USE_VFP32DREGS', ], }], - [ 'arm_fpu=="neon" or arm_neon==1', { + [ 'arm_fpu=="neon"', { 'defines': [ 'CAN_USE_VFP3_INSTRUCTIONS', 'CAN_USE_VFP32DREGS', + 'CAN_USE_NEON', ], }], ], @@ -190,15 +184,8 @@ }], [ 'arm_version==7 or arm_version=="default"', { 'conditions': [ - [ 'arm_neon==1', { - 'cflags': ['-mfpu=neon',], - }, - { - 'conditions': [ - [ 'arm_fpu!="default"', { - 'cflags': ['-mfpu=<(arm_fpu)',], - }], - ], + [ 'arm_fpu!="default"', { + 'cflags': ['-mfpu=<(arm_fpu)',], }], ], }], @@ -215,6 +202,26 @@ 'defines': [ 'ARM_TEST', ], + 'conditions': [ + [ 'arm_fpu=="vfpv3-d16"', { + 'defines': [ + 'CAN_USE_VFP3_INSTRUCTIONS', + ], + }], + [ 'arm_fpu=="vfpv3"', { + 'defines': [ + 'CAN_USE_VFP3_INSTRUCTIONS', + 'CAN_USE_VFP32DREGS', + ], + }], + [ 'arm_fpu=="neon"', { + 'defines': [ + 'CAN_USE_VFP3_INSTRUCTIONS', + 'CAN_USE_VFP32DREGS', + 'CAN_USE_NEON', + ], + }], + ], }], ], }, { @@ -228,6 +235,8 @@ [ 'arm_fpu=="default"', { 'defines': [ 'CAN_USE_VFP3_INSTRUCTIONS', + 'CAN_USE_VFP32DREGS', + 'CAN_USE_NEON', ], }], [ 'arm_fpu=="vfpv3-d16"', { @@ -241,10 +250,11 @@ 'CAN_USE_VFP32DREGS', ], }], - [ 'arm_fpu=="neon" or arm_neon==1', { + [ 'arm_fpu=="neon"', { 'defines': [ 'CAN_USE_VFP3_INSTRUCTIONS', 'CAN_USE_VFP32DREGS', + 'CAN_USE_NEON', ], }], ], diff --git a/src/arm/assembler-arm.cc b/src/arm/assembler-arm.cc index 74fd619..c975376 100644 --- a/src/arm/assembler-arm.cc +++ b/src/arm/assembler-arm.cc @@ -81,6 +81,11 @@ static unsigned CpuFeaturesImpliedByCompiler() { answer |= 1u << VFP32DREGS; } #endif // CAN_USE_VFP32DREGS +#ifdef CAN_USE_NEON + if (FLAG_enable_neon) { + answer |= 1u << NEON; + } +#endif // CAN_USE_VFP32DREGS if ((answer & (1u << ARMv7)) && FLAG_enable_unaligned_accesses) { answer |= 1u << UNALIGNED_ACCESSES; } @@ -120,33 +125,26 @@ void CpuFeatures::Probe(bool serializer_enabled) { } #ifndef __arm__ - // For the simulator=arm build, use VFP when FLAG_enable_vfp3 is - // enabled. VFPv3 implies ARMv7, see ARM DDI 0406B, page A1-6. - if (FLAG_enable_vfp3) { - supported_ |= - static_cast(1) << VFP3 | - static_cast(1) << ARMv7; - } - if (FLAG_enable_neon) { - supported_ |= 1u << NEON; - } // For the simulator=arm build, use ARMv7 when FLAG_enable_armv7 is enabled if (FLAG_enable_armv7) { supported_ |= static_cast(1) << ARMv7; + if (FLAG_enable_vfp3) { + supported_ |= static_cast(1) << VFP3; + } + if (FLAG_enable_neon) { + supported_ |= 1u << NEON; + supported_ |= static_cast(1) << VFP32DREGS; + } + if (FLAG_enable_sudiv) { + supported_ |= static_cast(1) << SUDIV; + } + if (FLAG_enable_movw_movt) { + supported_ |= static_cast(1) << MOVW_MOVT_IMMEDIATE_LOADS; + } + if (FLAG_enable_32dregs) { + supported_ |= static_cast(1) << VFP32DREGS; + } } - - if (FLAG_enable_sudiv) { - supported_ |= static_cast(1) << SUDIV; - } - - if (FLAG_enable_movw_movt) { - supported_ |= static_cast(1) << MOVW_MOVT_IMMEDIATE_LOADS; - } - - if (FLAG_enable_32dregs) { - supported_ |= static_cast(1) << VFP32DREGS; - } - if (FLAG_enable_unaligned_accesses) { supported_ |= static_cast(1) << UNALIGNED_ACCESSES; } diff --git a/src/flag-definitions.h b/src/flag-definitions.h index 189d5b6..f95e5d9 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -120,6 +120,11 @@ struct MaybeBoolFlag { #else # define ENABLE_32DREGS_DEFAULT false #endif +#if (defined CAN_USE_NEON) || !(defined ARM_TEST) +# define ENABLE_NEON_DEFAULT true +#else +# define ENABLE_NEON_DEFAULT false +#endif #define DEFINE_bool(nam, def, cmt) FLAG(BOOL, bool, nam, def, cmt) #define DEFINE_maybe_bool(nam, cmt) FLAG(MAYBE_BOOL, MaybeBoolFlag, nam, \ @@ -362,7 +367,7 @@ DEFINE_bool(enable_vfp3, ENABLE_VFP3_DEFAULT, "enable use of VFP3 instructions if available") DEFINE_bool(enable_armv7, ENABLE_ARMV7_DEFAULT, "enable use of ARMv7 instructions if available (ARM only)") -DEFINE_bool(enable_neon, true, +DEFINE_bool(enable_neon, ENABLE_NEON_DEFAULT, "enable use of NEON instructions if available (ARM only)") DEFINE_bool(enable_sudiv, true, "enable use of SDIV and UDIV instructions if available (ARM only)") -- 2.7.4