Index: src/arm64/lithium-arm64.cc |
diff --git a/src/arm64/lithium-arm64.cc b/src/arm64/lithium-arm64.cc |
index 34c98241a5cb4093271853028656cf551d3fdb27..5b7ab6d4bfad8f2d372b703e4b9b5171c01cc7ff 100644 |
--- a/src/arm64/lithium-arm64.cc |
+++ b/src/arm64/lithium-arm64.cc |
@@ -2444,14 +2444,16 @@ LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
return DefineAsRegister(result); |
} |
case kMathFloor: { |
- ASSERT(instr->representation().IsInteger32()); |
ASSERT(instr->value()->representation().IsDouble()); |
- // TODO(jbramley): ARM64 can easily handle a double argument with frintm, |
- // but we're never asked for it here. At the moment, we fall back to the |
- // runtime if the result doesn't fit, like the other architectures. |
LOperand* input = UseRegisterAtStart(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 { |
+ ASSERT(instr->representation().IsDouble()); |
+ LMathFloorD* result = new(zone()) LMathFloorD(input); |
+ return DefineAsRegister(result); |
+ } |
} |
case kMathLog: { |
ASSERT(instr->representation().IsDouble()); |
@@ -2467,14 +2469,16 @@ LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
return DefineAsRegister(new(zone()) LMathPowHalf(input)); |
} |
case kMathRound: { |
- ASSERT(instr->representation().IsInteger32()); |
ASSERT(instr->value()->representation().IsDouble()); |
- // TODO(jbramley): As with kMathFloor, we can probably handle double |
- // results fairly easily, but we are never asked for them. |
LOperand* input = UseRegister(instr->value()); |
- LOperand* temp = FixedTemp(d24); // Choosen arbitrarily. |
- LMathRound* result = new(zone()) LMathRound(input, temp); |
- return AssignEnvironment(DefineAsRegister(result)); |
+ if (instr->representation().IsInteger32()) { |
+ LMathRoundI* result = new(zone()) LMathRoundI(input, FixedTemp(d24)); |
+ return AssignEnvironment(DefineAsRegister(result)); |
+ } else { |
+ ASSERT(instr->representation().IsDouble()); |
+ LMathRoundD* result = new(zone()) LMathRoundD(input); |
+ return DefineAsRegister(result); |
+ } |
} |
case kMathSqrt: { |
ASSERT(instr->representation().IsDouble()); |