| Index: src/a64/lithium-a64.h
|
| diff --git a/src/a64/lithium-a64.h b/src/a64/lithium-a64.h
|
| index 1bfbe85827259691ac9e439bfc1ef79c06e14995..e0fb522f393b42ad86a646bf21868f6bd4713550 100644
|
| --- a/src/a64/lithium-a64.h
|
| +++ b/src/a64/lithium-a64.h
|
| @@ -89,12 +89,14 @@ class LCodeGen;
|
| V(DebugBreak) \
|
| V(DeclareGlobals) \
|
| V(Deoptimize) \
|
| + V(DivByConstI) \
|
| V(DivByPowerOf2I) \
|
| V(DivI) \
|
| V(DoubleToIntOrSmi) \
|
| V(Drop) \
|
| V(Dummy) \
|
| V(DummyUse) \
|
| + V(FlooringDivByConstI) \
|
| V(FlooringDivByPowerOf2I) \
|
| V(FlooringDivI) \
|
| V(ForInCacheArray) \
|
| @@ -141,6 +143,7 @@ class LCodeGen;
|
| V(MathPowHalf) \
|
| V(MathRound) \
|
| V(MathSqrt) \
|
| + V(ModByConstI) \
|
| V(ModByPowerOf2I) \
|
| V(ModI) \
|
| V(MulConstIS) \
|
| @@ -1269,6 +1272,26 @@ class LDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> {
|
| };
|
|
|
|
|
| +class LDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 1> {
|
| + public:
|
| + LDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) {
|
| + inputs_[0] = dividend;
|
| + divisor_ = divisor;
|
| + temps_[0] = temp;
|
| + }
|
| +
|
| + LOperand* dividend() { return inputs_[0]; }
|
| + int32_t divisor() const { return divisor_; }
|
| + LOperand* temp() { return temps_[0]; }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i")
|
| + DECLARE_HYDROGEN_ACCESSOR(Div)
|
| +
|
| + private:
|
| + int32_t divisor_;
|
| +};
|
| +
|
| +
|
| class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
|
| public:
|
| LDivI(LOperand* left, LOperand* right, LOperand* temp) {
|
| @@ -1918,6 +1941,25 @@ class LFlooringDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> {
|
| };
|
|
|
|
|
| +class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 0> {
|
| + public:
|
| + LFlooringDivByConstI(LOperand* dividend, int32_t divisor) {
|
| + inputs_[0] = dividend;
|
| + divisor_ = divisor;
|
| + }
|
| +
|
| + LOperand* dividend() { return inputs_[0]; }
|
| + int32_t divisor() const { return divisor_; }
|
| + LOperand* temp1() { return temps_[0]; }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i")
|
| + DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
|
| +
|
| + private:
|
| + int32_t divisor_;
|
| +};
|
| +
|
| +
|
| class LFlooringDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> {
|
| public:
|
| LFlooringDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) {
|
| @@ -2009,6 +2051,26 @@ class LModByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> {
|
| };
|
|
|
|
|
| +class LModByConstI V8_FINAL : public LTemplateInstruction<1, 1, 1> {
|
| + public:
|
| + LModByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) {
|
| + inputs_[0] = dividend;
|
| + divisor_ = divisor;
|
| + temps_[0] = temp;
|
| + }
|
| +
|
| + LOperand* dividend() { return inputs_[0]; }
|
| + int32_t divisor() const { return divisor_; }
|
| + LOperand* temp() { return temps_[0]; }
|
| +
|
| + DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i")
|
| + DECLARE_HYDROGEN_ACCESSOR(Mod)
|
| +
|
| + private:
|
| + int32_t divisor_;
|
| +};
|
| +
|
| +
|
| class LModI V8_FINAL : public LTemplateInstruction<1, 2, 0> {
|
| public:
|
| LModI(LOperand* left, LOperand* right) {
|
| @@ -2900,10 +2962,13 @@ class LChunkBuilder V8_FINAL : public LChunkBuilderBase {
|
| #undef DECLARE_DO
|
|
|
| LInstruction* DoDivByPowerOf2I(HDiv* instr);
|
| + LInstruction* DoDivByConstI(HDiv* instr);
|
| LInstruction* DoDivI(HBinaryOperation* instr);
|
| LInstruction* DoModByPowerOf2I(HMod* instr);
|
| + LInstruction* DoModByConstI(HMod* instr);
|
| LInstruction* DoModI(HMod* instr);
|
| LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr);
|
| + LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr);
|
| LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr);
|
|
|
| static bool HasMagicNumberForDivision(int32_t divisor);
|
|
|