Debian Codegraph @

js/src/jit/x64/Lowering-x64.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_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 // Returns a box allocation. reg2 is ignored on 64-bit platforms.
35 LBoxAllocation useBoxFixed(MDefinition* mir, Register reg1, Register,
36 bool useAtStart = false);
37
38 // x86 has constraints on what registers can be formatted for 1-byte
39 // stores and loads; on x64 all registers are okay.
40 LAllocation useByteOpRegister(MDefinition* mir);
41 LAllocation useByteOpRegisterAtStart(MDefinition* mir);
42 LAllocation useByteOpRegisterOrNonDoubleConstant(MDefinition* mir);
43 LDefinition tempByteOpRegister();
44
45 LDefinition tempToUnbox();
46
47 bool needTempForPostBarrier() { return true; }
48
49 void lowerTruncateDToInt32(MTruncateToInt32* ins);
50 void lowerTruncateFToInt32(MTruncateToInt32* ins);
51 void lowerBuiltinInt64ToFloatingPoint(MBuiltinInt64ToFloatingPoint* ins);
52 void lowerWasmBuiltinTruncateToInt32(MWasmBuiltinTruncateToInt32* ins);
53 void lowerWasmBuiltinTruncateToInt64(MWasmBuiltinTruncateToInt64* ins);
54 void lowerDivI64(MDiv* div);
55 void lowerWasmBuiltinDivI64(MWasmBuiltinDivI64* div);
56 void lowerModI64(MMod* mod);
57 void lowerWasmBuiltinModI64(MWasmBuiltinModI64* mod);
58 void lowerUDivI64(MDiv* div);
59 void lowerUModI64(MMod* mod);
60
61 void lowerBigIntPtrDiv(MBigIntPtrDiv* ins);
62 void lowerBigIntPtrMod(MBigIntPtrMod* ins);
63
64 void lowerAtomicLoad64(MLoadUnboxedScalar* ins);
65 void lowerAtomicStore64(MStoreUnboxedScalar* ins);
66 };
67
68 using LIRGeneratorSpecific = LIRGeneratorX64;
69
70 } // namespace jit
71 } // namespace js
72
73 #endif /* jit_x64_Lowering_x64_h */