Skip to content

Commit

Permalink
[LoongArch64] Fix the arithmetic shift right in CodeGen::genSaveCalle…
Browse files Browse the repository at this point in the history
…eSavedRegistersHelp. (#105676)

* [LoongArch64] Fix the arithmetic shift right in CodeGen::genSaveCalleeSavedRegistersHelp.

* Apply the change to RiscV64.
  • Loading branch information
sunlijun-610 authored Aug 1, 2024
1 parent bc9cd27 commit 74460dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/coreclr/jit/codegenloongarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void CodeGen::genSaveCalleeSavedRegistersHelp(regMaskTP regsToSaveMask, int lowe
emitter* emit = GetEmitter();
int regNum = FIRST_INT_CALLEE_SAVED;
regMaskTP regsMask = regsToSaveMask & RBM_INT_CALLEE_SAVED;
int64_t maskSaveRegs = (int64_t)regsMask.getLow() >> FIRST_INT_CALLEE_SAVED;
uint64_t maskSaveRegs = (uint64_t)regsMask.getLow() >> FIRST_INT_CALLEE_SAVED;
do
{
if (maskSaveRegs & 1)
Expand All @@ -234,7 +234,7 @@ void CodeGen::genSaveCalleeSavedRegistersHelp(regMaskTP regsToSaveMask, int lowe
} while (maskSaveRegs != 0);

regsMask = regsToSaveMask & RBM_FLT_CALLEE_SAVED;
maskSaveRegs = (int64_t)regsMask.getLow() >> FIRST_FLT_CALLEE_SAVED;
maskSaveRegs = (uint64_t)regsMask.getLow() >> FIRST_FLT_CALLEE_SAVED;
regNum = FIRST_FLT_CALLEE_SAVED;
do
{
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/codegenriscv64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void CodeGen::genSaveCalleeSavedRegistersHelp(regMaskTP regsToSaveMask, int lowe
emitter* emit = GetEmitter();
int regNum = FIRST_INT_CALLEE_SAVED;
regMaskTP regsMask = regsToSaveMask & RBM_INT_CALLEE_SAVED;
int64_t maskSaveRegs = (int64_t)regsMask.getLow() >> FIRST_INT_CALLEE_SAVED;
uint64_t maskSaveRegs = (uint64_t)regsMask.getLow() >> FIRST_INT_CALLEE_SAVED;
do
{
if (maskSaveRegs & 1)
Expand All @@ -225,7 +225,7 @@ void CodeGen::genSaveCalleeSavedRegistersHelp(regMaskTP regsToSaveMask, int lowe
} while (maskSaveRegs != 0);

regsMask = regsToSaveMask & RBM_FLT_CALLEE_SAVED;
maskSaveRegs = (int64_t)regsMask.getLow() >> FIRST_FLT_CALLEE_SAVED;
maskSaveRegs = (uint64_t)regsMask.getLow() >> FIRST_FLT_CALLEE_SAVED;
regNum = FIRST_FLT_CALLEE_SAVED;
do
{
Expand Down

0 comments on commit 74460dd

Please sign in to comment.