diff options
Diffstat (limited to 'deps/v8/src/codegen')
-rw-r--r-- | deps/v8/src/codegen/riscv/macro-assembler-riscv.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc b/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc index 3fa69f10e5..b39661c771 100644 --- a/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc +++ b/deps/v8/src/codegen/riscv/macro-assembler-riscv.cc @@ -3976,8 +3976,12 @@ bool MacroAssembler::BranchShortHelper(int32_t offset, Label* L, Condition cond, BlockTrampolinePoolScope block_trampoline_pool(this); Register scratch = no_reg; if (!rt.is_reg()) { - scratch = temps.Acquire(); - li(scratch, rt); + if (rt.immediate() == 0) { + scratch = zero_reg; + } else { + scratch = temps.Acquire(); + li(scratch, rt); + } } else { scratch = rt.rm(); } |