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

Unified Diff: src/crankshaft/hydrogen-instructions.cc

Issue 2073123002: [builtins] Introduce proper Float64Cos and Float64Sin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix missing breaks 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/hydrogen-instructions.h ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen-instructions.cc
diff --git a/src/crankshaft/hydrogen-instructions.cc b/src/crankshaft/hydrogen-instructions.cc
index 5d3c56d5b6f7d2232dbce9e98d85e77a13055d6c..ef50c64c4209a2b11bf05acd2fb0bdbba315c1e5 100644
--- a/src/crankshaft/hydrogen-instructions.cc
+++ b/src/crankshaft/hydrogen-instructions.cc
@@ -1115,10 +1115,14 @@ const char* HUnaryMathOperation::OpName() const {
return "round";
case kMathAbs:
return "abs";
+ case kMathCos:
+ return "cos";
case kMathLog:
return "log";
case kMathExp:
return "exp";
+ case kMathSin:
+ return "sin";
case kMathSqrt:
return "sqrt";
case kMathPowHalf:
@@ -3401,6 +3405,9 @@ HInstruction* HUnaryMathOperation::New(Isolate* isolate, Zone* zone,
}
if (std::isinf(d)) { // +Infinity and -Infinity.
switch (op) {
+ case kMathCos:
+ case kMathSin:
+ return H_CONSTANT_DOUBLE(std::numeric_limits<double>::quiet_NaN());
case kMathExp:
return H_CONSTANT_DOUBLE((d > 0.0) ? d : 0.0);
case kMathLog:
@@ -3422,10 +3429,14 @@ HInstruction* HUnaryMathOperation::New(Isolate* isolate, Zone* zone,
}
}
switch (op) {
+ case kMathCos:
+ return H_CONSTANT_DOUBLE(base::ieee754::cos(d));
case kMathExp:
return H_CONSTANT_DOUBLE(base::ieee754::exp(d));
case kMathLog:
return H_CONSTANT_DOUBLE(base::ieee754::log(d));
+ case kMathSin:
+ return H_CONSTANT_DOUBLE(base::ieee754::sin(d));
case kMathSqrt:
lazily_initialize_fast_sqrt(isolate);
return H_CONSTANT_DOUBLE(fast_sqrt(d, isolate));
« no previous file with comments | « src/crankshaft/hydrogen-instructions.h ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698