--- old/src/cpu/x86/vm/vm_version_x86.cpp 2014-02-07 00:45:28.000000000 -0800 +++ new/src/cpu/x86/vm/vm_version_x86.cpp 2014-02-07 00:45:28.000000000 -0800 @@ -600,13 +600,6 @@ } } - // Use count leading zeros count instruction if available. - if (supports_lzcnt()) { - if (FLAG_IS_DEFAULT(UseCountLeadingZerosInstruction)) { - UseCountLeadingZerosInstruction = true; - } - } - // some defaults for AMD family 15h if ( cpu_family() == 0x15 ) { // On family 15h processors default is no sw prefetch @@ -692,6 +685,29 @@ } #endif // COMPILER2 + // Use count leading zeros count instruction if available. + if (supports_lzcnt()) { + if (FLAG_IS_DEFAULT(UseCountLeadingZerosInstruction)) { + UseCountLeadingZerosInstruction = true; + } + } + + //Use count trailing zeros instruction if available + if (FLAG_IS_DEFAULT(UseCountTrailingZerosInstruction)) { + if (supports_bmi1()) { + UseCountTrailingZerosInstruction = true; + } + } + + if (supports_bmi1()) { + if (FLAG_IS_DEFAULT(UseBMI1Instructions)) { + UseBMI1Instructions = true; + } + } else if (UseBMI1Instructions) { + warning("BMI1 instructions are not available on this CPU"); + FLAG_SET_DEFAULT(UseBMI1Instructions, false); + } + // Use population count instruction if available. if (supports_popcnt()) { if (FLAG_IS_DEFAULT(UsePopCountInstruction)) {