Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: src/flag-definitions.h

Issue 2223433002: [arm] Simplify run-time CPU selection. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index 585e839d4d496293e7f900ae532483f2a84ee799..b082b39b107070e06706ef0360eac9c1cd269cdf 100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -119,31 +119,32 @@ struct MaybeBoolFlag {
#else
#define DEBUG_BOOL false
#endif
-#if (defined CAN_USE_VFP3_INSTRUCTIONS) || !(defined ARM_TEST_NO_FEATURE_PROBE)
-#define ENABLE_VFP3_DEFAULT true
+
+// Supported ARM configurations are:
+// "armv6": ARMv6 + VFPv2
+// "armv7": ARMv7 + VFPv3-D32 + NEON
+// "armv7+sudiv": ARMv7 + VFPv4-D32 + NEON + SUDIV
+// "armv8": ARMv8 (including all of the above)
+#if !defined(ARM_TEST_NO_FEATURE_PROBE) || \
Michael Achenbach 2016/08/12 10:16:37 Why is only the first case checking for ARM_TEST_N
+ (defined(CAN_USE_ARMV8_INSTRUCTIONS) && \
+ defined(CAN_USE_ARMV7_INSTRUCTIONS) && \
+ defined(CAN_USE_SUDIV) && \
+ defined(CAN_USE_NEON) && \
+ defined(CAN_USE_VFP3_INSTRUCTIONS))
+# define ARM_ARCH_DEFAULT "armv8"
+#elif defined(CAN_USE_ARMV7_INSTRUCTIONS) && \
+ defined(CAN_USE_SUDIV) && \
+ defined(CAN_USE_NEON) && \
+ defined(CAN_USE_VFP3_INSTRUCTIONS)
+# define ARM_ARCH_DEFAULT "armv7+sudiv"
+#elif defined(CAN_USE_ARMV7_INSTRUCTIONS) && \
+ defined(CAN_USE_NEON) && \
+ defined(CAN_USE_VFP3_INSTRUCTIONS)
+# define ARM_ARCH_DEFAULT "armv7"
#else
-#define ENABLE_VFP3_DEFAULT false
-#endif
-#if (defined CAN_USE_ARMV7_INSTRUCTIONS) || !(defined ARM_TEST_NO_FEATURE_PROBE)
-#define ENABLE_ARMV7_DEFAULT true
-#else
-#define ENABLE_ARMV7_DEFAULT false
-#endif
-#if (defined CAN_USE_ARMV8_INSTRUCTIONS) || !(defined ARM_TEST_NO_FEATURE_PROBE)
-#define ENABLE_ARMV8_DEFAULT true
-#else
-#define ENABLE_ARMV8_DEFAULT false
-#endif
-#if (defined CAN_USE_VFP32DREGS) || !(defined ARM_TEST_NO_FEATURE_PROBE)
-#define ENABLE_32DREGS_DEFAULT true
-#else
-#define ENABLE_32DREGS_DEFAULT false
-#endif
-#if (defined CAN_USE_NEON) || !(defined ARM_TEST_NO_FEATURE_PROBE)
-# define ENABLE_NEON_DEFAULT true
-#else
-# define ENABLE_NEON_DEFAULT false
+# define ARM_ARCH_DEFAULT "armv6"
Michael Achenbach 2016/08/12 10:16:37 Suggestion: Maybe better raise an error for incorr
#endif
+
#ifdef V8_OS_WIN
# define ENABLE_LOG_COLOUR false
#else
@@ -558,21 +559,12 @@ DEFINE_BOOL(enable_bmi2, true, "enable use of BMI2 instructions if available")
DEFINE_BOOL(enable_lzcnt, true, "enable use of LZCNT instruction if available")
DEFINE_BOOL(enable_popcnt, true,
"enable use of POPCNT instruction if available")
-DEFINE_BOOL(enable_vfp3, ENABLE_VFP3_DEFAULT,
Michael Achenbach 2016/08/05 13:17:12 If we pass this flag, will d8 fail or just warn?
Michael Achenbach 2016/08/12 10:16:37 Clarification: Warning is desired so that we can m
- "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_armv8, ENABLE_ARMV8_DEFAULT,
- "enable use of ARMv8 instructions if available (ARM 32-bit only)")
-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)")
+DEFINE_STRING(arm_arch, ARM_ARCH_DEFAULT,
+ "generate instructions for the selected ARM architecture if "
+ "available: armv6, armv7, armv7+sudiv or armv8")
DEFINE_BOOL(enable_movw_movt, false,
- "enable loading 32-bit constant by means of movw/movt "
- "instruction pairs (ARM only)")
-DEFINE_BOOL(enable_32dregs, ENABLE_32DREGS_DEFAULT,
- "enable use of d16-d31 registers on ARM - this requires VFP3")
+ "prefer to load 32-bit constants using movw/movt instruction pairs "
+ "(ARM only)")
DEFINE_BOOL(enable_vldr_imm, false,
"enable use of constant pools for double immediate (ARM only)")
DEFINE_BOOL(force_long_branches, false,
@@ -583,11 +575,6 @@ DEFINE_STRING(mcpu, "auto", "enable optimization for specific cpu")
DEFINE_BOOL(enable_regexp_unaligned_accesses, true,
"enable unaligned accesses for the regexp engine")
-DEFINE_IMPLICATION(enable_armv8, enable_vfp3)
-DEFINE_IMPLICATION(enable_armv8, enable_neon)
-DEFINE_IMPLICATION(enable_armv8, enable_32dregs)
-DEFINE_IMPLICATION(enable_armv8, enable_sudiv)
-
// bootstrapper.cc
DEFINE_STRING(expose_natives_as, NULL, "expose natives in global object")
DEFINE_STRING(expose_debug_as, NULL, "expose debug in global object")
« src/arm/assembler-arm.cc ('K') | « src/base/build_config.h ('k') | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698