mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1245112 - Part 7: Move MacroAssembler::branchFloat into generic macro assembler. r=bbouvier
This commit is contained in:
parent
23fe314b98
commit
69765774c0
@ -516,6 +516,15 @@ MacroAssembler::addStackPtrTo(T t)
|
||||
|
||||
#endif // !JS_CODEGEN_ARM64
|
||||
|
||||
void
|
||||
MacroAssembler::canonicalizeFloat(FloatRegister reg)
|
||||
{
|
||||
Label notNaN;
|
||||
branchFloat(DoubleOrdered, reg, reg, ¬NaN);
|
||||
loadConstantFloat32(float(JS::GenericNaN()), reg);
|
||||
bind(¬NaN);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
MacroAssembler::storeObjectOrNull(Register src, const T& dest)
|
||||
|
@ -841,6 +841,9 @@ class MacroAssembler : public MacroAssemblerSpecific
|
||||
// boxed inside a js::Value, with a raw pointer (rhs).
|
||||
inline void branchPrivatePtr(Condition cond, const Address& lhs, Register rhs, Label* label) PER_ARCH;
|
||||
|
||||
inline void branchFloat(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>
|
||||
@ -1122,12 +1125,7 @@ class MacroAssembler : public MacroAssemblerSpecific
|
||||
bind(¬NaN);
|
||||
}
|
||||
|
||||
void canonicalizeFloat(FloatRegister reg) {
|
||||
Label notNaN;
|
||||
branchFloat(DoubleOrdered, reg, reg, ¬NaN);
|
||||
loadConstantFloat32(float(JS::GenericNaN()), reg);
|
||||
bind(¬NaN);
|
||||
}
|
||||
inline void canonicalizeFloat(FloatRegister reg);
|
||||
|
||||
template<typename T>
|
||||
void loadFromTypedArray(Scalar::Type arrayType, const T& src, AnyRegister dest, Register temp, Label* fail,
|
||||
|
@ -575,6 +575,30 @@ MacroAssembler::branchPrivatePtr(Condition cond, const Address& lhs, Register rh
|
||||
branchPtr(cond, lhs, rhs, label);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::branchFloat(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
|
||||
Label* label)
|
||||
{
|
||||
compareFloat(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)
|
||||
|
@ -2539,30 +2539,6 @@ MacroAssemblerARMCompat::compareFloat(FloatRegister lhs, FloatRegister rhs)
|
||||
as_vmrs(pc);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerARMCompat::branchFloat(DoubleCondition cond, FloatRegister lhs,
|
||||
FloatRegister rhs, Label* label)
|
||||
{
|
||||
compareFloat(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));
|
||||
}
|
||||
|
||||
Assembler::Condition
|
||||
MacroAssemblerARMCompat::testInt32(Assembler::Condition cond, const ValueOperand& value)
|
||||
{
|
||||
|
@ -1456,8 +1456,6 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
|
||||
Label* label);
|
||||
|
||||
void compareFloat(FloatRegister lhs, FloatRegister rhs);
|
||||
void branchFloat(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
|
||||
Label* label);
|
||||
|
||||
void checkStackAlignment();
|
||||
|
||||
|
@ -652,6 +652,29 @@ MacroAssembler::branchPrivatePtr(Condition cond, const Address& lhs, Register rh
|
||||
branchPtr(cond, lhs, scratch, label);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::branchFloat(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
|
||||
Label* label)
|
||||
{
|
||||
compareFloat(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)
|
||||
|
@ -1620,25 +1620,6 @@ class MacroAssemblerCompat : public vixl::MacroAssembler
|
||||
void compareFloat(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs) {
|
||||
Fcmp(ARMFPRegister(lhs, 32), ARMFPRegister(rhs, 32));
|
||||
}
|
||||
void branchFloat(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs, Label* label) {
|
||||
compareFloat(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 branchNegativeZero(FloatRegister reg, Register scratch, Label* label) {
|
||||
MOZ_CRASH("branchNegativeZero");
|
||||
|
@ -345,6 +345,13 @@ MacroAssembler::branchPtr(Condition cond, wasm::SymbolicAddress lhs, Register rh
|
||||
branchPtr(cond, SecondScratchReg, rhs, label);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::branchFloat(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
|
||||
Label* label)
|
||||
{
|
||||
ma_bc1s(lhs, rhs, label, cond);
|
||||
}
|
||||
|
||||
template <class L>
|
||||
void
|
||||
MacroAssembler::branchTest32(Condition cond, Register lhs, Register rhs, L label)
|
||||
|
@ -1116,13 +1116,6 @@ MacroAssemblerMIPSCompat::branchDouble(DoubleCondition cond, FloatRegister lhs,
|
||||
ma_bc1d(lhs, rhs, label, cond);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerMIPSCompat::branchFloat(DoubleCondition cond, FloatRegister lhs,
|
||||
FloatRegister rhs, Label* label)
|
||||
{
|
||||
ma_bc1s(lhs, rhs, label, cond);
|
||||
}
|
||||
|
||||
// higher level tag testing code
|
||||
Operand
|
||||
MacroAssemblerMIPSCompat::ToPayload(Operand base)
|
||||
|
@ -1078,9 +1078,6 @@ class MacroAssemblerMIPSCompat : public MacroAssemblerMIPS
|
||||
void branchDouble(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
|
||||
Label* label);
|
||||
|
||||
void branchFloat(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
|
||||
Label* label);
|
||||
|
||||
void checkStackAlignment();
|
||||
|
||||
void alignStackPointer();
|
||||
|
@ -1256,13 +1256,6 @@ MacroAssemblerMIPS64Compat::branchDouble(DoubleCondition cond, FloatRegister lhs
|
||||
ma_bc1d(lhs, rhs, label, cond);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerMIPS64Compat::branchFloat(DoubleCondition cond, FloatRegister lhs,
|
||||
FloatRegister rhs, Label* label)
|
||||
{
|
||||
ma_bc1s(lhs, rhs, label, cond);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerMIPS64Compat::branchTestGCThing(Condition cond, const Address& address, Label* label)
|
||||
{
|
||||
|
@ -1088,9 +1088,6 @@ class MacroAssemblerMIPS64Compat : public MacroAssemblerMIPS64
|
||||
void branchDouble(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
|
||||
Label* label);
|
||||
|
||||
void branchFloat(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
|
||||
Label* label);
|
||||
|
||||
void checkStackAlignment();
|
||||
|
||||
static void calculateAlignedStackPointer(void** stackPointer);
|
||||
|
@ -247,7 +247,6 @@ 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 branchFloat(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(); }
|
||||
|
@ -294,6 +294,30 @@ MacroAssembler::branchPtr(Condition cond, const Address& lhs, ImmWord rhs, Label
|
||||
branchPtrImpl(cond, lhs, rhs, label);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::branchFloat(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs,
|
||||
Label* label)
|
||||
{
|
||||
compareFloat(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)
|
||||
|
@ -136,26 +136,6 @@ class MacroAssemblerX86Shared : public Assembler
|
||||
else
|
||||
vucomiss(rhs, lhs);
|
||||
}
|
||||
void branchFloat(DoubleCondition cond, FloatRegister lhs, FloatRegister rhs, Label* label)
|
||||
{
|
||||
compareFloat(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 branchNegativeZero(FloatRegister reg, Register scratch, Label* label, bool maybeNonZero = true);
|
||||
void branchNegativeZeroFloat32(FloatRegister reg, Register scratch, Label* label);
|
||||
|
Loading…
Reference in New Issue
Block a user