src/cpu/x86/vm/vm_version_x86.cpp

changeset 7269
e48395e6a91b
parent 7152
166d744df0de
child 7535
7ae4e26cb1e0
child 8307
daaf806995b3
     1.1 --- a/src/cpu/x86/vm/vm_version_x86.cpp	Mon Oct 20 16:37:02 2014 -0400
     1.2 +++ b/src/cpu/x86/vm/vm_version_x86.cpp	Fri Oct 17 15:35:25 2014 -0700
     1.3 @@ -873,14 +873,19 @@
     1.4    if (supports_bmi1()) {
     1.5      // tzcnt does not require VEX prefix
     1.6      if (FLAG_IS_DEFAULT(UseCountTrailingZerosInstruction)) {
     1.7 -      UseCountTrailingZerosInstruction = true;
     1.8 +      if (!UseBMI1Instructions && !FLAG_IS_DEFAULT(UseBMI1Instructions)) {
     1.9 +        // Don't use tzcnt if BMI1 is switched off on command line.
    1.10 +        UseCountTrailingZerosInstruction = false;
    1.11 +      } else {
    1.12 +        UseCountTrailingZerosInstruction = true;
    1.13 +      }
    1.14      }
    1.15    } else if (UseCountTrailingZerosInstruction) {
    1.16      warning("tzcnt instruction is not available on this CPU");
    1.17      FLAG_SET_DEFAULT(UseCountTrailingZerosInstruction, false);
    1.18    }
    1.19  
    1.20 -  // BMI instructions use an encoding with VEX prefix.
    1.21 +  // BMI instructions (except tzcnt) use an encoding with VEX prefix.
    1.22    // VEX prefix is generated only when AVX > 0.
    1.23    if (supports_bmi1() && supports_avx()) {
    1.24      if (FLAG_IS_DEFAULT(UseBMI1Instructions)) {

mercurial