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); |