зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1203964 - Part 1: Move MacroAssembler::rshiftPtr into generic macro assembler. r=h4writer
--HG-- extra : rebase_source : 8c4f7494b43202c867f7215acac7a2e53bb24bc9
This commit is contained in:
Родитель
fa41a95f62
Коммит
bac0aaf828
|
@ -697,6 +697,12 @@ class MacroAssembler : public MacroAssemblerSpecific
|
|||
inline void xorPtr(Register src, Register dest) PER_ARCH;
|
||||
inline void xorPtr(Imm32 imm, Register dest) PER_ARCH;
|
||||
|
||||
// ===============================================================
|
||||
// Shift functions
|
||||
|
||||
inline void rshiftPtr(Imm32 imm, Register dest) PER_ARCH;
|
||||
inline void rshiftPtr(Imm32 imm, Register src, Register dest) DEFINED_ON(arm64);
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
public:
|
||||
|
||||
|
|
|
@ -128,6 +128,15 @@ MacroAssembler::xorPtr(Imm32 imm, Register dest)
|
|||
ma_eor(imm, dest);
|
||||
}
|
||||
|
||||
// ===============================================================
|
||||
// Shift functions
|
||||
|
||||
void
|
||||
MacroAssembler::rshiftPtr(Imm32 imm, Register dest)
|
||||
{
|
||||
ma_lsr(imm, dest, dest);
|
||||
}
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
// ===============================================================
|
||||
|
||||
|
|
|
@ -1716,9 +1716,6 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
|
|||
|
||||
void checkStackAlignment();
|
||||
|
||||
void rshiftPtr(Imm32 imm, Register dest) {
|
||||
ma_lsr(imm, dest, dest);
|
||||
}
|
||||
void rshiftPtrArithmetic(Imm32 imm, Register dest) {
|
||||
ma_asr(imm, dest, dest);
|
||||
}
|
||||
|
|
|
@ -141,9 +141,30 @@ MacroAssembler::xorPtr(Imm32 imm, Register dest)
|
|||
Eor(ARMRegister(dest, 64), ARMRegister(dest, 64), Operand(imm.value));
|
||||
}
|
||||
|
||||
// ===============================================================
|
||||
// Shift functions
|
||||
|
||||
void
|
||||
MacroAssembler::rshiftPtr(Imm32 imm, Register dest)
|
||||
{
|
||||
Lsr(ARMRegister(dest, 64), ARMRegister(dest, 64), imm.value);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::rshiftPtr(Imm32 imm, Register src, Register dest)
|
||||
{
|
||||
Lsr(ARMRegister(dest, 64), ARMRegister(src, 64), imm.value);
|
||||
}
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
// ===============================================================
|
||||
|
||||
void
|
||||
MacroAssemblerCompat::rshift64(Imm32 imm, Register64 dest)
|
||||
{
|
||||
asMasm().rshiftPtr(imm, dest.reg);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
MacroAssemblerCompat::andToStackPtr(T t)
|
||||
|
|
|
@ -1069,15 +1069,7 @@ class MacroAssemblerCompat : public vixl::MacroAssembler
|
|||
branchPtr(cond, lhs, getStackPointer(), label);
|
||||
}
|
||||
|
||||
void rshiftPtr(Imm32 imm, Register dest) {
|
||||
Lsr(ARMRegister(dest, 64), ARMRegister(dest, 64), imm.value);
|
||||
}
|
||||
void rshiftPtr(Imm32 imm, Register src, Register dest) {
|
||||
Lsr(ARMRegister(dest, 64), ARMRegister(src, 64), imm.value);
|
||||
}
|
||||
void rshift64(Imm32 imm, Register64 dest) {
|
||||
rshiftPtr(imm, dest.reg);
|
||||
}
|
||||
inline void rshift64(Imm32 imm, Register64 dest);
|
||||
|
||||
void rshiftPtrArithmetic(Imm32 imm, Register dest) {
|
||||
Asr(ARMRegister(dest, 64), ARMRegister(dest, 64), imm.value);
|
||||
|
|
|
@ -125,6 +125,15 @@ MacroAssembler::xorPtr(Imm32 imm, Register dest)
|
|||
ma_xor(dest, imm);
|
||||
}
|
||||
|
||||
// ===============================================================
|
||||
// Shift functions
|
||||
|
||||
void
|
||||
MacroAssembler::rshiftPtr(Imm32 imm, Register dest)
|
||||
{
|
||||
ma_srl(dest, dest, imm);
|
||||
}
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
// ===============================================================
|
||||
|
||||
|
|
|
@ -1349,9 +1349,6 @@ class MacroAssemblerMIPSCompat : public MacroAssemblerMIPS
|
|||
void restoreStackPointer();
|
||||
static void calculateAlignedStackPointer(void** stackPointer);
|
||||
|
||||
void rshiftPtr(Imm32 imm, Register dest) {
|
||||
ma_srl(dest, dest, imm);
|
||||
}
|
||||
void rshiftPtrArithmetic(Imm32 imm, Register dest) {
|
||||
ma_sra(dest, dest, imm);
|
||||
}
|
||||
|
|
|
@ -422,7 +422,6 @@ class MacroAssemblerNone : public Assembler
|
|||
template <typename T> void storeUnboxedValue(ConstantOrRegister, MIRType, T, MIRType) { MOZ_CRASH(); }
|
||||
template <typename T> void storeUnboxedPayload(ValueOperand value, T, size_t) { MOZ_CRASH(); }
|
||||
|
||||
void rshiftPtr(Imm32, Register) { MOZ_CRASH(); }
|
||||
void rshiftPtrArithmetic(Imm32, Register) { MOZ_CRASH(); }
|
||||
void lshiftPtr(Imm32, Register) { MOZ_CRASH(); }
|
||||
void convertUInt32ToDouble(Register, FloatRegister) { MOZ_CRASH(); }
|
||||
|
|
|
@ -66,6 +66,15 @@ MacroAssembler::xorPtr(Imm32 imm, Register dest)
|
|||
xorq(imm, dest);
|
||||
}
|
||||
|
||||
// ===============================================================
|
||||
// Shift functions
|
||||
|
||||
void
|
||||
MacroAssembler::rshiftPtr(Imm32 imm, Register dest)
|
||||
{
|
||||
shrq(imm, dest);
|
||||
}
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
// ===============================================================
|
||||
|
||||
|
|
|
@ -183,6 +183,16 @@ MacroAssemblerX64::finish()
|
|||
MacroAssemblerX86Shared::finish();
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerX64::branchPrivatePtr(Condition cond, Address lhs, Register ptr, Label* label)
|
||||
{
|
||||
ScratchRegisterScope scratch(asMasm());
|
||||
if (ptr != scratch)
|
||||
movePtr(ptr, scratch);
|
||||
asMasm().rshiftPtr(Imm32(1), scratch);
|
||||
branchPtr(cond, lhs, scratch, label);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerX64::handleFailureWithHandlerTail(void* handler)
|
||||
{
|
||||
|
|
|
@ -692,14 +692,7 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
|
|||
branchPtr(cond, lhs, ImmWord(uintptr_t(ptr.value) >> 1), label);
|
||||
}
|
||||
|
||||
void branchPrivatePtr(Condition cond, Address lhs, Register ptr, Label* label) {
|
||||
ScratchRegisterScope scratch(asMasm());
|
||||
if (ptr != scratch)
|
||||
movePtr(ptr, scratch);
|
||||
rshiftPtr(Imm32(1), scratch);
|
||||
branchPtr(cond, lhs, scratch, label);
|
||||
}
|
||||
|
||||
void branchPrivatePtr(Condition cond, Address lhs, Register ptr, Label* label);
|
||||
template <typename T, typename S>
|
||||
void branchPtr(Condition cond, const T& lhs, const S& ptr, Label* label) {
|
||||
cmpPtr(Operand(lhs), ptr);
|
||||
|
@ -857,9 +850,6 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
|
|||
void store64(Register64 src, Address address) {
|
||||
movq(src.reg, Operand(address));
|
||||
}
|
||||
void rshiftPtr(Imm32 imm, Register dest) {
|
||||
shrq(imm, dest);
|
||||
}
|
||||
void rshiftPtrArithmetic(Imm32 imm, Register dest) {
|
||||
sarq(imm, dest);
|
||||
}
|
||||
|
|
|
@ -67,6 +67,15 @@ MacroAssembler::xorPtr(Imm32 imm, Register dest)
|
|||
xorl(imm, dest);
|
||||
}
|
||||
|
||||
// ===============================================================
|
||||
// Shift functions
|
||||
|
||||
void
|
||||
MacroAssembler::rshiftPtr(Imm32 imm, Register dest)
|
||||
{
|
||||
shrl(imm, dest);
|
||||
}
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
// ===============================================================
|
||||
|
||||
|
|
|
@ -1122,9 +1122,6 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
|
|||
}
|
||||
}
|
||||
|
||||
void rshiftPtr(Imm32 imm, Register dest) {
|
||||
shrl(imm, dest);
|
||||
}
|
||||
void rshiftPtrArithmetic(Imm32 imm, Register dest) {
|
||||
sarl(imm, dest);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче