Lowering-mips-shared.h (3154B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * vim: set ts=8 sts=2 et sw=2 tw=80: 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef jit_mips_shared_Lowering_mips_shared_h 8 #define jit_mips_shared_Lowering_mips_shared_h 9 10 #include "jit/shared/Lowering-shared.h" 11 12 namespace js { 13 namespace jit { 14 15 class LIRGeneratorMIPSShared : public LIRGeneratorShared { 16 protected: 17 LIRGeneratorMIPSShared(MIRGenerator* gen, MIRGraph& graph, LIRGraph& lirGraph) 18 : LIRGeneratorShared(gen, graph, lirGraph) {} 19 20 // x86 has constraints on what registers can be formatted for 1-byte 21 // stores and loads; on MIPS all registers are okay. 22 LAllocation useByteOpRegister(MDefinition* mir); 23 LAllocation useByteOpRegisterAtStart(MDefinition* mir); 24 LAllocation useByteOpRegisterOrNonDoubleConstant(MDefinition* mir); 25 LDefinition tempByteOpRegister(); 26 27 bool needTempForPostBarrier() { return false; } 28 29 void lowerForShift(LInstructionHelper<1, 2, 0>* ins, MDefinition* mir, 30 MDefinition* lhs, MDefinition* rhs); 31 void lowerUrshD(MUrsh* mir); 32 33 void lowerPowOfTwoI(MPow* mir); 34 35 void lowerForALU(LInstructionHelper<1, 1, 0>* ins, MDefinition* mir, 36 MDefinition* input); 37 void lowerForALU(LInstructionHelper<1, 2, 0>* ins, MDefinition* mir, 38 MDefinition* lhs, MDefinition* rhs); 39 40 void lowerForALUInt64(LInstructionHelper<INT64_PIECES, INT64_PIECES, 0>* ins, 41 MDefinition* mir, MDefinition* input); 42 void lowerForALUInt64( 43 LInstructionHelper<INT64_PIECES, 2 * INT64_PIECES, 0>* ins, 44 MDefinition* mir, MDefinition* lhs, MDefinition* rhs); 45 void lowerForMulInt64(LMulI64* ins, MMul* mir, MDefinition* lhs, 46 MDefinition* rhs); 47 template <class LInstr> 48 void lowerForShiftInt64(LInstr* ins, MDefinition* mir, MDefinition* lhs, 49 MDefinition* rhs); 50 51 void lowerForFPU(LInstructionHelper<1, 1, 0>* ins, MDefinition* mir, 52 MDefinition* input); 53 void lowerForFPU(LInstructionHelper<1, 2, 0>* ins, MDefinition* mir, 54 MDefinition* lhs, MDefinition* rhs); 55 56 void lowerWasmBuiltinTruncateToInt32(MWasmBuiltinTruncateToInt32* ins); 57 void lowerDivI(MDiv* div); 58 void lowerModI(MMod* mod); 59 void lowerMulI(MMul* mul, MDefinition* lhs, MDefinition* rhs); 60 void lowerUDiv(MDiv* div); 61 void lowerUMod(MMod* mod); 62 void lowerWasmSelectI(MWasmSelect* select); 63 void lowerWasmSelectI64(MWasmSelect* select); 64 65 void lowerBigIntPtrLsh(MBigIntPtrLsh* ins); 66 void lowerBigIntPtrRsh(MBigIntPtrRsh* ins); 67 void lowerBigIntPtrDiv(MBigIntPtrDiv* ins); 68 void lowerBigIntPtrMod(MBigIntPtrMod* ins); 69 70 LTableSwitch* newLTableSwitch(const LAllocation& in, 71 const LDefinition& inputCopy); 72 LTableSwitchV* newLTableSwitchV(const LBoxAllocation& in); 73 74 void lowerPhi(MPhi* phi); 75 }; 76 77 } // namespace jit 78 } // namespace js 79 80 #endif /* jit_mips_shared_Lowering_mips_shared_h */