RFR: 8343030: RISC-V: Small assembler cleanups

Hamlin Li mli at openjdk.org
Fri Oct 25 08:08:06 UTC 2024


On Fri, 25 Oct 2024 03:07:19 GMT, Fei Yang <fyang at openjdk.org> wrote:

> Hi, please review this small code cleanups.
> 
> Witnessed some explicit type conversion to `address` is not necessary now.
> Also we can make use of `void la(Register Rd, const address addr)` where possible to simplify the code.
> This also adds one temporary register parameter for the `cmpptr` assembler routine.
> 
> Testing on linux-riscv64:
> - [ ] tier1 (release)

Looks good.
Just one minor comment.

src/hotspot/cpu/riscv/macroAssembler_riscv.hpp line 1324:

> 1322:   // increment/decrement may trash both t0 and t1.
> 1323: 
> 1324:   void increment (const Address dst, int64_t value = 1, Register tmp1 = t0, Register tmp2 = t1);

To align with the pattern in this file, extra space should be removed.

src/hotspot/cpu/riscv/macroAssembler_riscv.hpp line 1327:

> 1325:   void incrementw(const Address dst, int32_t value = 1, Register tmp1 = t0, Register tmp2 = t1);
> 1326: 
> 1327:   void decrement (const Address dst, int64_t value = 1, Register tmp1 = t0, Register tmp2 = t1);

Same here.

-------------

PR Review: https://git.openjdk.org/jdk/pull/21699#pullrequestreview-2394517303
PR Review Comment: https://git.openjdk.org/jdk/pull/21699#discussion_r1816195932
PR Review Comment: https://git.openjdk.org/jdk/pull/21699#discussion_r1816196144


More information about the hotspot-dev mailing list