Chromium Code Reviews| Index: src/ia32/lithium-codegen-ia32.cc |
| diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
| index 71946afe068c625cd3b3343f2457fa8b7fef6330..3f5d78e41abc1bb698a3c76dae22a02379932a9b 100644 |
| --- a/src/ia32/lithium-codegen-ia32.cc |
| +++ b/src/ia32/lithium-codegen-ia32.cc |
| @@ -4123,6 +4123,21 @@ void LCodeGen::DoMathLog(LMathLog* instr) { |
| } |
| +void LCodeGen::DoMathClz32(LMathClz32* instr) { |
| + CpuFeatureScope scope(masm(), SSE2); |
| + Register input = ToRegister(instr->value()); |
| + Register result = ToRegister(instr->result()); |
| + Label not_zero_input; |
| + __ bsr(result, input); |
| + |
| + __ j(not_zero, ¬_zero_input); |
| + __ Set(result, Immediate(63)); // 64^31 == 32 |
|
Sven Panne
2014/02/19 13:24:08
63^31=32
|
| + |
| + __ bind(¬_zero_input); |
| + __ xor_(result, Immediate(31)); // for x in [0..31], 31^x == 31-x. |
| +} |
| + |
| + |
| void LCodeGen::DoMathExp(LMathExp* instr) { |
| CpuFeatureScope scope(masm(), SSE2); |
| XMMRegister input = ToDoubleRegister(instr->value()); |