зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1203964 - Part 3: Move MacroAssembler::rshift64 into generic macro assembler. r=hev
--HG-- extra : rebase_source : 4eba3c9ed0c8141c267cd4e2985074ef2c80a2a1
This commit is contained in:
Родитель
72dc86fadd
Коммит
8250d9dc2c
|
@ -705,6 +705,8 @@ class MacroAssembler : public MacroAssemblerSpecific
|
|||
|
||||
inline void rshiftPtrArithmetic(Imm32 imm, Register dest) PER_ARCH;
|
||||
|
||||
inline void rshift64(Imm32 imm, Register64 dest) PER_ARCH;
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
public:
|
||||
|
||||
|
|
|
@ -143,6 +143,14 @@ MacroAssembler::rshiftPtrArithmetic(Imm32 imm, Register dest)
|
|||
ma_asr(imm, dest, dest);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::rshift64(Imm32 imm, Register64 dest)
|
||||
{
|
||||
as_mov(dest.low, lsr(dest.low, imm.value));
|
||||
as_orr(dest.low, dest.low, lsl(dest.high, 32 - imm.value));
|
||||
as_mov(dest.high, lsr(dest.high, imm.value));
|
||||
}
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
// ===============================================================
|
||||
|
||||
|
|
|
@ -1716,11 +1716,6 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
|
|||
|
||||
void checkStackAlignment();
|
||||
|
||||
void rshift64(Imm32 imm, Register64 dest) {
|
||||
as_mov(dest.low, lsr(dest.low, imm.value));
|
||||
as_orr(dest.low, dest.low, lsl(dest.high, 32 - imm.value));
|
||||
as_mov(dest.high, lsr(dest.high, imm.value));
|
||||
}
|
||||
void lshiftPtr(Imm32 imm, Register dest) {
|
||||
ma_lsl(imm, dest, dest);
|
||||
}
|
||||
|
|
|
@ -162,15 +162,15 @@ MacroAssembler::rshiftPtrArithmetic(Imm32 imm, Register dest)
|
|||
Asr(ARMRegister(dest, 64), ARMRegister(dest, 64), imm.value);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::rshift64(Imm32 imm, Register64 dest)
|
||||
{
|
||||
rshiftPtr(imm, dest.reg);
|
||||
}
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
// ===============================================================
|
||||
|
||||
void
|
||||
MacroAssemblerCompat::rshift64(Imm32 imm, Register64 dest)
|
||||
{
|
||||
asMasm().rshiftPtr(imm, dest.reg);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
MacroAssemblerCompat::andToStackPtr(T t)
|
||||
|
|
|
@ -1069,8 +1069,6 @@ class MacroAssemblerCompat : public vixl::MacroAssembler
|
|||
branchPtr(cond, lhs, getStackPointer(), label);
|
||||
}
|
||||
|
||||
inline void rshift64(Imm32 imm, Register64 dest);
|
||||
|
||||
void lshiftPtr(Imm32 imm, Register dest) {
|
||||
Lsl(ARMRegister(dest, 64), ARMRegister(dest, 64), imm.value);
|
||||
}
|
||||
|
|
|
@ -140,6 +140,16 @@ MacroAssembler::rshiftPtrArithmetic(Imm32 imm, Register dest)
|
|||
ma_sra(dest, dest, imm);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::rshift64(Imm32 imm, Register64 dest)
|
||||
{
|
||||
ScratchRegisterScope scratch(*this);
|
||||
as_srl(dest.low, dest.low, imm.value);
|
||||
as_sll(scratch, dest.high, 32 - imm.value);
|
||||
as_or(dest.low, dest.low, scratch);
|
||||
as_srl(dest.high, dest.high, imm.value);
|
||||
}
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
// ===============================================================
|
||||
|
||||
|
|
|
@ -1349,12 +1349,6 @@ class MacroAssemblerMIPSCompat : public MacroAssemblerMIPS
|
|||
void restoreStackPointer();
|
||||
static void calculateAlignedStackPointer(void** stackPointer);
|
||||
|
||||
void rshift64(Imm32 imm, Register64 dest) {
|
||||
as_srl(dest.low, dest.low, imm.value);
|
||||
as_sll(ScratchRegister, dest.high, 32 - imm.value);
|
||||
as_or(dest.low, dest.low, ScratchRegister);
|
||||
as_srl(dest.high, dest.high, imm.value);
|
||||
}
|
||||
void lshiftPtr(Imm32 imm, Register dest) {
|
||||
ma_sll(dest, dest, imm);
|
||||
}
|
||||
|
|
|
@ -81,6 +81,12 @@ MacroAssembler::rshiftPtrArithmetic(Imm32 imm, Register dest)
|
|||
sarq(imm, dest);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::rshift64(Imm32 imm, Register64 dest)
|
||||
{
|
||||
shrq(imm, dest.reg);
|
||||
}
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
// ===============================================================
|
||||
|
||||
|
|
|
@ -850,9 +850,6 @@ class MacroAssemblerX64 : public MacroAssemblerX86Shared
|
|||
void store64(Register64 src, Address address) {
|
||||
movq(src.reg, Operand(address));
|
||||
}
|
||||
void rshift64(Imm32 imm, Register64 dest) {
|
||||
shrq(imm, dest.reg);
|
||||
}
|
||||
void lshiftPtr(Imm32 imm, Register dest) {
|
||||
shlq(imm, dest);
|
||||
}
|
||||
|
|
|
@ -82,6 +82,13 @@ MacroAssembler::rshiftPtrArithmetic(Imm32 imm, Register dest)
|
|||
sarl(imm, dest);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssembler::rshift64(Imm32 imm, Register64 dest)
|
||||
{
|
||||
shrdl(imm, dest.high, dest.low);
|
||||
shrl(imm, dest.high);
|
||||
}
|
||||
|
||||
//}}} check_macroassembler_style
|
||||
// ===============================================================
|
||||
|
||||
|
|
|
@ -1122,10 +1122,6 @@ class MacroAssemblerX86 : public MacroAssemblerX86Shared
|
|||
}
|
||||
}
|
||||
|
||||
void rshift64(Imm32 imm, Register64 dest) {
|
||||
shrdl(imm, dest.high, dest.low);
|
||||
shrl(imm, dest.high);
|
||||
}
|
||||
void lshiftPtr(Imm32 imm, Register dest) {
|
||||
shll(imm, dest);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче