Backed out changeset f8d78e70a6fc (bug 1245112)

This commit is contained in:
Tooru Fujisawa 2016-02-16 00:23:24 +09:00
Родитель 68ea88f0c0
Коммит e8a2383bf8
16 изменённых файлов: 93 добавлений и 91 удалений

Просмотреть файл

@ -525,15 +525,6 @@ MacroAssembler::canonicalizeFloat(FloatRegister reg)
bind(&notNaN);
}
void
MacroAssembler::canonicalizeDouble(FloatRegister reg)
{
Label notNaN;
branchDouble(DoubleOrdered, reg, reg, &notNaN);
loadConstantDouble(JS::GenericNaN(), reg);
bind(&notNaN);
}
template <typename T>
void
MacroAssembler::storeObjectOrNull(Register src, const T& dest)

Просмотреть файл

@ -846,9 +846,6 @@ class MacroAssembler : public MacroAssemblerSpecific
inline void branchTruncateFloat32(FloatRegister src, Register dest, Label* fail)
DEFINED_ON(arm, arm64, mips_shared, x86, x64);
inline void branchDouble(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
Label* label) PER_SHARED_ARCH;
template <class L>
inline void branchTest32(Condition cond, Register lhs, Register rhs, L label) PER_SHARED_ARCH;
template <class L>
@ -1123,7 +1120,12 @@ class MacroAssembler : public MacroAssemblerSpecific
bind(&done);
}
inline void canonicalizeDouble(FloatRegister reg);
void canonicalizeDouble(FloatRegister reg) {
Label notNaN;
branchDouble(DoubleOrdered, reg, reg, &notNaN);
loadConstantDouble(JS::GenericNaN(), reg);
bind(&notNaN);
}
inline void canonicalizeFloat(FloatRegister reg);

Просмотреть файл

@ -610,30 +610,6 @@ MacroAssembler::branchTruncateFloat32(FloatRegister src, Register dest, Label* f
ma_b(fail, Assembler::Equal);
}
void
MacroAssembler::branchDouble(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
Label* label)
{
compareDouble(lhs, rhs);
if (cond == DoubleNotEqual) {
// Force the unordered cases not to jump.
Label unordered;
ma_b(&unordered, VFP_Unordered);
ma_b(label, VFP_NotEqualOrUnordered);
bind(&unordered);
return;
}
if (cond == DoubleEqualOrUnordered) {
ma_b(label, VFP_Unordered);
ma_b(label, VFP_Equal);
return;
}
ma_b(label, ConditionFromDoubleCondition(cond));
}
template <class L>
void
MacroAssembler::branchTest32(Condition cond, Register lhs, Register rhs, L label)

Просмотреть файл

@ -2491,6 +2491,30 @@ MacroAssemblerARMCompat::compareDouble(FloatRegister lhs, FloatRegister rhs)
as_vmrs(pc);
}
void
MacroAssemblerARMCompat::branchDouble(DoubleCondition cond, FloatRegister lhs,
FloatRegister rhs, Label* label)
{
compareDouble(lhs, rhs);
if (cond == DoubleNotEqual) {
// Force the unordered cases not to jump.
Label unordered;
ma_b(&unordered, VFP_Unordered);
ma_b(label, VFP_NotEqualOrUnordered);
bind(&unordered);
return;
}
if (cond == DoubleEqualOrUnordered) {
ma_b(label, VFP_Unordered);
ma_b(label, VFP_Equal);
return;
}
ma_b(label, ConditionFromDoubleCondition(cond));
}
void
MacroAssemblerARMCompat::compareFloat(FloatRegister lhs, FloatRegister rhs)
{

Просмотреть файл

@ -1451,6 +1451,8 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
void simulatorStop(const char* msg);
void compareDouble(FloatRegister lhs, FloatRegister rhs);
void branchDouble(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
Label* label);
void compareFloat(FloatRegister lhs, FloatRegister rhs);

Просмотреть файл

@ -693,29 +693,6 @@ MacroAssembler::branchTruncateFloat32(FloatRegister src, Register dest, Label* f
And(dest64, dest64, Operand(0xffffffff));
}
void
MacroAssembler::branchDouble(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
Label* label)
{
compareDouble(cond, lhs, rhs);
switch (cond) {
case DoubleNotEqual: {
Label unordered;
// not equal *and* ordered
branch(Overflow, &unordered);
branch(NotEqual, label);
bind(&unordered);
break;
}
case DoubleEqualOrUnordered:
branch(Overflow, label);
branch(Equal, label);
break;
default:
branch(Condition(cond), label);
}
}
template <class L>
void
MacroAssembler::branchTest32(Condition cond, Register lhs, Register rhs, L label)

Просмотреть файл

@ -1582,6 +1582,25 @@ class MacroAssemblerCompat : public vixl::MacroAssembler
void compareDouble(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs) {
Fcmp(ARMFPRegister(lhs, 64), ARMFPRegister(rhs, 64));
}
void branchDouble(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs, Label* label) {
compareDouble(cond, lhs, rhs);
switch (cond) {
case DoubleNotEqual: {
Label unordered;
// not equal *and* ordered
branch(Overflow, &unordered);
branch(NotEqual, label);
bind(&unordered);
break;
}
case DoubleEqualOrUnordered:
branch(Overflow, label);
branch(Equal, label);
break;
default:
branch(Condition(cond), label);
}
}
void compareFloat(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs) {
Fcmp(ARMFPRegister(lhs, 32), ARMFPRegister(rhs, 32));

Просмотреть файл

@ -362,13 +362,6 @@ MacroAssembler::branchTruncateFloat32(FloatRegister src, Register dest, Label* f
ma_b(dest, Imm32(INT32_MAX), fail, Assembler::Equal);
}
void
MacroAssembler::branchDouble(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
Label* label)
{
ma_bc1d(lhs, rhs, label, cond);
}
template <class L>
void
MacroAssembler::branchTest32(Condition cond, Register lhs, Register rhs, L label)

Просмотреть файл

@ -1098,6 +1098,13 @@ MacroAssembler::clampDoubleToUint8(FloatRegister input, Register output)
bind(&done);
}
void
MacroAssemblerMIPSCompat::branchDouble(DoubleCondition cond, FloatRegister lhs,
FloatRegister rhs, Label* label)
{
ma_bc1d(lhs, rhs, label, cond);
}
// higher level tag testing code
Operand
MacroAssemblerMIPSCompat::ToPayload(Operand base)

Просмотреть файл

@ -1074,6 +1074,9 @@ class MacroAssemblerMIPSCompat : public MacroAssemblerMIPS
void breakpoint();
void branchDouble(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
Label* label);
void checkStackAlignment();
void alignStackPointer();

Просмотреть файл

@ -1238,6 +1238,13 @@ MacroAssembler::clampDoubleToUint8(FloatRegister input, Register output)
bind(&done);
}
void
MacroAssemblerMIPS64Compat::branchDouble(DoubleCondition cond, FloatRegister lhs,
FloatRegister rhs, Label* label)
{
ma_bc1d(lhs, rhs, label, cond);
}
void
MacroAssemblerMIPS64Compat::branchTestGCThing(Condition cond, const Address& address, Label* label)
{

Просмотреть файл

@ -1084,6 +1084,9 @@ class MacroAssemblerMIPS64Compat : public MacroAssemblerMIPS64
void breakpoint();
void branchDouble(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
Label* label);
void checkStackAlignment();
static void calculateAlignedStackPointer(void** stackPointer);

Просмотреть файл

@ -246,6 +246,7 @@ class MacroAssemblerNone : public Assembler
template <typename T, typename S> void branchAdd32(Condition, T, S, Label*) { MOZ_CRASH(); }
template <typename T, typename S> void branchSub32(Condition, T, S, Label*) { MOZ_CRASH(); }
template <typename T, typename S> void branchDouble(DoubleCondition, T, S, Label*) { MOZ_CRASH(); }
template <typename T, typename S> void decBranchPtr(Condition, T, S, Label*) { MOZ_CRASH(); }
template <typename T, typename S> void mov(T, S) { MOZ_CRASH(); }
template <typename T, typename S> void movq(T, S) { MOZ_CRASH(); }

Просмотреть файл

@ -318,29 +318,6 @@ MacroAssembler::branchFloat(DoubleCondition cond, FloatRegister lhs, FloatRegist
j(ConditionFromDoubleCondition(cond), label);
}
void
MacroAssembler::branchDouble(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
Label* label)
{
compareDouble(cond, lhs, rhs);
if (cond == DoubleEqual) {
Label unordered;
j(Parity, &unordered);
j(Equal, label);
bind(&unordered);
return;
}
if (cond == DoubleNotEqualOrUnordered) {
j(NotEqual, label);
j(Parity, label);
return;
}
MOZ_ASSERT(!(cond & DoubleConditionBitSpecial));
j(ConditionFromDoubleCondition(cond), label);
}
template <class L>
void
MacroAssembler::branchTest32(Condition cond, Register lhs, Register rhs, L label)

Просмотреть файл

@ -105,7 +105,7 @@ MacroAssemblerX86Shared::branchNegativeZero(FloatRegister reg,
zeroDouble(scratchDouble);
// If reg is non-zero, jump to nonZero.
asMasm().branchDouble(DoubleNotEqual, reg, scratchDouble, &nonZero);
branchDouble(DoubleNotEqual, reg, scratchDouble, &nonZero);
}
// Input register is either zero or negative zero. Retrieve sign of input.
vmovmskpd(reg, scratch);

Просмотреть файл

@ -109,6 +109,26 @@ class MacroAssemblerX86Shared : public Assembler
else
vucomisd(rhs, lhs);
}
void branchDouble(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs, Label* label)
{
compareDouble(cond, lhs, rhs);
if (cond == DoubleEqual) {
Label unordered;
j(Parity, &unordered);
j(Equal, label);
bind(&unordered);
return;
}
if (cond == DoubleNotEqualOrUnordered) {
j(NotEqual, label);
j(Parity, label);
return;
}
MOZ_ASSERT(!(cond & DoubleConditionBitSpecial));
j(ConditionFromDoubleCondition(cond), label);
}
void compareFloat(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs) {
if (cond & DoubleConditionBitInvert)