Debian Codegraph @

js/src/jit/loong64/Lowering-loong64.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_loong64_Lowering_loong64_h
8 #define jit_loong64_Lowering_loong64_h
9
10 #include "jit/shared/Lowering-shared.h"
11
12 namespace js {
13 namespace jit {
14
15 class LIRGeneratorLOONG64 : public LIRGeneratorShared {
16 protected:
17 LIRGeneratorLOONG64(MIRGenerator* gen, MIRGraph& graph, LIRGraph& lirGraph)
18 : LIRGeneratorShared(gen, graph, lirGraph) {}
19
20 LTableSwitch* newLTableSwitch(const LAllocation& in,
21 const LDefinition& inputCopy);
22 LTableSwitchV* newLTableSwitchV(const LBoxAllocation& in);
23
24 void lowerForShift(LInstructionHelper<1, 2, 0>* ins, MDefinition* mir,
25 MDefinition* lhs, MDefinition* rhs);
26 template <class LInstr>
27 void lowerForShiftInt64(LInstr* ins, MDefinition* mir, MDefinition* lhs,
28 MDefinition* rhs);
29
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 void lowerForALUInt64(LInstructionHelper<INT64_PIECES, INT64_PIECES, 0>* ins,
35 MDefinition* mir, MDefinition* input);
36 void lowerForALUInt64(
37 LInstructionHelper<INT64_PIECES, 2 * INT64_PIECES, 0>* ins,
38 MDefinition* mir, MDefinition* lhs, MDefinition* rhs);
39 void lowerForMulInt64(LMulI64* ins, MMul* mir, MDefinition* lhs,
40 MDefinition* rhs);
41
42 void lowerForFPU(LInstructionHelper<1, 1, 0>* ins, MDefinition* mir,
43 MDefinition* src);
44 template <size_t Temps>
45 void lowerForFPU(LInstructionHelper<1, 2, Temps>* ins, MDefinition* mir,
46 MDefinition* lhs, MDefinition* rhs);
47
48 // Returns a box allocation. reg2 is ignored on 64-bit platforms.
49 LBoxAllocation useBoxFixed(MDefinition* mir, Register reg1, Register reg2,
50 bool useAtStart = false);
51
52 LAllocation useByteOpRegister(MDefinition* mir);
53 LAllocation useByteOpRegisterAtStart(MDefinition* mir);
54 LAllocation useByteOpRegisterOrNonDoubleConstant(MDefinition* mir);
55 LDefinition tempByteOpRegister();
56
57 LDefinition tempToUnbox();
58
59 bool needTempForPostBarrier() { return true; }
60
61 void lowerUntypedPhiInput(MPhi* phi, uint32_t inputPosition, LBlock* block,
62 size_t lirIndex);
63 void lowerInt64PhiInput(MPhi*, uint32_t, LBlock*, size_t);
64 void defineInt64Phi(MPhi*, size_t);
65
66 void lowerNegI(MInstruction* ins, MDefinition* input);
67 void lowerNegI64(MInstruction* ins, MDefinition* input);
68 void lowerMulI(MMul* mul, MDefinition* lhs, MDefinition* rhs);
69 void lowerDivI(MDiv* div);
70 void lowerDivI64(MDiv* div);
71 void lowerModI(MMod* mod);
72 void lowerModI64(MMod* mod);
73 void lowerUDiv(MDiv* div);
74 void lowerUDivI64(MDiv* div);
75 void lowerUMod(MMod* mod);
76 void lowerUModI64(MMod* mod);
77 void lowerUrshD(MUrsh* mir);
78 void lowerPowOfTwoI(MPow* mir);
79 void lowerBigIntPtrDiv(MBigIntPtrDiv* ins);
80 void lowerBigIntPtrMod(MBigIntPtrMod* ins);
81 void lowerBigIntPtrLsh(MBigIntPtrLsh* ins);
82 void lowerBigIntPtrRsh(MBigIntPtrRsh* ins);
83 void lowerTruncateDToInt32(MTruncateToInt32* ins);
84 void lowerTruncateFToInt32(MTruncateToInt32* ins);
85 void lowerBuiltinInt64ToFloatingPoint(MBuiltinInt64ToFloatingPoint* ins);
86 void lowerWasmSelectI(MWasmSelect* select);
87 void lowerWasmSelectI64(MWasmSelect* select);
88 void lowerWasmBuiltinTruncateToInt64(MWasmBuiltinTruncateToInt64* ins);
89 void lowerWasmBuiltinTruncateToInt32(MWasmBuiltinTruncateToInt32* ins);
90 void lowerWasmBuiltinDivI64(MWasmBuiltinDivI64* div);
91 void lowerWasmBuiltinModI64(MWasmBuiltinModI64* mod);
92
93 void lowerAtomicLoad64(MLoadUnboxedScalar* ins);
94 void lowerAtomicStore64(MStoreUnboxedScalar* ins);
95 };
96
97 typedef LIRGeneratorLOONG64 LIRGeneratorSpecific;
98
99 } // namespace jit
100 } // namespace js
101
102 #endif /* jit_loong64_Lowering_loong64_h */