Chromium Code Reviews| Index: src/arm/assembler-arm.cc |
| =================================================================== |
| --- src/arm/assembler-arm.cc (revision 3946) |
| +++ src/arm/assembler-arm.cc (working copy) |
| @@ -47,9 +47,28 @@ |
| unsigned CpuFeatures::enabled_ = 0; |
| unsigned CpuFeatures::found_by_runtime_probing_ = 0; |
| + |
| +#ifdef __arm__ |
|
Søren Thygesen Gjesse
2010/02/25 11:25:58
Please add comment
// NAME_OF_DEFINE
to all #e
|
| +static uint64_t CpuFeaturesImpliedByCompiler() { |
| + uint64_t answer = 0; |
| +#ifdef CAN_USE_ARMV7_INSTRUCTIONS |
| + answer |= 1u << ARMv7; |
| +#endif |
| + // 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 |
| +#ifdef CAN_USE_VFP_INSTRUCTIONS |
| + answer |= 1u << VFP3; |
| +#endif |
| + return answer; |
| +} |
| +#endif |
| + |
| + |
| void CpuFeatures::Probe() { |
| - // If the compiler is allowed to use vfp then we can use vfp too in our |
| - // code generation. |
| #if !defined(__arm__) |
|
Søren Thygesen Gjesse
2010/02/25 11:25:58
#ifndef for consistency? Maybe turn it around to b
|
| // For the simulator=arm build, use VFP when FLAG_enable_vfp3 is enabled. |
| if (FLAG_enable_vfp3) { |
| @@ -62,6 +81,7 @@ |
| #else |
| if (Serializer::enabled()) { |
| supported_ |= OS::CpuFeaturesImpliedByPlatform(); |
| + supported_ |= CpuFeaturesImpliedByCompiler(); |
| return; // No features if we might serialize. |
| } |
| @@ -1229,10 +1249,12 @@ |
| // 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. |
| +#ifdef CAN_USE_ARMV5_INSTRUCTIONS |
| bkpt(0); |
| +#else |
| + swi(0x9f0001); |
| #endif |
| +#endif |
| } |