comparison src/cpu/x86/vm/vm_version_x86.hpp @ 14704:b51e29501f30

Merged with jdk9/dev/hotspot changeset 9486a41de3b7
author twisti
date Tue, 18 Mar 2014 20:19:10 -0700
parents eefb0224149d 9e9af3aa4278
children 92aa6797d639
comparison
equal deleted inserted replaced
14647:8f483e200405 14704:b51e29501f30
140 union ExtCpuid1Ecx { 140 union ExtCpuid1Ecx {
141 uint32_t value; 141 uint32_t value;
142 struct { 142 struct {
143 uint32_t LahfSahf : 1, 143 uint32_t LahfSahf : 1,
144 CmpLegacy : 1, 144 CmpLegacy : 1,
145 : 4, 145 : 3,
146 lzcnt_intel : 1,
146 lzcnt : 1, 147 lzcnt : 1,
147 sse4a : 1, 148 sse4a : 1,
148 misalignsse : 1, 149 misalignsse : 1,
149 prefetchw : 1, 150 prefetchw : 1,
150 : 22; 151 : 22;
250 CPU_TSCINV = (1 << 16), 251 CPU_TSCINV = (1 << 16),
251 CPU_AVX = (1 << 17), 252 CPU_AVX = (1 << 17),
252 CPU_AVX2 = (1 << 18), 253 CPU_AVX2 = (1 << 18),
253 CPU_AES = (1 << 19), 254 CPU_AES = (1 << 19),
254 CPU_ERMS = (1 << 20), // enhanced 'rep movsb/stosb' instructions 255 CPU_ERMS = (1 << 20), // enhanced 'rep movsb/stosb' instructions
255 CPU_CLMUL = (1 << 21) // carryless multiply for CRC 256 CPU_CLMUL = (1 << 21), // carryless multiply for CRC
257 CPU_BMI1 = (1 << 22),
258 CPU_BMI2 = (1 << 23)
256 } cpuFeatureFlags; 259 } cpuFeatureFlags;
257 260
258 enum { 261 enum {
259 // AMD 262 // AMD
260 CPU_FAMILY_AMD_11H = 0x11, 263 CPU_FAMILY_AMD_11H = 0x11,
422 _cpuid_info.xem_xcr0_eax.bits.ymm != 0) { 425 _cpuid_info.xem_xcr0_eax.bits.ymm != 0) {
423 result |= CPU_AVX; 426 result |= CPU_AVX;
424 if (_cpuid_info.sef_cpuid7_ebx.bits.avx2 != 0) 427 if (_cpuid_info.sef_cpuid7_ebx.bits.avx2 != 0)
425 result |= CPU_AVX2; 428 result |= CPU_AVX2;
426 } 429 }
430 if(_cpuid_info.sef_cpuid7_ebx.bits.bmi1 != 0)
431 result |= CPU_BMI1;
427 if (_cpuid_info.std_cpuid1_edx.bits.tsc != 0) 432 if (_cpuid_info.std_cpuid1_edx.bits.tsc != 0)
428 result |= CPU_TSC; 433 result |= CPU_TSC;
429 if (_cpuid_info.ext_cpuid7_edx.bits.tsc_invariance != 0) 434 if (_cpuid_info.ext_cpuid7_edx.bits.tsc_invariance != 0)
430 result |= CPU_TSCINV; 435 result |= CPU_TSCINV;
431 if (_cpuid_info.std_cpuid1_ecx.bits.aes != 0) 436 if (_cpuid_info.std_cpuid1_ecx.bits.aes != 0)
442 result |= CPU_3DNOW_PREFETCH; 447 result |= CPU_3DNOW_PREFETCH;
443 if (_cpuid_info.ext_cpuid1_ecx.bits.lzcnt != 0) 448 if (_cpuid_info.ext_cpuid1_ecx.bits.lzcnt != 0)
444 result |= CPU_LZCNT; 449 result |= CPU_LZCNT;
445 if (_cpuid_info.ext_cpuid1_ecx.bits.sse4a != 0) 450 if (_cpuid_info.ext_cpuid1_ecx.bits.sse4a != 0)
446 result |= CPU_SSE4A; 451 result |= CPU_SSE4A;
452 }
453 // Intel features.
454 if(is_intel()) {
455 if(_cpuid_info.sef_cpuid7_ebx.bits.bmi2 != 0)
456 result |= CPU_BMI2;
457 if(_cpuid_info.ext_cpuid1_ecx.bits.lzcnt_intel != 0)
458 result |= CPU_LZCNT;
447 } 459 }
448 460
449 return result; 461 return result;
450 } 462 }
451 463
559 static bool supports_avx2() { return (_cpuFeatures & CPU_AVX2) != 0; } 571 static bool supports_avx2() { return (_cpuFeatures & CPU_AVX2) != 0; }
560 static bool supports_tsc() { return (_cpuFeatures & CPU_TSC) != 0; } 572 static bool supports_tsc() { return (_cpuFeatures & CPU_TSC) != 0; }
561 static bool supports_aes() { return (_cpuFeatures & CPU_AES) != 0; } 573 static bool supports_aes() { return (_cpuFeatures & CPU_AES) != 0; }
562 static bool supports_erms() { return (_cpuFeatures & CPU_ERMS) != 0; } 574 static bool supports_erms() { return (_cpuFeatures & CPU_ERMS) != 0; }
563 static bool supports_clmul() { return (_cpuFeatures & CPU_CLMUL) != 0; } 575 static bool supports_clmul() { return (_cpuFeatures & CPU_CLMUL) != 0; }
564 576 static bool supports_bmi1() { return (_cpuFeatures & CPU_BMI1) != 0; }
577 static bool supports_bmi2() { return (_cpuFeatures & CPU_BMI2) != 0; }
565 // Intel features 578 // Intel features
566 static bool is_intel_family_core() { return is_intel() && 579 static bool is_intel_family_core() { return is_intel() &&
567 extended_cpu_family() == CPU_FAMILY_INTEL_CORE; } 580 extended_cpu_family() == CPU_FAMILY_INTEL_CORE; }
568 581
569 static bool is_intel_tsc_synched_at_init() { 582 static bool is_intel_tsc_synched_at_init() {