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/. */
7 #ifndef jit_mips64_CodeGenerator_mips64_h
8 #define jit_mips64_CodeGenerator_mips64_h
10 #include "jit/mips-shared/CodeGenerator-mips-shared.h"
15 class CodeGeneratorMIPS64
: public CodeGeneratorMIPSShared
{
17 CodeGeneratorMIPS64(MIRGenerator
* gen
, LIRGraph
* graph
, MacroAssembler
* masm
)
18 : CodeGeneratorMIPSShared(gen
, graph
, masm
) {}
20 void testNullEmitBranch(Assembler::Condition cond
, const ValueOperand
& value
,
21 MBasicBlock
* ifTrue
, MBasicBlock
* ifFalse
) {
22 MOZ_ASSERT(value
.valueReg() != SecondScratchReg
);
23 masm
.splitTag(value
.valueReg(), SecondScratchReg
);
24 emitBranch(SecondScratchReg
, ImmTag(JSVAL_TAG_NULL
), cond
, ifTrue
, ifFalse
);
26 void testUndefinedEmitBranch(Assembler::Condition cond
,
27 const ValueOperand
& value
, MBasicBlock
* ifTrue
,
28 MBasicBlock
* ifFalse
) {
29 MOZ_ASSERT(value
.valueReg() != SecondScratchReg
);
30 masm
.splitTag(value
.valueReg(), SecondScratchReg
);
31 emitBranch(SecondScratchReg
, ImmTag(JSVAL_TAG_UNDEFINED
), cond
, ifTrue
,
34 void testObjectEmitBranch(Assembler::Condition cond
,
35 const ValueOperand
& value
, MBasicBlock
* ifTrue
,
36 MBasicBlock
* ifFalse
) {
37 MOZ_ASSERT(value
.valueReg() != SecondScratchReg
);
38 masm
.splitTag(value
.valueReg(), SecondScratchReg
);
39 emitBranch(SecondScratchReg
, ImmTag(JSVAL_TAG_OBJECT
), cond
, ifTrue
,
43 void emitBigIntDiv(LBigIntDiv
* ins
, Register dividend
, Register divisor
,
44 Register output
, Label
* fail
);
45 void emitBigIntMod(LBigIntMod
* ins
, Register dividend
, Register divisor
,
46 Register output
, Label
* fail
);
49 void emitWasmLoadI64(T
* ins
);
51 void emitWasmStoreI64(T
* ins
);
53 ValueOperand
ToValue(LInstruction
* ins
, size_t pos
);
54 ValueOperand
ToTempValue(LInstruction
* ins
, size_t pos
);
56 // Functions for LTestVAndBranch.
57 void splitTagForTest(const ValueOperand
& value
, ScratchTagScope
& tag
);
60 typedef CodeGeneratorMIPS64 CodeGeneratorSpecific
;
65 #endif /* jit_mips64_CodeGenerator_mips64_h */