Skip to content

Commit

Permalink
port ARM changes to ARM64
Browse files Browse the repository at this point in the history
PRs chakra-core#3019, chakra-core#3264, and chakra-core#3509. These occured after the point where the ARM64 starting point was forked.
  • Loading branch information
sigatrev committed Dec 12, 2017
1 parent c8d1549 commit f28d255
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions lib/Backend/arm64/LowerMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2181,11 +2181,13 @@ LowererMD::ChangeToLea(IR::Instr * instr, bool postRegAlloc)
IR::Instr *
LowererMD::LowerRet(IR::Instr * retInstr)
{
IR::RegOpnd *retReg = IR::RegOpnd::New(nullptr, RETURN_REG, TyMachReg, m_func);
IR::RegOpnd *retReg = IR::RegOpnd::New(TyMachReg, m_func);
retReg->SetReg(RETURN_REG);
Lowerer::InsertMove(retReg, retInstr->UnlinkSrc1(), retInstr);

retInstr->SetDst(retReg);
retInstr->SetSrc1(retReg);

return this->ChangeToAssign(retInstr);
return retInstr;
}


Expand Down Expand Up @@ -5886,10 +5888,14 @@ LowererMD::EmitInt4Instr(IR::Instr *instr)
instr->m_opcode = Js::OpCode::MUL;
break;

case Js::OpCode::DivU_I4:
AssertMsg(UNREACHED, "Unsigned div NYI");
case Js::OpCode::Div_I4:
instr->m_opcode = Js::OpCode::SDIV;
break;

case Js::OpCode::RemU_I4:
AssertMsg(UNREACHED, "Unsigned rem NYI");
case Js::OpCode::Rem_I4:
instr->m_opcode = Js::OpCode::REM;
break;
Expand Down Expand Up @@ -7663,7 +7669,7 @@ LowererMD::LoadFloatValue(IR::Opnd * opndDst, double value, IR::Instr * instrIns
#if DBG
NativeCodeData::GetDataDescription(pValue, instrInsert->m_func->m_alloc),
#endif
instrInsert->m_func);
instrInsert->m_func, true);
}
else
{
Expand Down Expand Up @@ -7763,6 +7769,9 @@ LowererMD::FinalLower()

switch (instr->m_opcode)
{
case Js::OpCode::Ret:
instr->Remove();
break;
case Js::OpCode::Leave:
Assert(this->m_func->DoOptimizeTry() && !this->m_func->IsLoopBodyInTry());
instrPrev = this->LowerLeave(instr, instr->AsBranchInstr()->GetTarget(), true /*fromFinalLower*/);
Expand Down

0 comments on commit f28d255

Please sign in to comment.