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

Unified Diff: src/platform-linux.cc

Issue 391051: Allow a platform to indicate that some CPU features are always... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 1 month 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
Index: src/platform-linux.cc
===================================================================
--- src/platform-linux.cc (revision 3297)
+++ src/platform-linux.cc (working copy)
@@ -84,12 +84,24 @@
}
+uint64_t OS::CpuFeaturesImpliedByPlatform() {
+#if (defined(__VFP_FP__) && !defined(__SOFTFP__))
+ // Here gcc is telling us that we are on an ARM and gcc is assuming that we
+ // have VFP3 instructions. If gcc can assume it then so can we.
+ return 1u << VFP3;
+#else
+ return 0; // Linux runs on anything.
+#endif
+}
+
+
double OS::nan_value() {
return NAN;
}
-bool OS::ArmCpuHasFeature(OS::CpuFeature feature) {
+#ifdef __arm__
+bool OS::ArmCpuHasFeature(CpuFeature feature) {
const char* search_string = NULL;
const char* file_name = "/proc/cpuinfo";
// Simple detection of VFP at runtime for Linux.
@@ -103,7 +115,7 @@
// on Linux, it's reading from a (non-mmap-able)
// character special device.
switch (feature) {
- case VFP:
+ case VFP3:
search_string = "vfp";
break;
default:
@@ -136,6 +148,7 @@
// Did not find string in the proc file.
return false;
}
+#endif // def __arm__
int OS::ActivationFrameAlignment() {
« src/arm/assembler-arm.h ('K') | « src/platform-freebsd.cc ('k') | src/platform-macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698