зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1203964 - Part 4: Move MacroAssembler::lshiftPtr into generic macro assembler. r=nbp
--HG-- extra : rebase_source : 5f74ff1b2ea0cc5f6869119b8beb19f07c5cfd59
This commit is contained in:
Родитель
8250d9dc2c
Коммит
bb6e2b2e1a
|
@ -700,6 +700,8 @@ class MacroAssembler : public MacroAssemblerSpecific
|
|||
// ===============================================================
|
||||
// Shift functions
|
||||
|
||||
inline void lshiftPtr(Imm32 imm, Register dest) PER_ARCH;
|
||||
|
||||
inline void rshiftPtr(Imm32 imm, Register dest) PER_ARCH;
|
||||
inline void rshiftPtr(Imm32 imm, Register src, Register dest) DEFINED_ON(arm64);
|
||||
|
||||
|
|
|
@ -131,6 +131,12 @@ MacroAssembler::xorPtr(Imm32 imm, Register dest)
|
|||
// ===============================================================
|
||||
// Shift functions
|
||||
|
||||
void
|
||||
MacroAssembler::lshiftPtr(Imm32 imm, Register dest)
|
||||
{
|
||||
ma_lsl(imm, dest, dest);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::rshiftPtr(Imm32 imm, Register dest)
|
||||
{
|
||||
|
|
|
@ -1716,9 +1716,6 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
|
|||
|
||||
void checkStackAlignment();
|
||||
|
||||
void lshiftPtr(Imm32 imm, Register dest) {
|
||||
ma_lsl(imm, dest, dest);
|
||||
}
|
||||
void lshift64(Imm32 imm, Register64 dest) {
|
||||
as_mov(dest.high, lsl(dest.high, imm.value));
|
||||
as_orr(dest.high, dest.high, lsr(dest.low, 32 - imm.value));
|
||||
|
|
|
@ -144,6 +144,12 @@ MacroAssembler::xorPtr(Imm32 imm, Register dest)
|
|||
// ===============================================================
|
||||
// Shift functions
|
||||
|
||||
void
|
||||
MacroAssembler::lshiftPtr(Imm32 imm, Register dest)
|
||||
{
|
||||
Lsl(ARMRegister(dest, 64), ARMRegister(dest, 64), imm.value);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::rshiftPtr(Imm32 imm, Register dest)
|
||||
{
|
||||
|
@ -171,6 +177,12 @@ MacroAssembler::rshift64(Imm32 imm, Register64 dest)
|
|||
//}}} check_macroassembler_style
|
||||
// ===============================================================
|
||||
|
||||
void
|
||||
MacroAssemblerCompat::lshift64(Imm32 imm, Register64 dest)
|
||||
{
|
||||
asMasm().lshiftPtr(imm, dest.reg);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
MacroAssemblerCompat::andToStackPtr(T t)
|
||||
|
|
|
@ -124,6 +124,13 @@ MacroAssemblerCompat::movePatchablePtr(ImmWord ptr, Register dest)
|
|||
(uint8_t*)&instructionScratch, literalAddr);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerCompat::loadPrivate(const Address& src, Register dest)
|
||||
{
|
||||
loadPtr(src, dest);
|
||||
asMasm().lshiftPtr(Imm32(1), dest);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerCompat::handleFailureWithHandlerTail(void* handler)
|
||||
{
|
||||
|
|
|
@ -853,10 +853,7 @@ class MacroAssemblerCompat : public vixl::MacroAssembler
|
|||
|
||||
Ldr(dest64, MemOperand(ARMRegister(base, 64), index64, vixl::LSL, scale));
|
||||
}
|
||||
void loadPrivate(const Address& src, Register dest) {
|
||||
loadPtr(src, dest);
|
||||
lshiftPtr(Imm32(1), dest);
|
||||
}
|
||||
void loadPrivate(const Address& src, Register dest);
|
||||
|
||||
void store8(Register src, const Address& address) {
|
||||
Strb(ARMRegister(src, 32), MemOperand(ARMRegister(address.base, 64), address.offset));
|
||||
|
@ -1069,12 +1066,7 @@ class MacroAssemblerCompat : public vixl::MacroAssembler
|
|||
branchPtr(cond, lhs, getStackPointer(), label);
|
||||
}
|
||||
|
||||
void lshiftPtr(Imm32 imm, Register dest) {
|
||||
Lsl(ARMRegister(dest, 64), ARMRegister(dest, 64), imm.value);
|
||||
}
|
||||
void lshift64(Imm32 imm, Register64 dest) {
|
||||
lshiftPtr(imm, dest.reg);
|
||||
}
|
||||
inline void lshift64(Imm32 imm, Register64 dest);
|
||||
|
||||
void testPtr(Register lhs, Register rhs) {
|
||||
Tst(ARMRegister(lhs, 64), Operand(ARMRegister(rhs, 64)));
|
||||
|
|
|
@ -128,6 +128,12 @@ MacroAssembler::xorPtr(Imm32 imm, Register dest)
|
|||
// ===============================================================
|
||||
// Shift functions
|
||||
|
||||
void
|
||||
MacroAssembler::lshiftPtr(Imm32 imm, Register dest)
|
||||
{
|
||||
ma_sll(dest, dest, imm);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::rshiftPtr(Imm32 imm, Register dest)
|
||||
{
|
||||
|
|
|
@ -1349,9 +1349,6 @@ class MacroAssemblerMIPSCompat : public MacroAssemblerMIPS
|
|||
void restoreStackPointer();
|
||||
static void calculateAlignedStackPointer(void** stackPointer);
|
||||
|
||||
void lshiftPtr(Imm32 imm, Register dest) {
|
||||
ma_sll(dest, dest, imm);
|
||||
}
|
||||
void lshift64(Imm32 imm, Register64 dest) {
|
||||
as_sll(dest.high, dest.high, imm.value);
|
||||
as_srl(ScratchRegister, dest.low, 32 - imm.value);
|
||||
|
|
|
@ -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 lshiftPtr(Imm32, Register) { MOZ_CRASH(); }
|
||||
void convertUInt32ToDouble(Register, FloatRegister) { MOZ_CRASH(); }
|
||||
void convertUInt32ToFloat32(Register, FloatRegister) { MOZ_CRASH(); }
|
||||
void inc64(AbsoluteAddress) { MOZ_CRASH(); }
|
||||
|
|
|
@ -69,6 +69,12 @@ MacroAssembler::xorPtr(Imm32 imm, Register dest)
|
|||
// ===============================================================
|
||||
// Shift functions
|
||||
|
||||
void
|
||||
MacroAssembler::lshiftPtr(Imm32 imm, Register dest)
|
||||
{
|
||||
shlq(imm, dest);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::rshiftPtr(Imm32 imm, Register dest)
|
||||
{
|
||||
|
|
|
@ -850,9 +850,6 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
|
|||
void store64(Register64 src, Address address) {
|
||||
movq(src.reg, Operand(address));
|
||||
}
|
||||
void lshiftPtr(Imm32 imm, Register dest) {
|
||||
shlq(imm, dest);
|
||||
}
|
||||
void lshift64(Imm32 imm, Register64 dest) {
|
||||
shlq(imm, dest.reg);
|
||||
}
|
||||
|
|
|
@ -70,6 +70,12 @@ MacroAssembler::xorPtr(Imm32 imm, Register dest)
|
|||
// ===============================================================
|
||||
// Shift functions
|
||||
|
||||
void
|
||||
MacroAssembler::lshiftPtr(Imm32 imm, Register dest)
|
||||
{
|
||||
shll(imm, dest);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::rshiftPtr(Imm32 imm, Register dest)
|
||||
{
|
||||
|
|
|
@ -1122,9 +1122,6 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
|
|||
}
|
||||
}
|
||||
|
||||
void lshiftPtr(Imm32 imm, Register dest) {
|
||||
shll(imm, dest);
|
||||
}
|
||||
void lshift64(Imm32 imm, Register64 dest) {
|
||||
shldl(imm, dest.low, dest.high);
|
||||
shll(imm, dest.low);
|
||||
|
|
Загрузка…
Ссылка в новой задаче