Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2631)

Unified Diff: runtime/vm/cpu_arm.cc

Issue 602943002: Allows arm cpu feature detection to detect arm64 cpus. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/gyp/configurations_android.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/cpu_arm.cc
===================================================================
--- runtime/vm/cpu_arm.cc (revision 40643)
+++ runtime/vm/cpu_arm.cc (working copy)
@@ -77,17 +77,19 @@
#if defined(HOST_ARCH_ARM)
void HostCPUFeatures::InitOnce() {
+ bool is_arm64 = false;
CpuInfo::InitOnce();
hardware_ = CpuInfo::GetCpuModel();
- // Has floating point unit.
- vfp_supported_ = CpuInfo::FieldContains(kCpuInfoFeatures, "vfp") &&
- FLAG_use_vfp;
-
- // Check for ARMv5TE, ARMv6 or ARMv7. It can be in either the Processor or
- // Model information fields.
- if (CpuInfo::FieldContains(kCpuInfoProcessor, "ARM926EJ-S") ||
- CpuInfo::FieldContains(kCpuInfoModel, "ARM926EJ-S")) {
+ // Check for ARMv5TE, ARMv6, ARMv7, or aarch64.
+ // It can be in either the Processor or Model information fields.
+ if (CpuInfo::FieldContains(kCpuInfoProcessor, "aarch64") ||
+ CpuInfo::FieldContains(kCpuInfoModel, "aarch64")) {
+ // pretend that this arm64 cpu is really an ARMv7
+ arm_version_ = ARMv7;
+ is_arm64 = true;
+ } else if (CpuInfo::FieldContains(kCpuInfoProcessor, "ARM926EJ-S") ||
+ CpuInfo::FieldContains(kCpuInfoModel, "ARM926EJ-S")) {
// Lego Mindstorm EV3.
arm_version_ = ARMv5TE;
// On ARMv5, the PC read offset in an STR or STM instruction is either 8 or
@@ -111,6 +113,11 @@
arm_version_ = ARMv7;
}
+ // Has floating point unit.
+ vfp_supported_ =
+ (CpuInfo::FieldContains(kCpuInfoFeatures, "vfp") || is_arm64) &&
+ FLAG_use_vfp;
+
// Has integer division.
bool is_krait = CpuInfo::FieldContains(kCpuInfoHardware, "QCT APQ8064");
if (is_krait) {
@@ -118,10 +125,11 @@
integer_division_supported_ = true;
} else {
integer_division_supported_ =
- CpuInfo::FieldContains(kCpuInfoFeatures, "idiva");
+ CpuInfo::FieldContains(kCpuInfoFeatures, "idiva") || is_arm64;
}
- neon_supported_ = CpuInfo::FieldContains(kCpuInfoFeatures, "neon") &&
- FLAG_use_vfp && FLAG_use_neon;
+ neon_supported_ =
+ (CpuInfo::FieldContains(kCpuInfoFeatures, "neon") || is_arm64) &&
+ FLAG_use_vfp && FLAG_use_neon;
// Use the cross-compiler's predefined macros to determine whether we should
// use the hard or soft float ABI.
« no previous file with comments | « no previous file | tools/gyp/configurations_android.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698