8350855: RISC-V: print offset by assert of patch_offset_in_conditional_branch

Reviewed-by: fyang
This commit is contained in:
Hamlin Li 2025-02-28 09:05:42 +00:00
parent 2af76de05a
commit eada1ea8d2

View File

@ -2300,7 +2300,7 @@ static int patch_offset_in_jal(address branch, int64_t offset) {
static int patch_offset_in_conditional_branch(address branch, int64_t offset) {
assert(Assembler::is_simm13(offset) && ((offset % 2) == 0),
"offset is too large to be patched in one beq/bge/bgeu/blt/bltu/bne instruction!\n");
"offset (%ld) is too large to be patched in one beq/bge/bgeu/blt/bltu/bne instruction!\n", offset);
Assembler::patch(branch, 31, 31, (offset >> 12) & 0x1); // offset[12] ==> branch[31]
Assembler::patch(branch, 30, 25, (offset >> 5) & 0x3f); // offset[10:5] ==> branch[30:25]
Assembler::patch(branch, 7, 7, (offset >> 11) & 0x1); // offset[11] ==> branch[7]