Debian Codegraph @

js/src/jit/x86/Lowering-x86.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_Lowering_x86_h
8 #define jit_x86_Lowering_x86_h
9
10 #include "jit/x86-shared/Lowering-x86-shared.h"
11
12 namespace js {
13 namespace jit {
14
15 class LIRGeneratorX86 : public LIRGeneratorX86Shared {
16 protected:
17 LIRGeneratorX86(MIRGenerator* gen, MIRGraph& graph, LIRGraph& lirGraph)
18 : LIRGeneratorX86Shared(gen, graph, lirGraph) {}
19
20 // Returns a box allocation with type set to reg1 and payload set to reg2.
21 LBoxAllocation useBoxFixed(MDefinition* mir, Register reg1, Register reg2,
22 bool useAtStart = false);
23
24 // It's a trap! On x86, the 1-byte store can only use one of
25 // {al,bl,cl,dl,ah,bh,ch,dh}. That means if the register allocator
26 // gives us one of {edi,esi,ebp,esp}, we're out of luck. (The formatter
27 // will assert on us.) Ideally, we'd just ask the register allocator to
28 // give us one of {al,bl,cl,dl}. For now, just useFixed(al).
29 LAllocation useByteOpRegister(MDefinition* mir);
30 LAllocation useByteOpRegisterAtStart(MDefinition* mir);
31 LAllocation useByteOpRegisterOrNonDoubleConstant(MDefinition* mir);
32 LDefinition tempByteOpRegister();
33
34 inline LDefinition tempToUnbox() { return LDefinition::BogusTemp(); }
35
36 bool needTempForPostBarrier() { return true; }
37
38 void lowerUntypedPhiInput(MPhi* phi, uint32_t inputPosition, LBlock* block,
39 size_t lirIndex);
40
41 void lowerInt64PhiInput(MPhi* phi, uint32_t inputPosition, LBlock* block,
42 size_t lirIndex);
43 void defineInt64Phi(MPhi* phi, size_t lirIndex);
44
45 void lowerForALUInt64(LInstructionHelper<INT64_PIECES, INT64_PIECES, 0>* ins,
46 MDefinition* mir, MDefinition* input);
47 void lowerForALUInt64(
48 LInstructionHelper<INT64_PIECES, 2 * INT64_PIECES, 0>* ins,
49 MDefinition* mir, MDefinition* lhs, MDefinition* rhs);
50 void lowerForMulInt64(LMulI64* ins, MMul* mir, MDefinition* lhs,
51 MDefinition* rhs);
52
53 void lowerTruncateDToInt32(MTruncateToInt32* ins);
54 void lowerTruncateFToInt32(MTruncateToInt32* ins);
55 void lowerBuiltinInt64ToFloatingPoint(MBuiltinInt64ToFloatingPoint* ins);
56 void lowerWasmBuiltinTruncateToInt32(MWasmBuiltinTruncateToInt32* ins);
57 void lowerWasmBuiltinTruncateToInt64(MWasmBuiltinTruncateToInt64* ins);
58 void lowerDivI64(MDiv* div);
59 void lowerWasmBuiltinDivI64(MWasmBuiltinDivI64* div);
60 void lowerModI64(MMod* mod);
61 void lowerWasmBuiltinModI64(MWasmBuiltinModI64* mod);
62 void lowerUDivI64(MDiv* div);
63 void lowerUModI64(MMod* mod);
64
65 void lowerBigIntPtrDiv(MBigIntPtrDiv* ins);
66 void lowerBigIntPtrMod(MBigIntPtrMod* ins);
67
68 void lowerAtomicLoad64(MLoadUnboxedScalar* ins);
69 void lowerAtomicStore64(MStoreUnboxedScalar* ins);
70
71 void lowerPhi(MPhi* phi);
72
73 public:
74 static bool allowTypedElementHoleCheck() { return true; }
75 };
76
77 using LIRGeneratorSpecific = LIRGeneratorX86;
78
79 } // namespace jit
80 } // namespace js
81
82 #endif /* jit_x86_Lowering_x86_h */