Debian Codegraph @

js/src/jit/x86-shared/Lowering-x86-shared.h

raw
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 template <class LInstr>
36 void lowerForShiftInt64(LInstr* ins, MDefinition* mir, MDefinition* lhs,
37 MDefinition* rhs);
38
39 template <size_t Temps>
40 void lowerForFPU(LInstructionHelper<1, 2, Temps>* ins, MDefinition* mir,
41 MDefinition* lhs, MDefinition* rhs);
42 void lowerNegI(MInstruction* ins, MDefinition* input);
43 void lowerNegI64(MInstruction* ins, MDefinition* input);
44 void lowerMulI(MMul* mul, MDefinition* lhs, MDefinition* rhs);
45 void lowerDivI(MDiv* div);
46 void lowerModI(MMod* mod);
47 void lowerUDiv(MDiv* div);
48 void lowerUMod(MMod* mod);
49 void lowerUrshD(MUrsh* mir);
50 void lowerPowOfTwoI(MPow* mir);
51 void lowerWasmSelectI(MWasmSelect* select);
52 void lowerWasmSelectI64(MWasmSelect* select);
53 void lowerBigIntPtrLsh(MBigIntPtrLsh* ins);
54 void lowerBigIntPtrRsh(MBigIntPtrRsh* ins);
55 void lowerCompareExchangeTypedArrayElement(
56 MCompareExchangeTypedArrayElement* ins, bool useI386ByteRegisters);
57 void lowerAtomicExchangeTypedArrayElement(
58 MAtomicExchangeTypedArrayElement* ins, bool useI386ByteRegisters);
59 void lowerAtomicTypedArrayElementBinop(MAtomicTypedArrayElementBinop* ins,
60 bool useI386ByteRegisters);
61
62 #ifdef ENABLE_WASM_SIMD
63 bool isThreeOpAllowed() { return Assembler::HasAVX(); }
64 bool canFoldReduceSimd128AndBranch(wasm::SimdOp op);
65 bool canEmitWasmReduceSimd128AtUses(MWasmReduceSimd128* ins);
66 #endif
67 };
68
69 } // namespace jit
70 } // namespace js
71
72 #endif /* jit_x86_shared_Lowering_x86_shared_h */