Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/cpuinfo.h" | 10 #include "vm/cpuinfo.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 CpuInfo::FieldContains(kCpuInfoModel, "ARMv7")); | 158 CpuInfo::FieldContains(kCpuInfoModel, "ARMv7")); |
| 159 arm_version_ = ARMv7; | 159 arm_version_ = ARMv7; |
| 160 } | 160 } |
| 161 | 161 |
| 162 // Has floating point unit. | 162 // Has floating point unit. |
| 163 vfp_supported_ = | 163 vfp_supported_ = |
| 164 (CpuInfo::FieldContains(kCpuInfoFeatures, "vfp") || is_arm64) && | 164 (CpuInfo::FieldContains(kCpuInfoFeatures, "vfp") || is_arm64) && |
| 165 FLAG_use_vfp; | 165 FLAG_use_vfp; |
| 166 | 166 |
| 167 // Has integer division. | 167 // Has integer division. |
| 168 // Special cases: | |
| 169 // - Qualcomm Krait CPUs (QCT APQ8064) in Nexus 4 and 7 incorrectly report | |
| 170 // that they lack integer division. | |
| 171 // - Marvell Armada 370/XP incorrectly reports that it has integer division. | |
| 168 bool is_krait = CpuInfo::FieldContains(kCpuInfoHardware, "QCT APQ8064"); | 172 bool is_krait = CpuInfo::FieldContains(kCpuInfoHardware, "QCT APQ8064"); |
| 173 bool is_armada_370xp = | |
| 174 CpuInfo::FieldContains(kCpuInfoHardware, "Marvell Armada 370/XP"); | |
| 169 if (is_krait) { | 175 if (is_krait) { |
| 170 // Special case for Qualcomm Krait CPUs in Nexus 4 and 7. | |
| 171 integer_division_supported_ = FLAG_use_integer_division; | 176 integer_division_supported_ = FLAG_use_integer_division; |
| 172 } else { | 177 } else if (!is_armada_370xp) { |
|
regis
2015/10/07 17:12:20
It would be clearer to set the value (again) to fa
zra
2015/10/07 22:56:14
Done.
| |
| 173 integer_division_supported_ = | 178 integer_division_supported_ = |
| 174 (CpuInfo::FieldContains(kCpuInfoFeatures, "idiva") || is_arm64) && | 179 (CpuInfo::FieldContains(kCpuInfoFeatures, "idiva") || is_arm64) && |
| 175 FLAG_use_integer_division; | 180 FLAG_use_integer_division; |
| 176 } | 181 } |
| 177 neon_supported_ = | 182 neon_supported_ = |
| 178 (CpuInfo::FieldContains(kCpuInfoFeatures, "neon") || is_arm64) && | 183 (CpuInfo::FieldContains(kCpuInfoFeatures, "neon") || is_arm64) && |
| 179 FLAG_use_vfp && FLAG_use_neon; | 184 FLAG_use_vfp && FLAG_use_neon; |
| 180 | 185 |
| 181 // Use the cross-compiler's predefined macros to determine whether we should | 186 // Use the cross-compiler's predefined macros to determine whether we should |
| 182 // use the hard or soft float ABI. | 187 // use the hard or soft float ABI. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 233 ASSERT(hardware_ != NULL); | 238 ASSERT(hardware_ != NULL); |
| 234 free(const_cast<char*>(hardware_)); | 239 free(const_cast<char*>(hardware_)); |
| 235 hardware_ = NULL; | 240 hardware_ = NULL; |
| 236 CpuInfo::Cleanup(); | 241 CpuInfo::Cleanup(); |
| 237 } | 242 } |
| 238 #endif // !defined(USING_SIMULATOR) | 243 #endif // !defined(USING_SIMULATOR) |
| 239 | 244 |
| 240 } // namespace dart | 245 } // namespace dart |
| 241 | 246 |
| 242 #endif // defined TARGET_ARCH_ARM | 247 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |