1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 2 * vim: set ts=8 sts=4 et sw=4 tw=99: 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_mips64_Lowering_mips64_h 8 #define jit_mips64_Lowering_mips64_h 9 10 #include "jit/mips-shared/Lowering-mips-shared.h" 11 12 namespace js { 13 namespace jit { 14 15 class LIRGeneratorMIPS64 : public LIRGeneratorMIPSShared { 16 protected: LIRGeneratorMIPS64(MIRGenerator * gen,MIRGraph & graph,LIRGraph & lirGraph)17 LIRGeneratorMIPS64(MIRGenerator* gen, MIRGraph& graph, LIRGraph& lirGraph) 18 : LIRGeneratorMIPSShared(gen, graph, lirGraph) {} 19 20 protected: 21 void lowerInt64PhiInput(MPhi*, uint32_t, LBlock*, size_t); 22 void defineInt64Phi(MPhi*, size_t); 23 24 // Returns a box allocation. reg2 is ignored on 64-bit platforms. 25 LBoxAllocation useBoxFixed(MDefinition* mir, Register reg1, Register reg2, 26 bool useAtStart = false); 27 tempToUnbox()28 inline LDefinition tempToUnbox() { return temp(); } 29 30 void lowerUntypedPhiInput(MPhi* phi, uint32_t inputPosition, LBlock* block, 31 size_t lirIndex); 32 void defineUntypedPhi(MPhi* phi, size_t lirIndex); 33 34 void lowerTruncateDToInt32(MTruncateToInt32* ins); 35 void lowerTruncateFToInt32(MTruncateToInt32* ins); 36 37 void lowerDivI64(MDiv* div); 38 void lowerModI64(MMod* mod); 39 void lowerUDivI64(MDiv* div); 40 void lowerUModI64(MMod* mod); 41 42 public: 43 void visitBox(MBox* box); 44 void visitUnbox(MUnbox* unbox); 45 void visitReturn(MReturn* ret); 46 void visitRandom(MRandom* ins); 47 void visitWasmTruncateToInt64(MWasmTruncateToInt64* ins); 48 void visitInt64ToFloatingPoint(MInt64ToFloatingPoint* ins); 49 }; 50 51 typedef LIRGeneratorMIPS64 LIRGeneratorSpecific; 52 53 } // namespace jit 54 } // namespace js 55 56 #endif /* jit_mips64_Lowering_mips64_h */ 57