Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3212)

Unified Diff: src/crankshaft/x64/lithium-codegen-x64.cc

Issue 2053893003: [builtins] Introduce proper base::ieee754::log. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: BUILD.gn Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/crankshaft/s390/lithium-codegen-s390.cc ('k') | src/crankshaft/x64/lithium-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/x64/lithium-codegen-x64.cc
diff --git a/src/crankshaft/x64/lithium-codegen-x64.cc b/src/crankshaft/x64/lithium-codegen-x64.cc
index 0746d3b434d593e5d640504ef1e3e5d9b839e958..d08b26c865752009f07406f7be0a4687b14096f0 100644
--- a/src/crankshaft/x64/lithium-codegen-x64.cc
+++ b/src/crankshaft/x64/lithium-codegen-x64.cc
@@ -3612,32 +3612,10 @@ void LCodeGen::DoMathExp(LMathExp* instr) {
void LCodeGen::DoMathLog(LMathLog* instr) {
- DCHECK(instr->value()->Equals(instr->result()));
- XMMRegister input_reg = ToDoubleRegister(instr->value());
- XMMRegister xmm_scratch = double_scratch0();
- Label positive, done, zero;
- __ Xorpd(xmm_scratch, xmm_scratch);
- __ Ucomisd(input_reg, xmm_scratch);
- __ j(above, &positive, Label::kNear);
- __ j(not_carry, &zero, Label::kNear);
- __ Pcmpeqd(input_reg, input_reg);
- __ jmp(&done, Label::kNear);
- __ bind(&zero);
- ExternalReference ninf =
- ExternalReference::address_of_negative_infinity();
- Operand ninf_operand = masm()->ExternalOperand(ninf);
- __ Movsd(input_reg, ninf_operand);
- __ jmp(&done, Label::kNear);
- __ bind(&positive);
- __ fldln2();
- __ subp(rsp, Immediate(kDoubleSize));
- __ Movsd(Operand(rsp, 0), input_reg);
- __ fld_d(Operand(rsp, 0));
- __ fyl2x();
- __ fstp_d(Operand(rsp, 0));
- __ Movsd(input_reg, Operand(rsp, 0));
- __ addp(rsp, Immediate(kDoubleSize));
- __ bind(&done);
+ DCHECK(ToDoubleRegister(instr->value()).is(xmm0));
+ DCHECK(ToDoubleRegister(instr->result()).is(xmm0));
+ __ PrepareCallCFunction(1);
+ __ CallCFunction(ExternalReference::ieee754_log_function(isolate()), 1);
}
« no previous file with comments | « src/crankshaft/s390/lithium-codegen-s390.cc ('k') | src/crankshaft/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698