зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1438727: [Part 5] Implement branchMul32 in MacroAssembler r=tcampbell
--HG-- extra : rebase_source : 62d3893aaa49e03994acbf48768adb23ba99a2e4
This commit is contained in:
Родитель
609848183d
Коммит
ef6b6a467f
|
@ -61,7 +61,7 @@ warmup(funSub3, [[7, false, 7], [7, true, 6], [false, 1, -1], [true,1,0]]);
|
||||||
|
|
||||||
// Mul: Int32+ Int32 Overflow
|
// Mul: Int32+ Int32 Overflow
|
||||||
var funMul1 = (a, b) => { return a * b; }
|
var funMul1 = (a, b) => { return a * b; }
|
||||||
warmup(funMul1, [[1, 2, 2], [10, 21, 210], [3, 4, 12], [2147483649, 2, 4294967298]]);
|
warmup(funMul1, [[1, 2, 2], [10, 21, 210], [3, 4, 12], [2147483649, 2, 4294967298], [1073741824, 1024, 1099511627776 ]]);
|
||||||
|
|
||||||
// Mul: Doubles
|
// Mul: Doubles
|
||||||
var funMul2 = (a, b) => { return a * b; }
|
var funMul2 = (a, b) => { return a * b; }
|
||||||
|
|
|
@ -1052,6 +1052,8 @@ class MacroAssembler : public MacroAssemblerSpecific
|
||||||
inline void branchAdd32(Condition cond, T src, Register dest, Label* label) PER_SHARED_ARCH;
|
inline void branchAdd32(Condition cond, T src, Register dest, Label* label) PER_SHARED_ARCH;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline void branchSub32(Condition cond, T src, Register dest, Label* label) PER_SHARED_ARCH;
|
inline void branchSub32(Condition cond, T src, Register dest, Label* label) PER_SHARED_ARCH;
|
||||||
|
template <typename T>
|
||||||
|
inline void branchMul32(Condition cond, T src, Register dest, Label* label) PER_SHARED_ARCH;
|
||||||
|
|
||||||
inline void decBranchPtr(Condition cond, Register lhs, Imm32 rhs, Label* label) PER_SHARED_ARCH;
|
inline void decBranchPtr(Condition cond, Register lhs, Imm32 rhs, Label* label) PER_SHARED_ARCH;
|
||||||
|
|
||||||
|
|
|
@ -1630,6 +1630,16 @@ MacroAssembler::branchSub32(Condition cond, T src, Register dest, Label* label)
|
||||||
j(cond, label);
|
j(cond, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
void
|
||||||
|
MacroAssembler::branchMul32(Condition cond, T src, Register dest, Label* label)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(cond == Assembler::Overflow);
|
||||||
|
ScratchRegisterScope scratch(*this);
|
||||||
|
Assembler::Condition overflow_cond = ma_check_mul(src, dest, dest, scratch, cond);
|
||||||
|
j(overflow_cond, label);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MacroAssembler::decBranchPtr(Condition cond, Register lhs, Imm32 rhs, Label* label)
|
MacroAssembler::decBranchPtr(Condition cond, Register lhs, Imm32 rhs, Label* label)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1308,6 +1308,15 @@ MacroAssembler::branchSub32(Condition cond, T src, Register dest, Label* label)
|
||||||
branch(cond, label);
|
branch(cond, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
void
|
||||||
|
MacroAssembler::branchMul32(Condition cond, T src, Register dest, Label* label)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(cond == Assembler::Overflow);
|
||||||
|
vixl::UseScratchRegisterScope temps(this);
|
||||||
|
mul32(src, dest, dest, label, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MacroAssembler::decBranchPtr(Condition cond, Register lhs, Imm32 rhs, Label* label)
|
MacroAssembler::decBranchPtr(Condition cond, Register lhs, Imm32 rhs, Label* label)
|
||||||
{
|
{
|
||||||
|
|
|
@ -639,6 +639,15 @@ MacroAssembler::branchSub32(Condition cond, T src, Register dest, Label* overflo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
void
|
||||||
|
MacroAssembler::branchMul32(Condition cond, T src, Register dest, Label* overflow)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(cond == Assembler::Overflow);
|
||||||
|
ma_mul_branch_overflow(dest, dest, src, overflow);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MacroAssembler::decBranchPtr(Condition cond, Register lhs, Imm32 rhs, Label* label)
|
MacroAssembler::decBranchPtr(Condition cond, Register lhs, Imm32 rhs, Label* label)
|
||||||
{
|
{
|
||||||
|
|
|
@ -659,6 +659,14 @@ MacroAssembler::branchSub32(Condition cond, T src, Register dest, Label* label)
|
||||||
j(cond, label);
|
j(cond, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
void
|
||||||
|
MacroAssembler::branchMul32(Condition cond, T src, Register dest, Label* label)
|
||||||
|
{
|
||||||
|
mul32(src, dest);
|
||||||
|
j(cond, label);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MacroAssembler::decBranchPtr(Condition cond, Register lhs, Imm32 rhs, Label* label)
|
MacroAssembler::decBranchPtr(Condition cond, Register lhs, Imm32 rhs, Label* label)
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче