src/cpu/x86/vm/vm_version_x86.cpp

changeset 3378
7ab5f6318694
parent 3156
f08d439fab8c
child 3400
22cee0ee8927
     1.1 --- a/src/cpu/x86/vm/vm_version_x86.cpp	Mon Dec 26 20:36:01 2011 -0500
     1.2 +++ b/src/cpu/x86/vm/vm_version_x86.cpp	Sun Jan 01 11:17:59 2012 -0500
     1.3 @@ -50,7 +50,7 @@
     1.4  VM_Version::CpuidInfo VM_Version::_cpuid_info   = { 0, };
     1.5  
     1.6  static BufferBlob* stub_blob;
     1.7 -static const int stub_size = 400;
     1.8 +static const int stub_size = 500;
     1.9  
    1.10  extern "C" {
    1.11    typedef void (*getPsrInfo_stub_t)(void*);
    1.12 @@ -73,7 +73,7 @@
    1.13      const uint32_t CPU_FAMILY_486   = (4 << CPU_FAMILY_SHIFT);
    1.14  
    1.15      Label detect_486, cpu486, detect_586, std_cpuid1, std_cpuid4;
    1.16 -    Label ext_cpuid1, ext_cpuid5, done;
    1.17 +    Label ext_cpuid1, ext_cpuid5, ext_cpuid7, done;
    1.18  
    1.19      StubCodeMark mark(this, "VM_Version", "getPsrInfo_stub");
    1.20  #   define __ _masm->
    1.21 @@ -235,8 +235,10 @@
    1.22      __ jcc(Assembler::belowEqual, done);
    1.23      __ cmpl(rax, 0x80000004);     // Is cpuid(0x80000005) supported?
    1.24      __ jccb(Assembler::belowEqual, ext_cpuid1);
    1.25 +    __ cmpl(rax, 0x80000006);     // Is cpuid(0x80000007) supported?
    1.26 +    __ jccb(Assembler::belowEqual, ext_cpuid5);
    1.27      __ cmpl(rax, 0x80000007);     // Is cpuid(0x80000008) supported?
    1.28 -    __ jccb(Assembler::belowEqual, ext_cpuid5);
    1.29 +    __ jccb(Assembler::belowEqual, ext_cpuid7);
    1.30      //
    1.31      // Extended cpuid(0x80000008)
    1.32      //
    1.33 @@ -249,6 +251,18 @@
    1.34      __ movl(Address(rsi,12), rdx);
    1.35  
    1.36      //
    1.37 +    // Extended cpuid(0x80000007)
    1.38 +    //
    1.39 +    __ bind(ext_cpuid7);
    1.40 +    __ movl(rax, 0x80000007);
    1.41 +    __ cpuid();
    1.42 +    __ lea(rsi, Address(rbp, in_bytes(VM_Version::ext_cpuid7_offset())));
    1.43 +    __ movl(Address(rsi, 0), rax);
    1.44 +    __ movl(Address(rsi, 4), rbx);
    1.45 +    __ movl(Address(rsi, 8), rcx);
    1.46 +    __ movl(Address(rsi,12), rdx);
    1.47 +
    1.48 +    //
    1.49      // Extended cpuid(0x80000005)
    1.50      //
    1.51      __ bind(ext_cpuid5);
    1.52 @@ -365,7 +379,7 @@
    1.53    }
    1.54  
    1.55    char buf[256];
    1.56 -  jio_snprintf(buf, sizeof(buf), "(%u cores per cpu, %u threads per core) family %d model %d stepping %d%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
    1.57 +  jio_snprintf(buf, sizeof(buf), "(%u cores per cpu, %u threads per core) family %d model %d stepping %d%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
    1.58                 cores_per_cpu(), threads_per_core(),
    1.59                 cpu_family(), _model, _stepping,
    1.60                 (supports_cmov() ? ", cmov" : ""),
    1.61 @@ -383,7 +397,10 @@
    1.62                 (supports_3dnow_prefetch() ? ", 3dnowpref" : ""),
    1.63                 (supports_lzcnt()   ? ", lzcnt": ""),
    1.64                 (supports_sse4a()   ? ", sse4a": ""),
    1.65 -               (supports_ht() ? ", ht": ""));
    1.66 +               (supports_ht() ? ", ht": ""),
    1.67 +               (supports_tsc() ? ", tsc": ""),
    1.68 +               (supports_tscinv_bit() ? ", tscinvbit": ""),
    1.69 +               (supports_tscinv() ? ", tscinv": ""));
    1.70    _features_str = strdup(buf);
    1.71  
    1.72    // UseSSE is set to the smaller of what hardware supports and what

mercurial