RFR: 8326306: RISC-V: Re-structure MASM calls and jumps [v10]
Robbin Ehn
rehn at openjdk.org
Mon May 13 10:20:32 UTC 2024
On Mon, 13 May 2024 07:26:14 GMT, Fei Yang <fyang at openjdk.org> wrote:
>> Robbin Ehn has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 12 additional commits since the last revision:
>>
>> - Merge branch 'master' into jal-fixes
>> - Revert JNI field, call()->li()
>> - Use li instead of movptr for call
>> - REVERT: Use li instead of movptr
>> - Use li instead of movptr
>> - VM leaf should use li
>> - Merge branch 'master' into jal-fixes
>> - Merge branch 'master' into jal-fixes
>> - Merge branch 'master' into jal-fixes
>> - Corrected method name
>> - ... and 2 more: https://git.openjdk.org/jdk/compare/2d58c054...d53e9694
>
> src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 858:
>
>> 856: assert(temp != noreg && temp != x0, "expecting a register");
>> 857: int32_t offset = 0;
>> 858: movptr(temp, dest, offset);
>
> One more question: will `la(temp, dest, offset)` work here? I see you've changed to use `la` for `MacroAssembler::j(const address dest, Register temp)` instead of the `movptr` used before. Seems that we can do similar change here as well.
> (BTW: `rt_call` is another place where we could make use of `la` to replace `movptr` in the else block)
Jump can 'only' go to code cache (if someone jumps to C/C++ method we would be in trouble).
Therefore I changed to la(), otherwise I tried to keep generate code same:ish.
I don't see any reason for why we can't use it for those cases.
I think any movptr in a compressible region should be la().
Sanity tested with RCC 2047 and unset.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18942#discussion_r1598231289
More information about the hotspot-dev
mailing list