Skip to content

Commit

Permalink
8340643: RISC-V: Small refactoring for sub/subw macro-assembler routines
Browse files Browse the repository at this point in the history
  • Loading branch information
zifeihan committed Sep 23, 2024
1 parent ab06a87 commit 4d62e96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hotspot/cpu/riscv/macroAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2089,8 +2089,8 @@ void MacroAssembler::sub(Register Rd, Register Rn, int64_t decrement, Register t
addi(Rd, Rn, -decrement);
} else {
assert_different_registers(Rn, temp);
li(temp, decrement);
sub(Rd, Rn, temp);
li(temp, -decrement);
add(Rd, Rn, temp);
}
}

Expand All @@ -2099,8 +2099,8 @@ void MacroAssembler::subw(Register Rd, Register Rn, int32_t decrement, Register
addiw(Rd, Rn, -decrement);
} else {
assert_different_registers(Rn, temp);
li(temp, decrement);
subw(Rd, Rn, temp);
li(temp, -decrement);
addw(Rd, Rn, temp);
}
}

Expand Down

0 comments on commit 4d62e96

Please sign in to comment.