RFR: 8326306: RISC-V: Re-structure MASM calls and jumps [v5]

Robbin Ehn rehn at openjdk.org
Mon May 6 15:23:55 UTC 2024


On Mon, 6 May 2024 14:40:29 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 seven additional commits since the last revision:
>> 
>>  - 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
>>  - Missed a ws
>>  - JALR
>
> src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 938:
> 
>> 936:   int32_t offset = 0;
>> 937:   la(temp, dest, offset);
>> 938:   Assembler::jalr(x1, temp, offset);
> 
> Hi, did you check the possible impact on performance of this change too?
> 
> old: call() => mv(tmp, adr) => li(tmp, adr)
> new: call() => la(tmp, adr) => auipc/movptr(tmp, adr)
> 
> It's OK if we have auipc emitted by the new call(), which should not be worse then the old one. But the new call() could emit a fixed-sized movptr depending on the `is_32bit_offset_from_codecache` check which should be slower than a li(tmp, adr).

I checked that we use the use call with a code cache address for the places we care about such as:
I.e. JNI FastGetField and far_call()

But I now see I was mistaken regarding the interpreter, it seems like we don't have all the math implemented, so we do calls to SharedRuntime there, I'll fix those.

Thanks!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18942#discussion_r1591169972


More information about the hotspot-dev mailing list