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

Unified Diff: src/crankshaft/ppc/lithium-ppc.cc

Issue 1839643007: PPC: [crankshaft] Address the deoptimization loops of Math.floor, Math.round and Math.ceil. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix DEBUG Created 4 years, 9 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/ppc/lithium-ppc.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/ppc/lithium-ppc.cc
diff --git a/src/crankshaft/ppc/lithium-ppc.cc b/src/crankshaft/ppc/lithium-ppc.cc
index 0dbe7309e7d08fc253fab9eedc221a66bc3c7076..8100a1d0059615e9f3367670f43f0703b174f890 100644
--- a/src/crankshaft/ppc/lithium-ppc.cc
+++ b/src/crankshaft/ppc/lithium-ppc.cc
@@ -1140,20 +1140,32 @@ LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) {
LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) {
+ DCHECK(instr->value()->representation().IsDouble());
LOperand* input = UseRegister(instr->value());
- LMathFloor* result = new (zone()) LMathFloor(input);
- return AssignEnvironment(AssignPointerMap(DefineAsRegister(result)));
+ if (instr->representation().IsInteger32()) {
+ LMathFloorI* result = new (zone()) LMathFloorI(input);
+ return AssignEnvironment(AssignPointerMap(DefineAsRegister(result)));
+ } else {
+ DCHECK(instr->representation().IsDouble());
+ LMathFloorD* result = new (zone()) LMathFloorD(input);
+ return DefineAsRegister(result);
+ }
}
-
LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) {
+ DCHECK(instr->value()->representation().IsDouble());
LOperand* input = UseRegister(instr->value());
- LOperand* temp = TempDoubleRegister();
- LMathRound* result = new (zone()) LMathRound(input, temp);
- return AssignEnvironment(DefineAsRegister(result));
+ if (instr->representation().IsInteger32()) {
+ LOperand* temp = TempDoubleRegister();
+ LMathRoundI* result = new (zone()) LMathRoundI(input, temp);
+ return AssignEnvironment(AssignPointerMap(DefineAsRegister(result)));
+ } else {
+ DCHECK(instr->representation().IsDouble());
+ LMathRoundD* result = new (zone()) LMathRoundD(input);
+ return DefineAsRegister(result);
+ }
}
-
LInstruction* LChunkBuilder::DoMathFround(HUnaryMathOperation* instr) {
LOperand* input = UseRegister(instr->value());
LMathFround* result = new (zone()) LMathFround(input);
« no previous file with comments | « src/crankshaft/ppc/lithium-ppc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698