Lowering-x64.h (3021B)
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_x64_Lowering_x64_h 8 #define jit_x64_Lowering_x64_h 9 10 #include "jit/x86-shared/Lowering-x86-shared.h" 11 12 namespace js { 13 namespace jit { 14 15 class LIRGeneratorX64 : public LIRGeneratorX86Shared { 16 protected: 17 LIRGeneratorX64(MIRGenerator* gen, MIRGraph& graph, LIRGraph& lirGraph) 18 : LIRGeneratorX86Shared(gen, graph, lirGraph) {} 19 20 void lowerUntypedPhiInput(MPhi* phi, uint32_t inputPosition, LBlock* block, 21 size_t lirIndex); 22 void lowerInt64PhiInput(MPhi* phi, uint32_t inputPosition, LBlock* block, 23 size_t lirIndex); 24 void defineInt64Phi(MPhi* phi, size_t lirIndex); 25 26 void lowerForALUInt64(LInstructionHelper<INT64_PIECES, INT64_PIECES, 0>* ins, 27 MDefinition* mir, MDefinition* input); 28 void lowerForALUInt64( 29 LInstructionHelper<INT64_PIECES, 2 * INT64_PIECES, 0>* ins, 30 MDefinition* mir, MDefinition* lhs, MDefinition* rhs); 31 void lowerForMulInt64(LMulI64* ins, MMul* mir, MDefinition* lhs, 32 MDefinition* rhs); 33 34 template <class LInstr> 35 void lowerForShiftInt64(LInstr* ins, MDefinition* mir, MDefinition* lhs, 36 MDefinition* rhs); 37 38 // Returns a box allocation. reg2 is ignored on 64-bit platforms. 39 LBoxAllocation useBoxFixed(MDefinition* mir, Register reg1, Register, 40 bool useAtStart = false); 41 42 // x86 has constraints on what registers can be formatted for 1-byte 43 // stores and loads; on x64 all registers are okay. 44 LAllocation useByteOpRegister(MDefinition* mir); 45 LAllocation useByteOpRegisterAtStart(MDefinition* mir); 46 LAllocation useByteOpRegisterOrNonDoubleConstant(MDefinition* mir); 47 LDefinition tempByteOpRegister(); 48 49 LDefinition tempToUnbox(); 50 51 bool needTempForPostBarrier() { return true; } 52 53 void lowerTruncateDToInt32(MTruncateToInt32* ins); 54 void lowerTruncateFToInt32(MTruncateToInt32* ins); 55 void lowerBuiltinInt64ToFloatingPoint(MBuiltinInt64ToFloatingPoint* ins); 56 void lowerWasmBuiltinTruncateToInt32(MWasmBuiltinTruncateToInt32* ins); 57 void lowerWasmBuiltinTruncateToInt64(MWasmBuiltinTruncateToInt64* ins); 58 void lowerDivI64(MDiv* div); 59 void lowerWasmBuiltinDivI64(MWasmBuiltinDivI64* div); 60 void lowerModI64(MMod* mod); 61 void lowerWasmBuiltinModI64(MWasmBuiltinModI64* mod); 62 void lowerUDivI64(MDiv* div); 63 void lowerUModI64(MMod* mod); 64 65 void lowerBigIntPtrDiv(MBigIntPtrDiv* ins); 66 void lowerBigIntPtrMod(MBigIntPtrMod* ins); 67 68 void lowerAtomicLoad64(MLoadUnboxedScalar* ins); 69 void lowerAtomicStore64(MStoreUnboxedScalar* ins); 70 }; 71 72 using LIRGeneratorSpecific = LIRGeneratorX64; 73 74 } // namespace jit 75 } // namespace js 76 77 #endif /* jit_x64_Lowering_x64_h */