Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed the split error for LoongArch64. #101656

Merged
merged 4 commits into from Apr 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 14 additions & 6 deletions src/coreclr/jit/codegencommon.cpp
Expand Up @@ -4119,7 +4119,7 @@ void CodeGen::genEnregisterOSRArgsAndLocals()
}
}

#if defined(SWIFT_SUPPORT) || defined(TARGET_RISCV64)
#if defined(SWIFT_SUPPORT) || defined(TARGET_RISCV64) || defined(TARGET_LOONGARCH64)
//-----------------------------------------------------------------------------
// genHomeSwiftStructParameters: Move the incoming segment to the local stack frame.
//
Expand Down Expand Up @@ -4159,8 +4159,16 @@ void CodeGen::genHomeStackSegment(unsigned lclNum,
}
emitAttr size = emitTypeSize(loadType);

int loadOffset =
-(isFramePointerUsed() ? genCallerSPtoFPdelta() : genCallerSPtoInitialSPdelta()) + (int)seg.GetStackOffset();
int loadOffset;
if (isFramePointerUsed())
{
loadOffset = -genCallerSPtoFPdelta();
}
else
{
loadOffset = -(int)seg.GetStackOffset() - genCallerSPtoInitialSPdelta();
}

shushanhf marked this conversation as resolved.
Show resolved Hide resolved
#ifdef TARGET_XARCH
GetEmitter()->emitIns_R_AR(ins_Load(loadType), size, initReg, genFramePointerReg(), loadOffset);
#else
Expand All @@ -4171,7 +4179,7 @@ void CodeGen::genHomeStackSegment(unsigned lclNum,
if (initRegStillZeroed)
*initRegStillZeroed = false;
}
#endif // defined(SWIFT_SUPPORT) || defined(TARGET_RISCV64)
#endif // defined(SWIFT_SUPPORT) || defined(TARGET_RISCV64) || defined(TARGET_LOONGARCH64)

#ifdef SWIFT_SUPPORT

Expand Down Expand Up @@ -4248,7 +4256,7 @@ void CodeGen::genHomeSwiftStructParameters(bool handleStack)
//
void CodeGen::genHomeStackPartOfSplitParameter(regNumber initReg, bool* initRegStillZeroed)
{
#ifdef TARGET_RISCV64
#if defined(TARGET_RISCV64) || defined(TARGET_LOONGARCH64)
unsigned lclNum = 0;
for (; lclNum < compiler->info.compArgsCount; lclNum++)
{
Expand All @@ -4273,7 +4281,7 @@ void CodeGen::genHomeStackPartOfSplitParameter(regNumber initReg, bool* initRegS
}
break;
}
#endif
#endif // TARGET_RISCV64 || TARGET_LOONGARCH64
}

/*-----------------------------------------------------------------------------
Expand Down