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/cpu.h" | 8 #include "vm/cpu.h" |
9 #include "vm/cpu_arm.h" | 9 #include "vm/cpu_arm.h" |
10 | 10 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 // Has floating point unit. | 192 // Has floating point unit. |
193 vfp_supported_ = | 193 vfp_supported_ = |
194 (CpuInfo::FieldContains(kCpuInfoFeatures, "vfp") || is_arm64) && | 194 (CpuInfo::FieldContains(kCpuInfoFeatures, "vfp") || is_arm64) && |
195 FLAG_use_vfp; | 195 FLAG_use_vfp; |
196 | 196 |
197 // Has integer division. | 197 // Has integer division. |
198 // Special cases: | 198 // Special cases: |
199 // - Qualcomm Krait CPUs (QCT APQ8064) in Nexus 4 and 7 incorrectly report | 199 // - Qualcomm Krait CPUs (QCT APQ8064) in Nexus 4 and 7 incorrectly report |
200 // that they lack integer division. | 200 // that they lack integer division. |
201 // - Marvell Armada 370/XP incorrectly reports that it has integer division. | 201 // - Marvell Armada 370/XP incorrectly reports that it has integer division. |
| 202 // - The Pixel lacks integer division even though ARMv8 requires it in A32. |
202 bool is_krait = CpuInfo::FieldContains(kCpuInfoHardware, "QCT APQ8064"); | 203 bool is_krait = CpuInfo::FieldContains(kCpuInfoHardware, "QCT APQ8064"); |
203 bool is_armada_370xp = | 204 bool is_armada_370xp = |
204 CpuInfo::FieldContains(kCpuInfoHardware, "Marvell Armada 370/XP"); | 205 CpuInfo::FieldContains(kCpuInfoHardware, "Marvell Armada 370/XP"); |
| 206 bool is_pixel = |
| 207 CpuInfo::FieldContains(kCpuInfoHardware, "MSM8996pro"); |
205 if (is_krait) { | 208 if (is_krait) { |
206 integer_division_supported_ = FLAG_use_integer_division; | 209 integer_division_supported_ = FLAG_use_integer_division; |
207 } else if (!is_armada_370xp) { | 210 } else if (is_armada_370xp || is_pixel) { |
| 211 integer_division_supported_ = false; |
| 212 } else { |
208 integer_division_supported_ = | 213 integer_division_supported_ = |
209 (CpuInfo::FieldContains(kCpuInfoFeatures, "idiva") || is_arm64) && | 214 (CpuInfo::FieldContains(kCpuInfoFeatures, "idiva") || is_arm64) && |
210 FLAG_use_integer_division; | 215 FLAG_use_integer_division; |
211 } else { | |
212 integer_division_supported_ = false; | |
213 } | 216 } |
214 neon_supported_ = | 217 neon_supported_ = |
215 (CpuInfo::FieldContains(kCpuInfoFeatures, "neon") || is_arm64) && | 218 (CpuInfo::FieldContains(kCpuInfoFeatures, "neon") || is_arm64) && |
216 FLAG_use_vfp && FLAG_use_neon; | 219 FLAG_use_vfp && FLAG_use_neon; |
217 | 220 |
218 // Use the cross-compiler's predefined macros to determine whether we should | 221 // Use the cross-compiler's predefined macros to determine whether we should |
219 // use the hard or soft float ABI. | 222 // use the hard or soft float ABI. |
220 #if defined(__ARM_PCS_VFP) | 223 #if defined(__ARM_PCS_VFP) |
221 hardfp_supported_ = true; | 224 hardfp_supported_ = true; |
222 #else | 225 #else |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 ASSERT(hardware_ != NULL); | 275 ASSERT(hardware_ != NULL); |
273 free(const_cast<char*>(hardware_)); | 276 free(const_cast<char*>(hardware_)); |
274 hardware_ = NULL; | 277 hardware_ = NULL; |
275 CpuInfo::Cleanup(); | 278 CpuInfo::Cleanup(); |
276 } | 279 } |
277 #endif // !defined(USING_SIMULATOR) | 280 #endif // !defined(USING_SIMULATOR) |
278 | 281 |
279 } // namespace dart | 282 } // namespace dart |
280 | 283 |
281 #endif // defined TARGET_ARCH_ARM | 284 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |