| Index: src/x64/macro-assembler-x64.cc
|
| diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
|
| index 65b65a36222637a7fba42ec9db03062f2c7f9434..27bbf5498423a40ec7d5f418dfa2620eb99ab1bb 100644
|
| --- a/src/x64/macro-assembler-x64.cc
|
| +++ b/src/x64/macro-assembler-x64.cc
|
| @@ -2886,7 +2886,11 @@ void MacroAssembler::Pinsrd(XMMRegister dst, const Operand& src, int8_t imm8) {
|
|
|
|
|
| void MacroAssembler::Lzcntl(Register dst, Register src) {
|
| - // TODO(intel): Add support for LZCNT (BMI1/ABM).
|
| + if (CpuFeatures::IsSupported(LZCNT)) {
|
| + CpuFeatureScope scope(this, LZCNT);
|
| + lzcntl(dst, src);
|
| + return;
|
| + }
|
| Label not_zero_src;
|
| bsrl(dst, src);
|
| j(not_zero, ¬_zero_src, Label::kNear);
|
| @@ -2897,7 +2901,11 @@ void MacroAssembler::Lzcntl(Register dst, Register src) {
|
|
|
|
|
| void MacroAssembler::Lzcntl(Register dst, const Operand& src) {
|
| - // TODO(intel): Add support for LZCNT (BMI1/ABM).
|
| + if (CpuFeatures::IsSupported(LZCNT)) {
|
| + CpuFeatureScope scope(this, LZCNT);
|
| + lzcntl(dst, src);
|
| + return;
|
| + }
|
| Label not_zero_src;
|
| bsrl(dst, src);
|
| j(not_zero, ¬_zero_src, Label::kNear);
|
|
|