Skip to content

Commit

Permalink
fix the regMaskTP convert errors for RV64.
Browse files Browse the repository at this point in the history
  • Loading branch information
shushanhf committed Jun 25, 2024
1 parent b164fb9 commit 933cff7
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/coreclr/jit/codegenriscv64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,11 @@ void CodeGen::genSaveCalleeSavedRegistersHelp(regMaskTP regsToSaveMask, int lowe
assert(!(regsToSaveMask & (~RBM_CALLEE_SAVED)));
assert(lowestCalleeSavedOffset >= 0);

emitter* emit = GetEmitter();
int regNum = FIRST_INT_CALLEE_SAVED;
int64_t maskSaveRegs = (int64_t)(regsToSaveMask.getLow() & (int64_t)RBM_INT_CALLEE_SAVED) >> FIRST_INT_CALLEE_SAVED;
emitter* emit = GetEmitter();
int regNum = FIRST_INT_CALLEE_SAVED;
int64_t maskSaveRegs = (int64_t)regsToSaveMask.getLow();

maskSaveRegs = (maskSaveRegs & RBM_INT_CALLEE_SAVED) >> FIRST_INT_CALLEE_SAVED;
do
{
if (maskSaveRegs & 1)
Expand All @@ -223,7 +225,8 @@ void CodeGen::genSaveCalleeSavedRegistersHelp(regMaskTP regsToSaveMask, int lowe
regNum += 1;
} while (maskSaveRegs != 0);

maskSaveRegs = (int64_t)(regsToSaveMask.getLow() & (int64_t)RBM_FLT_CALLEE_SAVED) >> FIRST_FLT_CALLEE_SAVED;
maskSaveRegs = (int64_t)regsToSaveMask.getLow();
maskSaveRegs = (maskSaveRegs & RBM_FLT_CALLEE_SAVED) >> FIRST_FLT_CALLEE_SAVED;
regNum = FIRST_FLT_CALLEE_SAVED;
do
{
Expand Down Expand Up @@ -275,8 +278,10 @@ void CodeGen::genRestoreCalleeSavedRegistersHelp(regMaskTP regsToRestoreMask, in
assert(highestCalleeSavedOffset >= 16);

emitter* emit = GetEmitter();
int64_t maskSaveRegs = (int64_t)(regsToRestoreMask.getLow() & RBM_FLT_CALLEE_SAVED) << (63 - LAST_FLT_CALLEE_SAVED);
int regNum = LAST_FLT_CALLEE_SAVED;
int64_t maskSaveRegs = (int64_t)regsToRestoreMask.getLow();

maskSaveRegs = (maskSaveRegs & RBM_FLT_CALLEE_SAVED) << (63 - LAST_FLT_CALLEE_SAVED);
do
{
if (maskSaveRegs < 0)
Expand All @@ -289,7 +294,8 @@ void CodeGen::genRestoreCalleeSavedRegistersHelp(regMaskTP regsToRestoreMask, in
regNum -= 1;
} while (maskSaveRegs != 0);

maskSaveRegs = (int64_t)(regsToRestoreMask.getLow() & (int64_t)RBM_INT_CALLEE_SAVED) << (63 - LAST_INT_CALLEE_SAVED);
maskSaveRegs = (int64_t)regsToRestoreMask.getLow();
maskSaveRegs = (maskSaveRegs & RBM_INT_CALLEE_SAVED) << (63 - LAST_INT_CALLEE_SAVED);
regNum = LAST_INT_CALLEE_SAVED;
do
{
Expand Down

0 comments on commit 933cff7

Please sign in to comment.