Revision: 6211
Author: [email protected]
Date: Thu Jan  6 08:16:25 2011
Log: Merge bleeding_edge revision 5952 from bleeding_edge to 2.5 branch to fix
ARM VFP detection for Nexus One type devices.

BUG=1024
Review URL: http://codereview.chromium.org/6122001
http://code.google.com/p/v8/source/detail?r=6211

Modified:
 /branches/2.5/src/platform-linux.cc
 /branches/2.5/src/version.cc

=======================================
--- /branches/2.5/src/platform-linux.cc Mon Nov 29 00:02:25 2010
+++ /branches/2.5/src/platform-linux.cc Thu Jan  6 08:16:25 2011
@@ -133,9 +133,7 @@
 }

 bool OS::ArmCpuHasFeature(CpuFeature feature) {
-  const int max_items = 2;
-  const char* search_strings[max_items] = { NULL, NULL };
-  int search_items = 0;
+  const char* search_string = NULL;
   // Simple detection of VFP at runtime for Linux.
   // It is based on /proc/cpuinfo, which reveals hardware configuration
   // to user-space applications.  According to ARM (mid 2009), no similar
@@ -143,25 +141,26 @@
   // so it's up to individual OSes to provide such.
   switch (feature) {
     case VFP3:
-      search_strings[0] = "vfpv3";
- // Some old kernels will report vfp for A8, not vfpv3, so we check for - // A8 explicitely. The cpuinfo file report the CPU Part which for Cortex
-      // A8 is 0xc08.
-      search_strings[1] = "0xc08";
-      search_items = 2;
-      ASSERT(search_items <= max_items);
+      search_string = "vfpv3";
       break;
     case ARMv7:
-      search_strings[0] = "ARMv7" ;
-      search_items = 1;
-      ASSERT(search_items <= max_items);
+      search_string = "ARMv7";
       break;
     default:
       UNREACHABLE();
   }

-  for (int i = 0; i < search_items; ++i) {
-    if (CPUInfoContainsString(search_strings[i])) {
+  if (CPUInfoContainsString(search_string)) {
+    return true;
+  }
+
+  if (feature == VFP3) {
+ // Some old kernels will report vfp not vfpv3. Here we make a last attempt
+    // to detect vfpv3 by checking for vfp *and* neon, since neon is only
+    // available on architectures with vfpv3.
+ // Checking neon on its own is not enough as it is possible to have neon
+    // without vfp.
+    if (CPUInfoContainsString("vfp") && CPUInfoContainsString("neon")) {
       return true;
     }
   }
=======================================
--- /branches/2.5/src/version.cc        Wed Dec 29 02:14:47 2010
+++ /branches/2.5/src/version.cc        Thu Jan  6 08:16:25 2011
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     2
 #define MINOR_VERSION     5
 #define BUILD_NUMBER      9
-#define PATCH_LEVEL       6
+#define PATCH_LEVEL       7
 #define CANDIDATE_VERSION false

 // Define SONAME to have the SCons build the put a specific SONAME into the

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to