mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
sret calling convention fix
This commit is contained in:
parent
ee4aa8a592
commit
84a0cf329f
1 changed files with 15 additions and 2 deletions
|
@ -15742,7 +15742,7 @@ void BeMCContext::Generate(BeFunction* function)
|
|||
mDbgPreferredRegs[32] = X64Reg_R8;*/
|
||||
|
||||
//mDbgPreferredRegs[8] = X64Reg_RAX;
|
||||
//mDebugging = (function->mName == "?__BfCtor@SpriteBatchRenderer@Repo@bf@@QEAAXTint@@@Z");
|
||||
//mDebugging = (function->mName == "DoCallback");
|
||||
// || (function->mName == "?MethodA@TestProgram@BeefTest@bf@@CAXXZ");
|
||||
// || (function->mName == "?Hey@Blurg@bf@@SAXXZ")
|
||||
// ;
|
||||
|
@ -16903,7 +16903,7 @@ void BeMCContext::Generate(BeFunction* function)
|
|||
BF_ASSERT(retVal.IsVReg());
|
||||
auto vregInfo = GetVRegInfo(retVal);
|
||||
|
||||
vregInfo->SetRetVal();
|
||||
vregInfo->SetRetVal();
|
||||
}
|
||||
else if (retType->IsVector())
|
||||
{
|
||||
|
@ -16930,6 +16930,19 @@ void BeMCContext::Generate(BeFunction* function)
|
|||
}
|
||||
}
|
||||
|
||||
if (mBeFunction->HasStructRet())
|
||||
{
|
||||
for (int vregIdx = 0; vregIdx < (int)mVRegInfo.size(); vregIdx++)
|
||||
{
|
||||
auto vregInfo = mVRegInfo[vregIdx];
|
||||
if (vregInfo->mIsRetVal)
|
||||
{
|
||||
AllocInst(BeMCInstKind_Mov, BeMCOperand::FromReg(X64Reg_RAX), BeMCOperand::FromVReg(vregIdx));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto mcInst = AllocInst();
|
||||
mcInst->mKind = BeMCInstKind_Ret;
|
||||
retCount++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue