Skip to content

Commit 594f834

Browse files
committed
Move bounds of far branch
1 parent 4655409 commit 594f834

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/coreclr/jit/emit.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5049,9 +5049,11 @@ void emitter::emitJumpDistBind()
50495049
nsd = B_DIST_SMALL_MAX_NEG;
50505050
psd = B_DIST_SMALL_MAX_POS;
50515051

5052+
// 2 instructions: "reverse cmp-and-branch; jal offset;"
5053+
// Move bounds to the right by 'ssz' to account for the reversed branch instruction size.
50525054
msz = sizeof(code_t) * 2;
5053-
nmd = J_DIST_SMALL_MAX_NEG;
5054-
pmd = J_DIST_SMALL_MAX_POS;
5055+
nmd = J_DIST_SMALL_MAX_NEG + ssz;
5056+
pmd = J_DIST_SMALL_MAX_POS + ssz;
50555057
}
50565058
else if (emitIsUncondJump(jmp))
50575059
{

0 commit comments

Comments
 (0)