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

Unified Diff: src/cpu.cc

Issue 298823008: Set SAHF flag correctly in ia32 (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: fix indentation Created 6 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cpu.cc
diff --git a/src/cpu.cc b/src/cpu.cc
index 8d9afd84ae444c1288d7ad3205ea51293932638a..eb64271ca23b2a475b466a3b6b2066142535f32c 100644
--- a/src/cpu.cc
+++ b/src/cpu.cc
@@ -300,6 +300,10 @@ CPU::CPU() : stepping_(0),
has_sse42_ = (cpu_info[2] & 0x00100000) != 0;
}
+#if V8_HOST_ARCH_IA32
+ // SAHF is always available in compat/legacy mode,
+ has_sahf_ = true;
+#else
// Query extended IDs.
__cpuid(cpu_info, 0x80000000);
unsigned num_ext_ids = cpu_info[0];
@@ -307,14 +311,10 @@ CPU::CPU() : stepping_(0),
// Interpret extended CPU feature information.
if (num_ext_ids > 0x80000000) {
__cpuid(cpu_info, 0x80000001);
- // SAHF is always available in compat/legacy mode,
- // but must be probed in long mode.
-#if V8_HOST_ARCH_IA32
- has_sahf_ = true;
-#else
+ // SAHF must be probed in long mode.
has_sahf_ = (cpu_info[2] & 0x00000001) != 0;
-#endif
}
+#endif
#elif V8_HOST_ARCH_ARM
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698