зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1254500 - IonMonkey: MIPS: Implement ma_ctz. r=arai
--- js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp | 11 +++++++++++ js/src/jit/mips-shared/MacroAssembler-mips-shared.h | 2 ++ 2 files changed, 13 insertions(+)
This commit is contained in:
Родитель
b8598e36ab
Коммит
ede2938094
|
@ -184,6 +184,17 @@ MacroAssemblerMIPSShared::ma_xor(Register rd, Register rs, Imm32 imm)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerMIPSShared::ma_ctz(Register rd, Register rs)
|
||||
{
|
||||
ma_negu(ScratchRegister, rs);
|
||||
as_and(rd, ScratchRegister, rs);
|
||||
as_clz(rd, rd);
|
||||
ma_negu(SecondScratchReg, rd);
|
||||
ma_addu(SecondScratchReg, Imm32(0x1f));
|
||||
as_movn(rd, SecondScratchReg, ScratchRegister);
|
||||
}
|
||||
|
||||
// Arithmetic-based ops.
|
||||
|
||||
// Add.
|
||||
|
|
|
@ -99,6 +99,8 @@ class MacroAssemblerMIPSShared : public Assembler
|
|||
void ma_xor(Register rd, Imm32 imm);
|
||||
void ma_xor(Register rd, Register rs, Imm32 imm);
|
||||
|
||||
void ma_ctz(Register rd, Register rs);
|
||||
|
||||
// load
|
||||
void ma_load(Register dest, const BaseIndex& src, LoadStoreSize size = SizeWord,
|
||||
LoadStoreExtension extension = SignExtend);
|
||||
|
|
Загрузка…
Ссылка в новой задаче