Lowering-riscv64.h (4071B)
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_riscv64_Lowering_riscv64_h 8 #define jit_riscv64_Lowering_riscv64_h 9 10 #include "jit/shared/Lowering-shared.h" 11 12 namespace js { 13 namespace jit { 14 15 class LIRGeneratorRiscv64 : public LIRGeneratorShared { 16 protected: 17 LIRGeneratorRiscv64(MIRGenerator* gen, MIRGraph& graph, LIRGraph& lirGraph) 18 : LIRGeneratorShared(gen, graph, lirGraph) {} 19 20 LTableSwitch* newLTableSwitch(const LAllocation& in, 21 const LDefinition& inputCopy); 22 LTableSwitchV* newLTableSwitchV(const LBoxAllocation& in); 23 24 void lowerForShift(LInstructionHelper<1, 2, 0>* ins, MDefinition* mir, 25 MDefinition* lhs, MDefinition* rhs); 26 template <class LInstr> 27 void lowerForShiftInt64(LInstr* ins, MDefinition* mir, MDefinition* lhs, 28 MDefinition* rhs); 29 30 void lowerForALU(LInstructionHelper<1, 1, 0>* ins, MDefinition* mir, 31 MDefinition* input); 32 void lowerForALU(LInstructionHelper<1, 2, 0>* ins, MDefinition* mir, 33 MDefinition* lhs, MDefinition* rhs); 34 void lowerForALUInt64(LInstructionHelper<INT64_PIECES, INT64_PIECES, 0>* ins, 35 MDefinition* mir, MDefinition* input); 36 void lowerForALUInt64( 37 LInstructionHelper<INT64_PIECES, 2 * INT64_PIECES, 0>* ins, 38 MDefinition* mir, MDefinition* lhs, MDefinition* rhs); 39 void lowerForMulInt64(LMulI64* ins, MMul* mir, MDefinition* lhs, 40 MDefinition* rhs); 41 42 void lowerForFPU(LInstructionHelper<1, 1, 0>* ins, MDefinition* mir, 43 MDefinition* input); 44 void lowerForFPU(LInstructionHelper<1, 2, 0>* ins, MDefinition* mir, 45 MDefinition* lhs, MDefinition* rhs); 46 47 // Returns a box allocation. reg2 is ignored on 64-bit platforms. 48 LBoxAllocation useBoxFixed(MDefinition* mir, Register reg1, Register reg2, 49 bool useAtStart = false); 50 51 LAllocation useByteOpRegister(MDefinition* mir); 52 LAllocation useByteOpRegisterAtStart(MDefinition* mir); 53 LAllocation useByteOpRegisterOrNonDoubleConstant(MDefinition* mir); 54 55 LDefinition tempByteOpRegister(); 56 LDefinition tempToUnbox(); 57 58 bool needTempForPostBarrier() { return true; } 59 60 void lowerUntypedPhiInput(MPhi* phi, uint32_t inputPosition, LBlock* block, 61 size_t lirIndex); 62 void lowerInt64PhiInput(MPhi*, uint32_t, LBlock*, size_t); 63 void defineInt64Phi(MPhi*, size_t); 64 65 void lowerMulI(MMul* mul, MDefinition* lhs, MDefinition* rhs); 66 void lowerDivI(MDiv* div); 67 void lowerDivI64(MDiv* div); 68 void lowerModI(MMod* mod); 69 void lowerModI64(MMod* mod); 70 void lowerUDiv(MDiv* div); 71 void lowerUDivI64(MDiv* div); 72 void lowerUMod(MMod* mod); 73 void lowerUModI64(MMod* mod); 74 void lowerUrshD(MUrsh* mir); 75 void lowerPowOfTwoI(MPow* mir); 76 void lowerTruncateDToInt32(MTruncateToInt32* ins); 77 void lowerTruncateFToInt32(MTruncateToInt32* ins); 78 void lowerBuiltinInt64ToFloatingPoint(MBuiltinInt64ToFloatingPoint* ins); 79 void lowerWasmSelectI(MWasmSelect* select); 80 void lowerWasmSelectI64(MWasmSelect* select); 81 void lowerWasmBuiltinTruncateToInt64(MWasmBuiltinTruncateToInt64* ins); 82 void lowerWasmBuiltinTruncateToInt32(MWasmBuiltinTruncateToInt32* ins); 83 void lowerWasmBuiltinDivI64(MWasmBuiltinDivI64* div); 84 void lowerWasmBuiltinModI64(MWasmBuiltinModI64* mod); 85 86 void lowerBigIntPtrLsh(MBigIntPtrLsh* ins); 87 void lowerBigIntPtrRsh(MBigIntPtrRsh* ins); 88 void lowerBigIntPtrDiv(MBigIntPtrDiv* ins); 89 void lowerBigIntPtrMod(MBigIntPtrMod* ins); 90 91 void lowerAtomicLoad64(MLoadUnboxedScalar* ins); 92 void lowerAtomicStore64(MStoreUnboxedScalar* ins); 93 }; 94 95 typedef LIRGeneratorRiscv64 LIRGeneratorSpecific; 96 97 } // namespace jit 98 } // namespace js 99 100 #endif /* jit_riscv64_Lowering_riscv64_h */