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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // Has floating point unit. | 200 // Has floating point unit. |
201 vfp_supported_ = | 201 vfp_supported_ = |
202 (CpuInfo::FieldContains(kCpuInfoFeatures, "vfp") || is_arm64) && | 202 (CpuInfo::FieldContains(kCpuInfoFeatures, "vfp") || is_arm64) && |
203 FLAG_use_vfp; | 203 FLAG_use_vfp; |
204 | 204 |
205 // Has integer division. | 205 // Has integer division. |
206 // Special cases: | 206 // Special cases: |
207 // - Qualcomm Krait CPUs (QCT APQ8064) in Nexus 4 and 7 incorrectly report | 207 // - Qualcomm Krait CPUs (QCT APQ8064) in Nexus 4 and 7 incorrectly report |
208 // that they lack integer division. | 208 // that they lack integer division. |
209 // - Marvell Armada 370/XP incorrectly reports that it has integer division. | 209 // - Marvell Armada 370/XP incorrectly reports that it has integer division. |
210 // - The Pixel lacks integer division even though ARMv8 requires it in A32. | 210 // - Qualcomm Snapdragon 820/821 CPUs (MSM 8996 and MSM8996pro) in Xiaomi MI5 |
| 211 // and Pixel lack integer division even though ARMv8 requires it in A32. |
211 bool is_krait = CpuInfo::FieldContains(kCpuInfoHardware, "QCT APQ8064"); | 212 bool is_krait = CpuInfo::FieldContains(kCpuInfoHardware, "QCT APQ8064"); |
212 bool is_armada_370xp = | 213 bool is_armada_370xp = |
213 CpuInfo::FieldContains(kCpuInfoHardware, "Marvell Armada 370/XP"); | 214 CpuInfo::FieldContains(kCpuInfoHardware, "Marvell Armada 370/XP"); |
214 bool is_pixel = CpuInfo::FieldContains(kCpuInfoHardware, "MSM8996pro"); | 215 bool is_snapdragon = CpuInfo::FieldContains(kCpuInfoHardware, "MSM8996"); |
215 if (is_krait) { | 216 if (is_krait) { |
216 integer_division_supported_ = FLAG_use_integer_division; | 217 integer_division_supported_ = FLAG_use_integer_division; |
217 } else if (is_armada_370xp || is_pixel) { | 218 } else if (is_armada_370xp || is_snapdragon) { |
218 integer_division_supported_ = false; | 219 integer_division_supported_ = false; |
219 } else { | 220 } else { |
220 integer_division_supported_ = | 221 integer_division_supported_ = |
221 (CpuInfo::FieldContains(kCpuInfoFeatures, "idiva") || is_arm64) && | 222 (CpuInfo::FieldContains(kCpuInfoFeatures, "idiva") || is_arm64) && |
222 FLAG_use_integer_division; | 223 FLAG_use_integer_division; |
223 } | 224 } |
224 neon_supported_ = | 225 neon_supported_ = |
225 (CpuInfo::FieldContains(kCpuInfoFeatures, "neon") || is_arm64) && | 226 (CpuInfo::FieldContains(kCpuInfoFeatures, "neon") || is_arm64) && |
226 FLAG_use_vfp && FLAG_use_neon; | 227 FLAG_use_vfp && FLAG_use_neon; |
227 | 228 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 ASSERT(hardware_ != NULL); | 283 ASSERT(hardware_ != NULL); |
283 free(const_cast<char*>(hardware_)); | 284 free(const_cast<char*>(hardware_)); |
284 hardware_ = NULL; | 285 hardware_ = NULL; |
285 CpuInfo::Cleanup(); | 286 CpuInfo::Cleanup(); |
286 } | 287 } |
287 #endif // !defined(USING_SIMULATOR) | 288 #endif // !defined(USING_SIMULATOR) |
288 | 289 |
289 } // namespace dart | 290 } // namespace dart |
290 | 291 |
291 #endif // defined TARGET_ARCH_ARM | 292 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |