Lowering-x86-shared.h (2717B)
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: 17 LIRGeneratorX86Shared(MIRGenerator* gen, MIRGraph& graph, LIRGraph& lirGraph) 18 : LIRGeneratorShared(gen, graph, lirGraph) {} 19 20 LUse useShiftRegister(MDefinition* mir); 21 LUse useShiftRegisterAtStart(MDefinition* mir); 22 LDefinition tempShift(); 23 24 LTableSwitch* newLTableSwitch(const LAllocation& in, 25 const LDefinition& inputCopy); 26 LTableSwitchV* newLTableSwitchV(const LBoxAllocation& in); 27 28 void lowerForShift(LInstructionHelper<1, 2, 0>* ins, MDefinition* mir, 29 MDefinition* lhs, MDefinition* rhs); 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 35 void lowerForFPU(LInstructionHelper<1, 1, 0>* ins, MDefinition* mir, 36 MDefinition* input); 37 void lowerForFPU(LInstructionHelper<1, 2, 0>* ins, MDefinition* mir, 38 MDefinition* lhs, MDefinition* rhs); 39 40 void lowerMulI(MMul* mul, MDefinition* lhs, MDefinition* rhs); 41 void lowerDivI(MDiv* div); 42 void lowerModI(MMod* mod); 43 void lowerUDiv(MDiv* div); 44 void lowerUMod(MMod* mod); 45 void lowerUrshD(MUrsh* mir); 46 void lowerPowOfTwoI(MPow* mir); 47 void lowerWasmSelectI(MWasmSelect* select); 48 void lowerWasmSelectI64(MWasmSelect* select); 49 void lowerBigIntPtrLsh(MBigIntPtrLsh* ins); 50 void lowerBigIntPtrRsh(MBigIntPtrRsh* ins); 51 void lowerCompareExchangeTypedArrayElement( 52 MCompareExchangeTypedArrayElement* ins, bool useI386ByteRegisters); 53 void lowerAtomicExchangeTypedArrayElement( 54 MAtomicExchangeTypedArrayElement* ins, bool useI386ByteRegisters); 55 void lowerAtomicTypedArrayElementBinop(MAtomicTypedArrayElementBinop* ins, 56 bool useI386ByteRegisters); 57 58 #ifdef ENABLE_WASM_SIMD 59 bool isThreeOpAllowed() { return Assembler::HasAVX(); } 60 bool canFoldReduceSimd128AndBranch(wasm::SimdOp op); 61 bool canEmitWasmReduceSimd128AtUses(MWasmReduceSimd128* ins); 62 #endif 63 }; 64 65 } // namespace jit 66 } // namespace js 67 68 #endif /* jit_x86_shared_Lowering_x86_shared_h */