Chromium Code Reviews| Index: src/x64/lithium-codegen-x64.cc |
| diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
| index a94dcee2271d2efd696ea09cb3162b18cb87a44d..96ced3d9b65a35990069605c32abb5d2c7afa43a 100644 |
| --- a/src/x64/lithium-codegen-x64.cc |
| +++ b/src/x64/lithium-codegen-x64.cc |
| @@ -3729,6 +3729,20 @@ void LCodeGen::DoMathLog(LMathLog* instr) { |
| } |
| +void LCodeGen::DoMathClz32(LMathClz32* instr) { |
| + Register input = ToRegister(instr->value()); |
| + Register result = ToRegister(instr->result()); |
| + Label not_zero_input; |
| + __ bsrl(result, input); |
| + |
| + __ j(not_zero, ¬_zero_input); |
| + __ Set(result, 63); // 64^31 == 32 |
|
Sven Panne
2014/02/19 13:24:08
63^31=32
|
| + |
| + __ bind(¬_zero_input); |
| + __ xorl(result, Immediate(31)); // for x in [0..31], 31^x == 31-x. |
| +} |
| + |
| + |
| void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { |
| ASSERT(ToRegister(instr->context()).is(rsi)); |
| ASSERT(ToRegister(instr->function()).is(rdi)); |