Reviewers: Sven Panne,
Description:
Add a mechanism to override the detected cpu features.
BUG=
Please review this at https://codereview.chromium.org/23523060/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+13, -1 lines):
M src/ia32/assembler-ia32.h
M src/ia32/assembler-ia32.cc
Index: src/ia32/assembler-ia32.cc
diff --git a/src/ia32/assembler-ia32.cc b/src/ia32/assembler-ia32.cc
index
e5456da474673b69ad785532dae8319f10a89e39..fa776d6c087118adcc41e2d4c06248d235fe6807
100644
--- a/src/ia32/assembler-ia32.cc
+++ b/src/ia32/assembler-ia32.cc
@@ -51,6 +51,7 @@ namespace internal {
#ifdef DEBUG
bool CpuFeatures::initialized_ = false;
#endif
+uint64_t CpuFeatures::force_feature_ = 0;
uint64_t CpuFeatures::supported_ = 0;
uint64_t CpuFeatures::found_by_runtime_probing_only_ = 0;
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;
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) {
+ 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_;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.