Support soft-float for ARMv6 (bug 696291, r=mrosenberg).
authorDavid Anderson <danderson@mozilla.com>
Mon, 30 Jan 2012 18:53:37 -0800
changeset 87018 0aacfba4caab859ad3d089f6ac5c285a9eaaef43
parent 87017 02e01981f3629cd48dfce476489fce5d78feab6a
child 87019 f719c5a97683cde655105608fa3c55be4ee84ad5
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrosenberg
bugs696291
milestone12.0a1
Support soft-float for ARMv6 (bug 696291, r=mrosenberg).
js/src/assembler/assembler/MacroAssemblerARM.cpp
--- a/js/src/assembler/assembler/MacroAssemblerARM.cpp
+++ b/js/src/assembler/assembler/MacroAssemblerARM.cpp
@@ -65,16 +65,32 @@ static bool isVFPPresent()
                 close(fd);
                 return aux.a_un.a_val & HWCAP_VFP;
             }
         }
         close(fd);
     }
 #endif
 
+#if defined(__GNUC__) && defined(__VFP_FP__)
+    return true;
+#endif
+
+#ifdef WTF_OS_ANDROID
+    FILE *fp = fopen("/proc/cpuinfo", "r");
+    if (!fp)
+        return false;
+
+    char buf[1024];
+    fread(buf, sizeof(char), sizeof(buf), fp);
+    fclose(fp);
+    if (strstr(buf, "vfp"))
+        return true;
+#endif
+
     return false;
 }
 
 const bool MacroAssemblerARM::s_isVFPPresent = isVFPPresent();
 
 #if WTF_CPU_ARMV5_OR_LOWER
 /* On ARMv5 and below, natural alignment is required. */
 void MacroAssemblerARM::load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest)