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

Side by Side Diff: src/base/cpu.cc

Issue 878063002: [x86] Disable AVX unless the operating system explicitly claims to support it. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compilation. Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/base/cpu.h ('k') | src/ia32/assembler-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/base/cpu.h" 5 #include "src/base/cpu.h"
6 6
7 #if V8_LIBC_MSVCRT 7 #if V8_LIBC_MSVCRT
8 #include <intrin.h> // __cpuid() 8 #include <intrin.h> // __cpuid()
9 #endif 9 #endif
10 #if V8_OS_LINUX 10 #if V8_OS_LINUX
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 has_cmov_(false), 309 has_cmov_(false),
310 has_sahf_(false), 310 has_sahf_(false),
311 has_mmx_(false), 311 has_mmx_(false),
312 has_sse_(false), 312 has_sse_(false),
313 has_sse2_(false), 313 has_sse2_(false),
314 has_sse3_(false), 314 has_sse3_(false),
315 has_ssse3_(false), 315 has_ssse3_(false),
316 has_sse41_(false), 316 has_sse41_(false),
317 has_sse42_(false), 317 has_sse42_(false),
318 is_atom_(false), 318 is_atom_(false),
319 has_osxsave_(false),
319 has_avx_(false), 320 has_avx_(false),
320 has_fma3_(false), 321 has_fma3_(false),
321 has_idiva_(false), 322 has_idiva_(false),
322 has_neon_(false), 323 has_neon_(false),
323 has_thumb2_(false), 324 has_thumb2_(false),
324 has_vfp_(false), 325 has_vfp_(false),
325 has_vfp3_(false), 326 has_vfp3_(false),
326 has_vfp3_d32_(false), 327 has_vfp3_d32_(false),
327 is_fp64_mode_(false) { 328 is_fp64_mode_(false) {
328 memcpy(vendor_, "Unknown", 8); 329 memcpy(vendor_, "Unknown", 8);
(...skipping 28 matching lines...) Expand all
357 ext_family_ = (cpu_info[0] >> 20) & 0xff; 358 ext_family_ = (cpu_info[0] >> 20) & 0xff;
358 has_fpu_ = (cpu_info[3] & 0x00000001) != 0; 359 has_fpu_ = (cpu_info[3] & 0x00000001) != 0;
359 has_cmov_ = (cpu_info[3] & 0x00008000) != 0; 360 has_cmov_ = (cpu_info[3] & 0x00008000) != 0;
360 has_mmx_ = (cpu_info[3] & 0x00800000) != 0; 361 has_mmx_ = (cpu_info[3] & 0x00800000) != 0;
361 has_sse_ = (cpu_info[3] & 0x02000000) != 0; 362 has_sse_ = (cpu_info[3] & 0x02000000) != 0;
362 has_sse2_ = (cpu_info[3] & 0x04000000) != 0; 363 has_sse2_ = (cpu_info[3] & 0x04000000) != 0;
363 has_sse3_ = (cpu_info[2] & 0x00000001) != 0; 364 has_sse3_ = (cpu_info[2] & 0x00000001) != 0;
364 has_ssse3_ = (cpu_info[2] & 0x00000200) != 0; 365 has_ssse3_ = (cpu_info[2] & 0x00000200) != 0;
365 has_sse41_ = (cpu_info[2] & 0x00080000) != 0; 366 has_sse41_ = (cpu_info[2] & 0x00080000) != 0;
366 has_sse42_ = (cpu_info[2] & 0x00100000) != 0; 367 has_sse42_ = (cpu_info[2] & 0x00100000) != 0;
368 has_osxsave_ = (cpu_info[2] & 0x08000000) != 0;
367 has_avx_ = (cpu_info[2] & 0x10000000) != 0; 369 has_avx_ = (cpu_info[2] & 0x10000000) != 0;
368 if (has_avx_) has_fma3_ = (cpu_info[2] & 0x00001000) != 0; 370 has_fma3_ = (cpu_info[2] & 0x00001000) != 0;
369 371
370 if (family_ == 0x6) { 372 if (family_ == 0x6) {
371 switch (model_) { 373 switch (model_) {
372 case 0x1c: // SLT 374 case 0x1c: // SLT
373 case 0x26: 375 case 0x26:
374 case 0x36: 376 case 0x36:
375 case 0x27: 377 case 0x27:
376 case 0x35: 378 case 0x35:
377 case 0x37: // SLM 379 case 0x37: // SLM
378 case 0x4a: 380 case 0x4a:
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 part_ = PPC_PA6T; 653 part_ = PPC_PA6T;
652 } 654 }
653 } 655 }
654 656
655 #endif // V8_OS_LINUX 657 #endif // V8_OS_LINUX
656 #endif // !USE_SIMULATOR 658 #endif // !USE_SIMULATOR
657 #endif // V8_HOST_ARCH_PPC 659 #endif // V8_HOST_ARCH_PPC
658 } 660 }
659 661
660 } } // namespace v8::base 662 } } // namespace v8::base
OLDNEW
« no previous file with comments | « src/base/cpu.h ('k') | src/ia32/assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698