mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
Bug 1271968 - IonMonkey: MIPS: Merge MacroAssembler::ma_jal.
Tag: #1542
This commit is contained in:
parent
e2773bdc37
commit
0688bb7159
6 changed files with 26 additions and 51 deletions
|
|
@ -727,6 +727,30 @@ MacroAssemblerMIPSShared::ma_b(wasm::TrapDesc target, JumpKind jumpKind)
|
|||
bindLater(&label, target);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerMIPSShared::ma_jal(Label* label)
|
||||
{
|
||||
if (label->bound()) {
|
||||
// Generate the mixed jump.
|
||||
addMixedJump(nextOffset(), ImmPtr((void*)label->offset()));
|
||||
as_jal(JOffImm26(0));
|
||||
as_nop();
|
||||
return;
|
||||
}
|
||||
|
||||
// Second word holds a pointer to the next branch in label's chain.
|
||||
uint32_t nextInChain = label->used() ? label->offset() : LabelBase::INVALID_OFFSET;
|
||||
|
||||
// Make the whole branch continous in the buffer. The '2'
|
||||
// instructions are writing at below (contain delay slot).
|
||||
m_buffer.ensureSpace(2 * sizeof(uint32_t));
|
||||
|
||||
BufferOffset bo = as_jal(JOffImm26(0));
|
||||
writeInst(nextInChain);
|
||||
if (!oom())
|
||||
label->use(bo.getOffset());
|
||||
}
|
||||
|
||||
Assembler::Condition
|
||||
MacroAssemblerMIPSShared::ma_cmp(Register scratch, Register lhs, Register rhs, Condition c)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -164,6 +164,8 @@ class MacroAssemblerMIPSShared : public Assembler
|
|||
void ma_b(Label* l, JumpKind jumpKind = MixedJump);
|
||||
void ma_b(wasm::TrapDesc target, JumpKind jumpKind = MixedJump);
|
||||
|
||||
void ma_jal(Label* l);
|
||||
|
||||
// fp instructions
|
||||
void ma_lis(FloatRegister dest, float value);
|
||||
void ma_lis(FloatRegister dest, wasm::RawF32 value);
|
||||
|
|
|
|||
|
|
@ -503,29 +503,6 @@ MacroAssemblerMIPS::ma_b(Address addr, ImmGCPtr imm, Label* label, Condition c,
|
|||
ma_b(SecondScratchReg, imm, label, c, jumpKind);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerMIPS::ma_jal(Label* label)
|
||||
{
|
||||
if (label->bound()) {
|
||||
// Generate the mixed jump.
|
||||
addMixedJump(nextOffset(), ImmPtr((void*)label->offset()));
|
||||
as_jal(JOffImm26(0));
|
||||
as_nop();
|
||||
return;
|
||||
}
|
||||
|
||||
// Second word holds a pointer to the next branch in label's chain.
|
||||
uint32_t nextInChain = label->used() ? label->offset() : LabelBase::INVALID_OFFSET;
|
||||
|
||||
// Make the whole branch continous in the buffer.
|
||||
m_buffer.ensureSpace(2 * sizeof(uint32_t));
|
||||
|
||||
BufferOffset bo = as_jal(JOffImm26(0));
|
||||
writeInst(nextInChain);
|
||||
if (!oom())
|
||||
label->use(bo.getOffset());
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerMIPS::branchWithCode(InstImm code, Label* label, JumpKind jumpKind)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -109,8 +109,6 @@ class MacroAssemblerMIPS : public MacroAssemblerMIPSShared
|
|||
ma_b(ScratchRegister, rhs, l, c, jumpKind);
|
||||
}
|
||||
|
||||
void ma_jal(Label* l);
|
||||
|
||||
// fp instructions
|
||||
void ma_lid(FloatRegister dest, double value);
|
||||
|
||||
|
|
|
|||
|
|
@ -756,30 +756,6 @@ MacroAssemblerMIPS64::ma_b(Address addr, ImmGCPtr imm, Label* label, Condition c
|
|||
ma_b(SecondScratchReg, imm, label, c, jumpKind);
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerMIPS64::ma_jal(Label* label)
|
||||
{
|
||||
if (label->bound()) {
|
||||
// Generate the mixed jump.
|
||||
addMixedJump(nextOffset(), ImmPtr((void*)label->offset()));
|
||||
as_jal(JOffImm26(0));
|
||||
as_nop();
|
||||
return;
|
||||
}
|
||||
|
||||
// Second word holds a pointer to the next branch in label's chain.
|
||||
uint32_t nextInChain = label->used() ? label->offset() : LabelBase::INVALID_OFFSET;
|
||||
|
||||
// Make the whole branch continous in the buffer. The '2'
|
||||
// instructions are writing at below (contain delay slot).
|
||||
m_buffer.ensureSpace(2 * sizeof(uint32_t));
|
||||
|
||||
BufferOffset bo = as_jal(JOffImm26(0));
|
||||
writeInst(nextInChain);
|
||||
if (!oom())
|
||||
label->use(bo.getOffset());
|
||||
}
|
||||
|
||||
void
|
||||
MacroAssemblerMIPS64::branchWithCode(InstImm code, Label* label, JumpKind jumpKind)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -127,8 +127,6 @@ class MacroAssemblerMIPS64 : public MacroAssemblerMIPSShared
|
|||
ma_b(ScratchRegister, rhs, l, c, jumpKind);
|
||||
}
|
||||
|
||||
void ma_jal(Label* l);
|
||||
|
||||
// fp instructions
|
||||
void ma_lid(FloatRegister dest, double value);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue