Skip to content

Commit

Permalink
reorder the calleeSavedRegs for optimization for LA64.
Browse files Browse the repository at this point in the history
  • Loading branch information
shushanhf committed Mar 19, 2024
1 parent 5ba69b3 commit b96f05c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/coreclr/jit/codegenloongarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,13 +827,13 @@ void CodeGen::genFuncletProlog(BasicBlock* block)
{
genStackPointerAdjustment(frameSize, REG_R21, nullptr, /* reportUnwindData */ true);

genSaveCalleeSavedRegistersHelp(maskSaveRegs, SP_to_CalleeSaved_delta, 0);
GetEmitter()->emitIns_R_R_I(INS_st_d, EA_PTRSIZE, REG_FP, REG_SPBASE, FP_offset);
compiler->unwindSaveReg(REG_FP, FP_offset);

GetEmitter()->emitIns_R_R_I(INS_st_d, EA_PTRSIZE, REG_RA, REG_SPBASE, FP_offset + 8);
compiler->unwindSaveReg(REG_RA, FP_offset + 8);

GetEmitter()->emitIns_R_R_I(INS_st_d, EA_PTRSIZE, REG_FP, REG_SPBASE, FP_offset);
compiler->unwindSaveReg(REG_FP, FP_offset);
genSaveCalleeSavedRegistersHelp(maskSaveRegs, SP_to_CalleeSaved_delta, 0);
}
else
{
Expand All @@ -844,13 +844,13 @@ void CodeGen::genFuncletProlog(BasicBlock* block)

genStackPointerAdjustment(frameSize + SP_to_CalleeSaved_delta, REG_R21, nullptr, true);

genSaveCalleeSavedRegistersHelp(maskSaveRegs, FP_offset + 16, 0);
GetEmitter()->emitIns_R_R_I(INS_st_d, EA_PTRSIZE, REG_FP, REG_SPBASE, FP_offset);
compiler->unwindSaveReg(REG_FP, FP_offset);

GetEmitter()->emitIns_R_R_I(INS_st_d, EA_PTRSIZE, REG_RA, REG_SPBASE, FP_offset + 8);
compiler->unwindSaveReg(REG_RA, FP_offset + 8);

GetEmitter()->emitIns_R_R_I(INS_st_d, EA_PTRSIZE, REG_FP, REG_SPBASE, FP_offset);
compiler->unwindSaveReg(REG_FP, FP_offset);
genSaveCalleeSavedRegistersHelp(maskSaveRegs, FP_offset + 16, 0);

genStackPointerAdjustment(-SP_to_CalleeSaved_delta, REG_R21, nullptr, true);
}
Expand Down Expand Up @@ -7703,13 +7703,13 @@ void CodeGen::genPushCalleeSavedRegisters(regNumber initReg, bool* pInitRegZeroe
}
genStackPointerAdjustment(-totalFrameSize, initReg, pInitRegZeroed, /* reportUnwindData */ true);
}
genSaveCalleeSavedRegistersHelp(rsPushRegs, FP_offset + 16, 0);
GetEmitter()->emitIns_R_R_I(INS_st_d, EA_PTRSIZE, REG_FP, REG_SPBASE, FP_offset);
compiler->unwindSaveReg(REG_FP, FP_offset);

GetEmitter()->emitIns_R_R_I(INS_st_d, EA_PTRSIZE, REG_RA, REG_SPBASE, FP_offset + 8);
compiler->unwindSaveReg(REG_RA, FP_offset + 8);

GetEmitter()->emitIns_R_R_I(INS_st_d, EA_PTRSIZE, REG_FP, REG_SPBASE, FP_offset);
compiler->unwindSaveReg(REG_FP, FP_offset);
genSaveCalleeSavedRegistersHelp(rsPushRegs, FP_offset + 16, 0);

JITDUMP(" offsetSpToSavedFp=%d\n", FP_offset);
genEstablishFramePointer(FP_offset, /* reportUnwindData */ true);
Expand Down

0 comments on commit b96f05c

Please sign in to comment.