ARM: update defaults for flags
authorm.m.capewell@googlemail.com <m.m.capewell@googlemail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 12 May 2014 09:25:32 +0000 (09:25 +0000)
committerm.m.capewell@googlemail.com <m.m.capewell@googlemail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 12 May 2014 09:25:32 +0000 (09:25 +0000)
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
build/standalone.gypi
build/toolchain.gypi
src/arm/assembler-arm.cc
src/flag-definitions.h

index a99b09c..caa9f08 100644 (file)
--- 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.
index befa738..f774fac 100644 (file)
     ],
     # Default ARM variable settings.
     'arm_version%': 'default',
-    'arm_neon%': 0,
     'arm_fpu%': 'vfpv3',
     'arm_float_abi%': 'default',
     'arm_thumb': 'default',
index a9958ce..3182501 100644 (file)
                   }],
                   [ '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)',],
                       }],
                     ],
                   }],
                           'CAN_USE_VFP32DREGS',
                         ],
                       }],
-                      [ 'arm_fpu=="neon" or arm_neon==1', {
+                      [ 'arm_fpu=="neon"', {
                         'defines': [
                           'CAN_USE_VFP3_INSTRUCTIONS',
                           'CAN_USE_VFP32DREGS',
+                          'CAN_USE_NEON',
                         ],
                       }],
                     ],
                   }],
                   [ '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)',],
                       }],
                     ],
                   }],
                     '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',
+                        ],
+                      }],
+                    ],
                   }],
                 ],
               }, {
                       [ 'arm_fpu=="default"', {
                         'defines': [
                           'CAN_USE_VFP3_INSTRUCTIONS',
+                          'CAN_USE_VFP32DREGS',
+                          'CAN_USE_NEON',
                         ],
                       }],
                       [ 'arm_fpu=="vfpv3-d16"', {
                           'CAN_USE_VFP32DREGS',
                         ],
                       }],
-                      [ 'arm_fpu=="neon" or arm_neon==1', {
+                      [ 'arm_fpu=="neon"', {
                         'defines': [
                           'CAN_USE_VFP3_INSTRUCTIONS',
                           'CAN_USE_VFP32DREGS',
+                          'CAN_USE_NEON',
                         ],
                       }],
                     ],
index 74fd619..c975376 100644 (file)
@@ -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<uint64_t>(1) << VFP3 |
-        static_cast<uint64_t>(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<uint64_t>(1) << ARMv7;
+    if (FLAG_enable_vfp3) {
+      supported_ |= static_cast<uint64_t>(1) << VFP3;
+    }
+    if (FLAG_enable_neon) {
+      supported_ |= 1u << NEON;
+      supported_ |= static_cast<uint64_t>(1) << VFP32DREGS;
+    }
+    if (FLAG_enable_sudiv) {
+      supported_ |= static_cast<uint64_t>(1) << SUDIV;
+    }
+    if (FLAG_enable_movw_movt) {
+      supported_ |= static_cast<uint64_t>(1) << MOVW_MOVT_IMMEDIATE_LOADS;
+    }
+    if (FLAG_enable_32dregs) {
+      supported_ |= static_cast<uint64_t>(1) << VFP32DREGS;
+    }
   }
-
-  if (FLAG_enable_sudiv) {
-    supported_ |= static_cast<uint64_t>(1) << SUDIV;
-  }
-
-  if (FLAG_enable_movw_movt) {
-    supported_ |= static_cast<uint64_t>(1) << MOVW_MOVT_IMMEDIATE_LOADS;
-  }
-
-  if (FLAG_enable_32dregs) {
-    supported_ |= static_cast<uint64_t>(1) << VFP32DREGS;
-  }
-
   if (FLAG_enable_unaligned_accesses) {
     supported_ |= static_cast<uint64_t>(1) << UNALIGNED_ACCESSES;
   }
index 189d5b6..f95e5d9 100644 (file)
@@ -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)")