Commit ce8840d0 authored by Zhao Jiazhong's avatar Zhao Jiazhong Committed by Commit Bot

[mips64][codegen] Fix the optimization for long branch

If a long branch doesn't use delay slot, then when optimizing it
to a regular branch, the instruction in delay slot should be set
to nop.

Change-Id: Id3015bc0c562725258705a8bc6647c4011d96c2a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2524416Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#71039}
parent 6b9bab5d
......@@ -878,8 +878,10 @@ void Assembler::target_at_put(int pos, int target_pos, bool is_internal) {
Instr instr_branch_delay;
if (IsJump(instr_j)) {
instr_branch_delay = instr_at(pos + 6 * kInstrSize);
// Case when branch delay slot is protected.
instr_branch_delay = nopInstr;
} else {
// Case when branch delay slot is used.
instr_branch_delay = instr_at(pos + 7 * kInstrSize);
}
instr_at_put(pos, instr_b);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment