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_x86_shared_Lowering_x86_shared_h 8 #define jit_x86_shared_Lowering_x86_shared_h 9 10 #include "jit/shared/Lowering-shared.h" 11 12 namespace js { 13 namespace jit { 14 15 class LIRGeneratorX86Shared : public LIRGeneratorShared { 16 protected: LIRGeneratorX86Shared(MIRGenerator * gen,MIRGraph & graph,LIRGraph & lirGraph)17 LIRGeneratorX86Shared(MIRGenerator* gen, MIRGraph& graph, LIRGraph& lirGraph) 18 : LIRGeneratorShared(gen, graph, lirGraph) {} 19 20 LTableSwitch* newLTableSwitch(const LAllocation& in, 21 const LDefinition& inputCopy, 22 MTableSwitch* ins); 23 LTableSwitchV* newLTableSwitchV(MTableSwitch* ins); 24 25 void lowerForShift(LInstructionHelper<1, 2, 0>* ins, MDefinition* mir, 26 MDefinition* lhs, MDefinition* rhs); 27 void lowerForALU(LInstructionHelper<1, 1, 0>* ins, MDefinition* mir, 28 MDefinition* input); 29 void lowerForALU(LInstructionHelper<1, 2, 0>* ins, MDefinition* mir, 30 MDefinition* lhs, MDefinition* rhs); 31 32 template <size_t Temps> 33 void lowerForShiftInt64( 34 LInstructionHelper<INT64_PIECES, INT64_PIECES + 1, Temps>* ins, 35 MDefinition* mir, MDefinition* lhs, MDefinition* rhs); 36 37 template <size_t Temps> 38 void lowerForFPU(LInstructionHelper<1, 2, Temps>* ins, MDefinition* mir, 39 MDefinition* lhs, MDefinition* rhs); 40 void lowerForBitAndAndBranch(LBitAndAndBranch* baab, MInstruction* mir, 41 MDefinition* lhs, MDefinition* rhs); 42 void lowerMulI(MMul* mul, MDefinition* lhs, MDefinition* rhs); 43 void lowerDivI(MDiv* div); 44 void lowerModI(MMod* mod); 45 void lowerUDiv(MDiv* div); 46 void lowerUMod(MMod* mod); 47 void lowerUrshD(MUrsh* mir); 48 void lowerTruncateDToInt32(MTruncateToInt32* ins); 49 void lowerTruncateFToInt32(MTruncateToInt32* ins); 50 void lowerCompareExchangeTypedArrayElement( 51 MCompareExchangeTypedArrayElement* ins, bool useI386ByteRegisters); 52 void lowerAtomicExchangeTypedArrayElement( 53 MAtomicExchangeTypedArrayElement* ins, bool useI386ByteRegisters); 54 void lowerAtomicTypedArrayElementBinop(MAtomicTypedArrayElementBinop* ins, 55 bool useI386ByteRegisters); 56 }; 57 58 } // namespace jit 59 } // namespace js 60 61 #endif /* jit_x86_shared_Lowering_x86_shared_h */ 62