src/cpu/x86/vm/vm_version_x86_32.cpp

changeset 739
dc7f315e41f7
parent 670
9c2ecc2ffb12
child 840
2649e5276dd7
     1.1 --- a/src/cpu/x86/vm/vm_version_x86_32.cpp	Tue Aug 26 15:49:40 2008 -0700
     1.2 +++ b/src/cpu/x86/vm/vm_version_x86_32.cpp	Wed Aug 27 00:21:55 2008 -0700
     1.3 @@ -67,23 +67,23 @@
     1.4      //
     1.5      // void getPsrInfo(VM_Version::CpuidInfo* cpuid_info);
     1.6      //
     1.7 -    __ pushl(rbp);
     1.8 -    __ movl(rbp, Address(rsp, 8)); // cpuid_info address
     1.9 -    __ pushl(rbx);
    1.10 -    __ pushl(rsi);
    1.11 -    __ pushfd();                // preserve rbx, and flags
    1.12 -    __ popl(rax);
    1.13 -    __ pushl(rax);
    1.14 -    __ movl(rcx, rax);
    1.15 +    __ push(rbp);
    1.16 +    __ movptr(rbp, Address(rsp, 8)); // cpuid_info address
    1.17 +    __ push(rbx);
    1.18 +    __ push(rsi);
    1.19 +    __ pushf();          // preserve rbx, and flags
    1.20 +    __ pop(rax);
    1.21 +    __ push(rax);
    1.22 +    __ mov(rcx, rax);
    1.23      //
    1.24      // if we are unable to change the AC flag, we have a 386
    1.25      //
    1.26      __ xorl(rax, EFL_AC);
    1.27 -    __ pushl(rax);
    1.28 -    __ popfd();
    1.29 -    __ pushfd();
    1.30 -    __ popl(rax);
    1.31 -    __ cmpl(rax, rcx);
    1.32 +    __ push(rax);
    1.33 +    __ popf();
    1.34 +    __ pushf();
    1.35 +    __ pop(rax);
    1.36 +    __ cmpptr(rax, rcx);
    1.37      __ jccb(Assembler::notEqual, detect_486);
    1.38  
    1.39      __ movl(rax, CPU_FAMILY_386);
    1.40 @@ -95,13 +95,13 @@
    1.41      // not support the "cpuid" instruction.
    1.42      //
    1.43      __ bind(detect_486);
    1.44 -    __ movl(rax, rcx);
    1.45 +    __ mov(rax, rcx);
    1.46      __ xorl(rax, EFL_ID);
    1.47 -    __ pushl(rax);
    1.48 -    __ popfd();
    1.49 -    __ pushfd();
    1.50 -    __ popl(rax);
    1.51 -    __ cmpl(rcx, rax);
    1.52 +    __ push(rax);
    1.53 +    __ popf();
    1.54 +    __ pushf();
    1.55 +    __ pop(rax);
    1.56 +    __ cmpptr(rcx, rax);
    1.57      __ jccb(Assembler::notEqual, detect_586);
    1.58  
    1.59      __ bind(cpu486);
    1.60 @@ -113,13 +113,13 @@
    1.61      // at this point, we have a chip which supports the "cpuid" instruction
    1.62      //
    1.63      __ bind(detect_586);
    1.64 -    __ xorl(rax, rax);
    1.65 +    __ xorptr(rax, rax);
    1.66      __ cpuid();
    1.67 -    __ orl(rax, rax);
    1.68 +    __ orptr(rax, rax);
    1.69      __ jcc(Assembler::equal, cpu486);   // if cpuid doesn't support an input
    1.70                                          // value of at least 1, we give up and
    1.71                                          // assume a 486
    1.72 -    __ leal(rsi, Address(rbp, in_bytes(VM_Version::std_cpuid0_offset())));
    1.73 +    __ lea(rsi, Address(rbp, in_bytes(VM_Version::std_cpuid0_offset())));
    1.74      __ movl(Address(rsi, 0), rax);
    1.75      __ movl(Address(rsi, 4), rbx);
    1.76      __ movl(Address(rsi, 8), rcx);
    1.77 @@ -134,13 +134,13 @@
    1.78      __ movl(rax, 4);     // and rcx already set to 0x0
    1.79      __ xorl(rcx, rcx);
    1.80      __ cpuid();
    1.81 -    __ pushl(rax);
    1.82 +    __ push(rax);
    1.83      __ andl(rax, 0x1f);  // Determine if valid cache parameters used
    1.84      __ orl(rax, rax);    // rax,[4:0] == 0 indicates invalid cache
    1.85 -    __ popl(rax);
    1.86 +    __ pop(rax);
    1.87      __ jccb(Assembler::equal, std_cpuid1);
    1.88  
    1.89 -    __ leal(rsi, Address(rbp, in_bytes(VM_Version::dcp_cpuid4_offset())));
    1.90 +    __ lea(rsi, Address(rbp, in_bytes(VM_Version::dcp_cpuid4_offset())));
    1.91      __ movl(Address(rsi, 0), rax);
    1.92      __ movl(Address(rsi, 4), rbx);
    1.93      __ movl(Address(rsi, 8), rcx);
    1.94 @@ -152,7 +152,7 @@
    1.95      __ bind(std_cpuid1);
    1.96      __ movl(rax, 1);
    1.97      __ cpuid();
    1.98 -    __ leal(rsi, Address(rbp, in_bytes(VM_Version::std_cpuid1_offset())));
    1.99 +    __ lea(rsi, Address(rbp, in_bytes(VM_Version::std_cpuid1_offset())));
   1.100      __ movl(Address(rsi, 0), rax);
   1.101      __ movl(Address(rsi, 4), rbx);
   1.102      __ movl(Address(rsi, 8), rcx);
   1.103 @@ -171,7 +171,7 @@
   1.104      //
   1.105      __ movl(rax, 0x80000008);
   1.106      __ cpuid();
   1.107 -    __ leal(rsi, Address(rbp, in_bytes(VM_Version::ext_cpuid8_offset())));
   1.108 +    __ lea(rsi, Address(rbp, in_bytes(VM_Version::ext_cpuid8_offset())));
   1.109      __ movl(Address(rsi, 0), rax);
   1.110      __ movl(Address(rsi, 4), rbx);
   1.111      __ movl(Address(rsi, 8), rcx);
   1.112 @@ -183,7 +183,7 @@
   1.113      __ bind(ext_cpuid5);
   1.114      __ movl(rax, 0x80000005);
   1.115      __ cpuid();
   1.116 -    __ leal(rsi, Address(rbp, in_bytes(VM_Version::ext_cpuid5_offset())));
   1.117 +    __ lea(rsi, Address(rbp, in_bytes(VM_Version::ext_cpuid5_offset())));
   1.118      __ movl(Address(rsi, 0), rax);
   1.119      __ movl(Address(rsi, 4), rbx);
   1.120      __ movl(Address(rsi, 8), rcx);
   1.121 @@ -195,7 +195,7 @@
   1.122      __ bind(ext_cpuid1);
   1.123      __ movl(rax, 0x80000001);
   1.124      __ cpuid();
   1.125 -    __ leal(rsi, Address(rbp, in_bytes(VM_Version::ext_cpuid1_offset())));
   1.126 +    __ lea(rsi, Address(rbp, in_bytes(VM_Version::ext_cpuid1_offset())));
   1.127      __ movl(Address(rsi, 0), rax);
   1.128      __ movl(Address(rsi, 4), rbx);
   1.129      __ movl(Address(rsi, 8), rcx);
   1.130 @@ -205,10 +205,10 @@
   1.131      // return
   1.132      //
   1.133      __ bind(done);
   1.134 -    __ popfd();
   1.135 -    __ popl(rsi);
   1.136 -    __ popl(rbx);
   1.137 -    __ popl(rbp);
   1.138 +    __ popf();
   1.139 +    __ pop(rsi);
   1.140 +    __ pop(rbx);
   1.141 +    __ pop(rbp);
   1.142      __ ret(0);
   1.143  
   1.144  #   undef __

mercurial