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

Unified Diff: src/hydrogen-instructions.cc

Issue 425943002: Inline Math.fround in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: arm64 port Created 6 years, 5 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/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 049d3e64d5fadb1ef9f44b9db4e38362f4f9a4b8..1e85ada0b811e976206eea779ad8498f99fa55d9 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -1203,14 +1203,24 @@ OStream& HCompareMap::PrintDataTo(OStream& os) const { // NOLINT
const char* HUnaryMathOperation::OpName() const {
switch (op()) {
- case kMathFloor: return "floor";
- case kMathRound: return "round";
- case kMathAbs: return "abs";
- case kMathLog: return "log";
- case kMathExp: return "exp";
- case kMathSqrt: return "sqrt";
- case kMathPowHalf: return "pow-half";
- case kMathClz32: return "clz32";
+ case kMathFloor:
+ return "floor";
+ case kMathFround:
+ return "fround";
+ case kMathRound:
+ return "round";
+ case kMathAbs:
+ return "abs";
+ case kMathLog:
+ return "log";
+ case kMathExp:
+ return "exp";
+ case kMathSqrt:
+ return "sqrt";
+ case kMathPowHalf:
+ return "pow-half";
+ case kMathClz32:
+ return "clz32";
default:
UNREACHABLE();
return NULL;
@@ -4135,6 +4145,7 @@ HInstruction* HUnaryMathOperation::New(
case kMathAbs:
return H_CONSTANT_DOUBLE((d > 0.0) ? d : -d);
case kMathRound:
+ case kMathFround:
case kMathFloor:
return H_CONSTANT_DOUBLE(d);
case kMathClz32:
@@ -4162,6 +4173,8 @@ HInstruction* HUnaryMathOperation::New(
// Exponent is not negative, the double value is already an integer.
if (Double(d).Exponent() >= 0) return H_CONSTANT_DOUBLE(d);
return H_CONSTANT_DOUBLE(std::floor(d + 0.5));
+ case kMathFround:
+ return H_CONSTANT_DOUBLE(static_cast<double>(static_cast<float>(d)));
case kMathFloor:
return H_CONSTANT_DOUBLE(std::floor(d));
case kMathClz32: {
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698