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

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

Issue 2105613002: X87: [builtins] Introduce proper Float64Cos and Float64Sin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/compiler/x87/code-generator-x87.cc ('k') | src/crankshaft/x87/lithium-x87.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/x87/lithium-codegen-x87.cc
diff --git a/src/crankshaft/x87/lithium-codegen-x87.cc b/src/crankshaft/x87/lithium-codegen-x87.cc
index 740812e5fc2ef788a5f4c32fa550384ffe1b3a40..d21b34991c015b198911ea5ca7ae2e22f81d0adf 100644
--- a/src/crankshaft/x87/lithium-codegen-x87.cc
+++ b/src/crankshaft/x87/lithium-codegen-x87.cc
@@ -3697,6 +3697,33 @@ void LCodeGen::DoMathClz32(LMathClz32* instr) {
__ Lzcnt(result, input);
}
+void LCodeGen::DoMathCos(LMathCos* instr) {
+ X87Register result = ToX87Register(instr->result());
+ X87Register input_reg = ToX87Register(instr->value());
+ __ fld(x87_stack_.st(input_reg));
+
+ // Pass one double as argument on the stack.
+ __ PrepareCallCFunction(2, eax);
+ __ fstp_d(MemOperand(esp, 0));
+ X87PrepareToWrite(result);
+ __ CallCFunction(ExternalReference::ieee754_cos_function(isolate()), 2);
+ // Return value is in st(0) on ia32.
+ X87CommitWrite(result);
+}
+
+void LCodeGen::DoMathSin(LMathSin* instr) {
+ X87Register result = ToX87Register(instr->result());
+ X87Register input_reg = ToX87Register(instr->value());
+ __ fld(x87_stack_.st(input_reg));
+
+ // Pass one double as argument on the stack.
+ __ PrepareCallCFunction(2, eax);
+ __ fstp_d(MemOperand(esp, 0));
+ X87PrepareToWrite(result);
+ __ CallCFunction(ExternalReference::ieee754_sin_function(isolate()), 2);
+ // Return value is in st(0) on ia32.
+ X87CommitWrite(result);
+}
void LCodeGen::DoMathExp(LMathExp* instr) {
X87Register result = ToX87Register(instr->result());
« no previous file with comments | « src/compiler/x87/code-generator-x87.cc ('k') | src/crankshaft/x87/lithium-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698