Index: src/arm/assembler-arm.cc |
=================================================================== |
--- src/arm/assembler-arm.cc (revision 4215) |
+++ src/arm/assembler-arm.cc (working copy) |
@@ -47,21 +47,41 @@ |
unsigned CpuFeatures::enabled_ = 0; |
unsigned CpuFeatures::found_by_runtime_probing_ = 0; |
+ |
+#ifdef __arm__ |
+static uint64_t CpuFeaturesImpliedByCompiler() { |
+ uint64_t answer = 0; |
+#ifdef CAN_USE_ARMV7_INSTRUCTIONS |
+ answer |= 1u << ARMv7; |
+#endif // def CAN_USE_ARMV7_INSTRUCTIONS |
+ // If the compiler is allowed to use VFP then we can use VFP too in our code |
+ // generation even when generating snapshots. This won't work for cross |
+ // compilation. |
+#if defined(__VFP_FP__) && !defined(__SOFTFP__) |
+ answer |= 1u << VFP3; |
+#endif // defined(__VFP_FP__) && !defined(__SOFTFP__) |
+#ifdef CAN_USE_VFP_INSTRUCTIONS |
+ answer |= 1u << VFP3; |
+#endif // def CAN_USE_VFP_INSTRUCTIONS |
+ return answer; |
+} |
+#endif // def __arm__ |
+ |
+ |
void CpuFeatures::Probe() { |
- // If the compiler is allowed to use vfp then we can use vfp too in our |
- // code generation. |
-#if !defined(__arm__) |
+#ifndef __arm__ |
// For the simulator=arm build, use VFP when FLAG_enable_vfp3 is enabled. |
if (FLAG_enable_vfp3) { |
- supported_ |= 1u << VFP3; |
+ supported_ |= 1u << VFP3; |
} |
// For the simulator=arm build, use ARMv7 when FLAG_enable_armv7 is enabled |
if (FLAG_enable_armv7) { |
- supported_ |= 1u << ARMv7; |
+ supported_ |= 1u << ARMv7; |
} |
-#else |
+#else // def __arm__ |
if (Serializer::enabled()) { |
supported_ |= OS::CpuFeaturesImpliedByPlatform(); |
+ supported_ |= CpuFeaturesImpliedByCompiler(); |
return; // No features if we might serialize. |
} |
@@ -532,7 +552,7 @@ |
if (!Serializer::enabled()) { |
Serializer::TooLateToEnableNow(); |
} |
-#endif |
+#endif // def DEBUG |
return Serializer::enabled(); |
} else if (rmode == RelocInfo::NONE) { |
return false; |
@@ -1137,14 +1157,16 @@ |
// Exception-generating instructions and debugging support. |
void Assembler::stop(const char* msg) { |
-#if !defined(__arm__) |
+#ifndef __arm__ |
// The simulator handles these special instructions and stops execution. |
emit(15 << 28 | ((intptr_t) msg)); |
-#else |
- // Just issue a simple break instruction for now. Alternatively we could use |
- // the swi(0x9f0001) instruction on Linux. |
+#else // def __arm__ |
+#ifdef CAN_USE_ARMV5_INSTRUCTIONS |
bkpt(0); |
-#endif |
+#else // ndef CAN_USE_ARMV5_INSTRUCTIONS |
+ swi(0x9f0001); |
+#endif // ndef CAN_USE_ARMV5_INSTRUCTIONS |
+#endif // def __arm__ |
} |