Chromium Code Reviews| Index: src/ia32/lithium-codegen-ia32.cc | 
| =================================================================== | 
| --- src/ia32/lithium-codegen-ia32.cc (revision 7492) | 
| +++ src/ia32/lithium-codegen-ia32.cc (working copy) | 
| @@ -2777,9 +2777,31 @@ | 
| void LCodeGen::DoMathLog(LUnaryMathOperation* instr) { | 
| ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); | 
| - TranscendentalCacheStub stub(TranscendentalCache::LOG, | 
| - TranscendentalCacheStub::UNTAGGED); | 
| - CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr, false); | 
| + XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); | 
| 
 
fschneider
2011/04/04 13:05:54
Drive-by: for optimizal performance make sure to a
 
Rico
2011/04/05 07:12:45
Done.
 
 | 
| + NearLabel positive, done, zero, negative; | 
| + __ xorpd(xmm0, xmm0); | 
| + __ ucomisd(input_reg, xmm0); | 
| + __ j(above, &positive); | 
| + __ j(equal, &zero); | 
| + ExternalReference nan = ExternalReference::address_of_nan(); | 
| + __ movdbl(input_reg, Operand::StaticVariable(nan)); | 
| + __ jmp(&done); | 
| + __ bind(&zero); | 
| + __ push(Immediate(0xFFF00000)); | 
| + __ push(Immediate(0)); | 
| + __ movdbl(input_reg, Operand(esp, 0)); | 
| 
 
Lasse Reichstein
2011/04/04 13:38:23
You can load -Infinity into an XMM register withou
 
Rico
2011/04/05 07:12:45
No temp register
 
 | 
| + __ add(Operand(esp), Immediate(kDoubleSize)); | 
| + __ jmp(&done); | 
| + __ bind(&positive); | 
| + __ fldln2(); | 
| + __ sub(Operand(esp), Immediate(kDoubleSize)); | 
| + __ movdbl(Operand(esp, 0), input_reg); | 
| + __ fld_d(Operand(esp, 0)); | 
| + __ fyl2x(); | 
| + __ fstp_d(Operand(esp, 0)); | 
| + __ movdbl(input_reg, Operand(esp,0)); | 
| + __ add(Operand(esp), Immediate(kDoubleSize)); | 
| + __ bind(&done); | 
| } |