| Index: src/a64/lithium-a64.cc
|
| diff --git a/src/a64/lithium-a64.cc b/src/a64/lithium-a64.cc
|
| index 7b8f2f37f0681c54dac0e6b2d896b5383fdd4200..2880c7638a355500af317d6272fc06ea50caae0f 100644
|
| --- a/src/a64/lithium-a64.cc
|
| +++ b/src/a64/lithium-a64.cc
|
| @@ -1684,8 +1684,46 @@ LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) {
|
| }
|
|
|
|
|
| +HValue* LChunkBuilder::SimplifiedDividendForMathFloorOfDiv(HValue* dividend) {
|
| + // A value with an integer representation does not need to be transformed.
|
| + if (dividend->representation().IsInteger32()) {
|
| + return dividend;
|
| + // A change from an integer32 can be replaced by the integer32 value.
|
| + } else if (dividend->IsChange() &&
|
| + HChange::cast(dividend)->from().IsInteger32()) {
|
| + return HChange::cast(dividend)->value();
|
| + }
|
| + return NULL;
|
| +}
|
| +
|
| +
|
| +HValue* LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(HValue* divisor) {
|
| + // A value with an integer representation does not need to be transformed.
|
| + if (divisor->representation().IsInteger32()) {
|
| + return divisor;
|
| + // A change from an integer32 can be replaced by the integer32 value.
|
| + } else if (divisor->IsChange() &&
|
| + HChange::cast(divisor)->from().IsInteger32()) {
|
| + return HChange::cast(divisor)->value();
|
| + }
|
| +
|
| + if (divisor->IsConstant() && HConstant::cast(divisor)->HasInteger32Value()) {
|
| + HConstant* constant_val = HConstant::cast(divisor);
|
| + return constant_val->CopyToRepresentation(Representation::Integer32(),
|
| + divisor->block()->zone());
|
| + }
|
| +
|
| + return NULL;
|
| +}
|
| +
|
| +
|
| LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) {
|
| - UNIMPLEMENTED_INSTRUCTION();
|
| + HValue* right = instr->right();
|
| + LOperand* dividend = UseRegister(instr->left());
|
| + LOperand* divisor = UseRegister(right);
|
| + LOperand* remainder = TempRegister();
|
| + return AssignEnvironment(DefineAsRegister(
|
| + new(zone()) LMathFloorOfDiv(dividend, divisor, remainder)));
|
| }
|
|
|
|
|
|
|