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

[RISC-V][JIT] Fix branch #86482

Merged
merged 7 commits into from
May 30, 2023
Merged
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
Prev Previous commit
Next Next commit
Updated by reviews
  • Loading branch information
clamp03 committed May 24, 2023
commit 404a6642e80d75390933642cad32f880cc53b62e
7 changes: 7 additions & 0 deletions src/coreclr/jit/emitriscv64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ void emitter::emitIns_R_R_I(
assert(isGeneralRegister(reg1));
assert(isGeneralRegister(reg2));
assert(isValidSimm13(imm));
assert(!(imm & 3));
code |= reg1 << 15;
code |= reg2 << 20;
code |= ((imm >> 11) & 0x1) << 7;
Expand Down Expand Up @@ -1855,10 +1856,12 @@ void emitter::emitJumpDistBind()
}
else if (isValidSimm21(jmpDist + maxPlaceholderSize))
{
// convert to opposite branch and jal
extra = 4;
}
else
{
// convert to opposite branch and jalr
extra = 4 * 6;
}
}
Expand All @@ -1870,6 +1873,7 @@ void emitter::emitJumpDistBind()
}
else
{
// convert to jalr
extra = 4 * 5;
clamp03 marked this conversation as resolved.
Show resolved Hide resolved
}
}
Expand Down Expand Up @@ -1949,10 +1953,12 @@ void emitter::emitJumpDistBind()
}
else if (isValidSimm21(jmpDist + maxPlaceholderSize))
{
// convert to opposite branch and jal
extra = 4;
}
else
{
// convert to opposite branch and jalr
extra = 4 * 6;
}
}
Expand All @@ -1964,6 +1970,7 @@ void emitter::emitJumpDistBind()
}
else
{
// convert to jalr
extra = 4 * 5;
}
}
Expand Down