RFR: 8332899: RISC-V: add comment and make the code more readable (if possible) in MacroAssembler::movptr

Fei Yang fyang at openjdk.org
Fri May 31 14:55:03 UTC 2024


On Tue, 28 May 2024 15:36:00 GMT, Hamlin Li <mli at openjdk.org> wrote:

> Hi,
> Can you help to review the patch?
> As discussed, https://github.com/openjdk/jdk/pull/19246#discussion_r1613279908, it's worth to make the code more readable.
> For movptr1, add some comments to help understand the tricky part.
> For movptr2, it uses the similar (tricky) way as movptr1, so I align the code implementation with movptr1, and try to make it more straightforward.
> I tried it, hope it's better.
> Thanks.

LGTM modulo the typo in code comment. Thanks.

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 1686:

> 1684:   // In case of 11th bit of `lower` is 0, it's straightforward to understand.
> 1685:   // In case of 11th bit of `lower` is 1, it's a bit tricky, to help understand,
> 1686:   // image divide both `upper` and `lower` into 2 parts respectively, i.e.

Suggestion: s/image/imagine/

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

Marked as reviewed by fyang (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19431#pullrequestreview-2091050276
PR Review Comment: https://git.openjdk.org/jdk/pull/19431#discussion_r1622540261


More information about the hotspot-dev mailing list