Chromium Code Reviews| Index: runtime/vm/cpu_arm.cc |
| diff --git a/runtime/vm/cpu_arm.cc b/runtime/vm/cpu_arm.cc |
| index d0ecc0dbe23952f8f8312101b4f948c6f9025f41..9ab9adf272b93224aeb8af7f4c4ec12bbd3dd665 100644 |
| --- a/runtime/vm/cpu_arm.cc |
| +++ b/runtime/vm/cpu_arm.cc |
| @@ -207,15 +207,25 @@ void HostCPUFeatures::InitOnce() { |
| // - Qualcomm Krait CPUs (QCT APQ8064) in Nexus 4 and 7 incorrectly report |
| // that they lack integer division. |
| // - Marvell Armada 370/XP incorrectly reports that it has integer division. |
| - // - Qualcomm Snapdragon 820/821 CPUs (MSM 8996 and MSM8996pro) in Xiaomi MI5 |
| - // and Pixel lack integer division even though ARMv8 requires it in A32. |
| bool is_krait = CpuInfo::FieldContains(kCpuInfoHardware, "QCT APQ8064"); |
| bool is_armada_370xp = |
| CpuInfo::FieldContains(kCpuInfoHardware, "Marvell Armada 370/XP"); |
| - bool is_snapdragon = CpuInfo::FieldContains(kCpuInfoHardware, "MSM8996"); |
| +#if defined(HOST_OS_ANDROID) |
| + bool is_android = true; |
| +#else |
| + bool is_android = false; |
|
zra
2017/04/05 20:29:10
I'd prefer using OS::Name() over HOST_OS_ANDROID.
|
| +#endif |
| if (is_krait) { |
| integer_division_supported_ = FLAG_use_integer_division; |
| - } else if (is_armada_370xp || is_snapdragon) { |
| + } else if (is_android && is_arm64) { |
| + // Various Android ARM64 devices, including the Qualcomm Snapdragon 820/821 |
| + // CPUs (MSM 8996 and MSM8996pro) in Xiaomi MI5 and Pixel lack integer |
| + // division even though ARMv8 requires it in A32. Instead of attempting to |
| + // track all of these devices, we conservatively disable use of integer |
| + // division on Android ARM64 devices. |
| + // TODO(29270): /proc/self/auxv might be more reliable here. |
| + integer_division_supported_ = false; |
| + } else if (is_armada_370xp) { |
| integer_division_supported_ = false; |
| } else { |
| integer_division_supported_ = |