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

Unified Diff: src/ia32/assembler-ia32.h

Issue 23523060: Add a mechanism to override the detected cpu features. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | src/ia32/assembler-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/assembler-ia32.h
diff --git a/src/ia32/assembler-ia32.h b/src/ia32/assembler-ia32.h
index 55eff931907b11e66d05c28c1c177fcc85590aa7..5c0928a5a9b6519f9a9f86bc5c318e48ef19b63f 100644
--- a/src/ia32/assembler-ia32.h
+++ b/src/ia32/assembler-ia32.h
@@ -535,6 +535,7 @@ class CpuFeatures : public AllStatic {
// Check whether a feature is supported by the target CPU.
static bool IsSupported(CpuFeature f) {
ASSERT(initialized_);
+ if ((force_feature_ & (static_cast<uint64_t>(1) << f)) != 0) return true;
Sven Panne 2013/09/16 13:48:05 Lift out static_cast<uint64_t>(1) << f into a
if (f == SSE2 && !FLAG_enable_sse2) return false;
if (f == SSE3 && !FLAG_enable_sse3) return false;
if (f == SSE4_1 && !FLAG_enable_sse4_1) return false;
@@ -550,13 +551,23 @@ class CpuFeatures : public AllStatic {
static bool IsSafeForSnapshot(CpuFeature f) {
return (IsSupported(f) &&
- (!Serializer::enabled() || !IsFoundByRuntimeProbingOnly(f)));
+ (!Serializer::enabled() || !IsFoundByRuntimeProbingOnly(f))) ||
+ ((force_feature_ & (static_cast<uint64_t>(1) << f)) != 0);
+ }
+
+ static void ForceFeature(CpuFeature f) {
Sven Panne 2013/09/16 13:48:05 I am not sure about the future use cases, perhaps
+ force_feature_ = force_feature_ | (static_cast<uint64_t>(1) << f);
+ }
+
+ static void ClearForcedFeatures() {
+ force_feature_ = 0;
}
private:
#ifdef DEBUG
static bool initialized_;
#endif
+ static uint64_t force_feature_;
static uint64_t supported_;
static uint64_t found_by_runtime_probing_only_;
« no previous file with comments | « no previous file | src/ia32/assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698