提交 4856ddc9 编写于 作者: K kvn

8059139: It should be possible to explicitly disable usage of TZCNT instr w/...

8059139: It should be possible to explicitly disable usage of TZCNT instr w/ -XX:-UseBMI1Instructions
Reviewed-by: iveresov
上级 906bc4f5
...@@ -873,14 +873,19 @@ void VM_Version::get_processor_features() { ...@@ -873,14 +873,19 @@ void VM_Version::get_processor_features() {
if (supports_bmi1()) { if (supports_bmi1()) {
// tzcnt does not require VEX prefix // tzcnt does not require VEX prefix
if (FLAG_IS_DEFAULT(UseCountTrailingZerosInstruction)) { if (FLAG_IS_DEFAULT(UseCountTrailingZerosInstruction)) {
if (!UseBMI1Instructions && !FLAG_IS_DEFAULT(UseBMI1Instructions)) {
// Don't use tzcnt if BMI1 is switched off on command line.
UseCountTrailingZerosInstruction = false;
} else {
UseCountTrailingZerosInstruction = true; UseCountTrailingZerosInstruction = true;
} }
}
} else if (UseCountTrailingZerosInstruction) { } else if (UseCountTrailingZerosInstruction) {
warning("tzcnt instruction is not available on this CPU"); warning("tzcnt instruction is not available on this CPU");
FLAG_SET_DEFAULT(UseCountTrailingZerosInstruction, false); FLAG_SET_DEFAULT(UseCountTrailingZerosInstruction, false);
} }
// BMI instructions use an encoding with VEX prefix. // BMI instructions (except tzcnt) use an encoding with VEX prefix.
// VEX prefix is generated only when AVX > 0. // VEX prefix is generated only when AVX > 0.
if (supports_bmi1() && supports_avx()) { if (supports_bmi1() && supports_avx()) {
if (FLAG_IS_DEFAULT(UseBMI1Instructions)) { if (FLAG_IS_DEFAULT(UseBMI1Instructions)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册