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

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

Issue 869133002: [x86] Blacklist AVX for Windows versions before 6.1 (Windows 7). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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/x64/assembler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/assembler-ia32.cc
diff --git a/src/ia32/assembler-ia32.cc b/src/ia32/assembler-ia32.cc
index 9815f01b2ca7ab2cd15fbd1a09375347a60aeb50..19e69b319121dc786f6695706641a320e860874e 100644
--- a/src/ia32/assembler-ia32.cc
+++ b/src/ia32/assembler-ia32.cc
@@ -36,14 +36,19 @@
#include "src/ia32/assembler-ia32.h"
+#include <cstring>
+
+#if V8_TARGET_ARCH_IA32
+
#if V8_OS_MACOSX
#include <sys/sysctl.h>
#endif
-#if V8_TARGET_ARCH_IA32
-
#include "src/base/bits.h"
#include "src/base/cpu.h"
+#if V8_OS_WIN
+#include "src/base/win32-headers.h"
+#endif
#include "src/disassembler.h"
#include "src/macro-assembler.h"
#include "src/v8.h"
@@ -73,6 +78,19 @@ bool EnableAVX() {
*period_pos = '\0';
long kernel_version_major = strtol(buffer, nullptr, 10); // NOLINT
if (kernel_version_major <= 13) return false;
+#elif V8_OS_WIN
+ // The same problem seems to appear on Windows XP and Vista.
+ OSVERSIONINFOEX osvi;
+ DWORDLONG mask = 0;
+ memset(&osvi, 0, sizeof(osvi));
+ osvi.dwOSVersionInfoSize = sizeof(osvi);
+ osvi.dwMajorVersion = 6;
+ osvi.dwMinorVersion = 1;
+ VER_SET_CONDITION(mask, VER_MAJORVERSION, VER_GREATER_EQUAL);
+ VER_SET_CONDITION(mask, VER_MINORVERSION, VER_GREATER_EQUAL);
+ if (!VerifyVersionInfo(&osvi, VER_MAJORVERSION | VER_MINORVERSION, mask)) {
+ return false;
+ }
#endif // V8_OS_MACOSX
return FLAG_enable_avx;
}
« no previous file with comments | « no previous file | src/x64/assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698