RFR: 8326306: RISC-V: Re-structure MASM calls and jumps [v2]
Fei Yang
fyang at openjdk.org
Fri Apr 26 14:10:02 UTC 2024
On Fri, 26 Apr 2024 11:18:15 GMT, Robbin Ehn <rehn at openjdk.org> wrote:
>> src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 5456:
>>
>>> 5454: __ mv(c_rarg0, xthread);
>>> 5455: BLOCK_COMMENT("call runtime_entry");
>>> 5456: __ rt_call(runtime_entry);
>>
>> I agree it's better to use `call_VM_leaf` for the Shenandoah cases. Then what about the changes in this file and templateInterpreterGenerator_riscv.cpp? Any reason to switch to `rt_call`?
>
> Old call():
>
> int32_t offset = 0;
> mv(temp, dest, offset); // =>li();
> jalr(x1, temp, offset);
>
>
> To keep the sites the same (for non-code-cache calls)
> New rt_call():
>
> movptr(tmp, target.target(), offset);
> Assembler::jalr(x1, tmp, offset);
>
>
> Same here means absolute calls, no reloc required.
> So I have tried to keep the calls the same. As you say we can optimize this by using reloc + la().
Hi, Let me try to understand what you mean. So, are we going to remote the `relocate` call for non-code-cache call at [1] and further improve the `movptr` at [2] making use of `la`? This sounds interesting to me :- )
[1] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp#L5031
[2] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp#L5033
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18942#discussion_r1581088731
More information about the hotspot-dev
mailing list