Chromium Code Reviews| Index: src/x64/macro-assembler-x64.cc |
| diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
| index 611e893e043f36abe508cc49ea7cb879a376b3c6..2757808de2f00599a0c7c5cc99cc0ee36af6cc48 100644 |
| --- a/src/x64/macro-assembler-x64.cc |
| +++ b/src/x64/macro-assembler-x64.cc |
| @@ -3189,6 +3189,34 @@ void MacroAssembler::Lzcntq(Register dst, const Operand& src) { |
| } |
| +void MacroAssembler::Tzcntq(Register dst, Register src) { |
| + if (CpuFeatures::IsSupported(BMI1)) { |
| + CpuFeatureScope scope(this, BMI1); |
| + tzcntq(dst, src); |
| + return; |
| + } |
| + Label not_zero_src; |
| + bsfq(dst, src); |
| + j(not_zero, ¬_zero_src, Label::kNear); |
| + Set(dst, 64); // The result of tzcnt is 32 if src = 0. |
|
titzer
2015/11/09 18:50:34
s/32/64/g
|
| + bind(¬_zero_src); |
| +} |
| + |
| + |
| +void MacroAssembler::Tzcntq(Register dst, const Operand& src) { |
| + if (CpuFeatures::IsSupported(BMI1)) { |
| + CpuFeatureScope scope(this, BMI1); |
| + tzcntq(dst, src); |
| + return; |
| + } |
| + Label not_zero_src; |
| + bsfq(dst, src); |
| + j(not_zero, ¬_zero_src, Label::kNear); |
| + Set(dst, 64); // The result of tzcnt is 32 if src = 0. |
|
titzer
2015/11/09 18:50:34
s/32/64/g
|
| + bind(¬_zero_src); |
| +} |
| + |
| + |
| void MacroAssembler::Tzcntl(Register dst, Register src) { |
| if (CpuFeatures::IsSupported(BMI1)) { |
| CpuFeatureScope scope(this, BMI1); |