RFR: 8326306: RISC-V: Re-structure MASM calls and jumps [v5]
Robbin Ehn
rehn at openjdk.org
Mon May 6 18:01:07 UTC 2024
On Mon, 6 May 2024 15:21:31 GMT, Robbin Ehn <rehn at openjdk.org> wrote:
>> 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.
> (e.g. setting -XX:ReservedCodeCacheSize=2047M some interpreter math will use movptr)
>
> Thanks!
Great, thanks.
I fixed it by using li() in la() when we can't use auipc, running tests.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18942#discussion_r1591368438
More information about the hotspot-dev
mailing list