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

[LoongArch64] Fix some issues for CoreRoot test cases: #93187

Merged
merged 2 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5848,6 +5848,7 @@ void CodeGen::genFnProlog()
const bool isOSRx64Root = false;
#endif // TARGET_AMD64

#ifndef TARGET_LOONGARCH64
tempMask = initRegs & ~excludeMask & ~regSet.rsMaskResvd;

if (tempMask != RBM_NONE)
Expand All @@ -5869,6 +5870,7 @@ void CodeGen::genFnProlog()
initReg = genRegNumFromMask(tempMask);
}
}
#endif

#if defined(TARGET_AMD64)
// For x64 OSR root frames, we can't use any as of yet unsaved
Expand Down
7 changes: 7 additions & 0 deletions src/coreclr/jit/codegenloongarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3754,6 +3754,13 @@ void CodeGen::genFloatToIntCast(GenTree* treeNode)
GetEmitter()->emitIns_R_R(ins1, dstSize, tmpReg, tmpReg);
GetEmitter()->emitIns_R_R(ins2, dstSize, treeNode->GetRegNum(), tmpReg);

if (dstType == TYP_UINT)
{
GetEmitter()->emitIns_R_R_I(INS_addu16i_d, EA_PTRSIZE, REG_RA, REG_R0, -32768);
GetEmitter()->emitIns_R_R_I(INS_bne, EA_PTRSIZE, treeNode->GetRegNum(), REG_RA, (2 << 2));
GetEmitter()->emitIns_R_R_I(INS_ori, dstSize, treeNode->GetRegNum(), REG_R0, 0);
}

GetEmitter()->emitIns_I_I(INS_bcnez, EA_PTRSIZE, 3, 2 << 2); // cc=3
GetEmitter()->emitIns_R_I(INS_beqz, EA_PTRSIZE, treeNode->GetRegNum(), 2 << 2);

Expand Down