RFR: 8326306: RISC-V: Re-structure MASM calls and jumps [v2]
Robbin Ehn
rehn at openjdk.org
Mon Apr 29 06:33:05 UTC 2024
On Fri, 26 Apr 2024 14:06:10 GMT, Fei Yang <fyang at openjdk.org> wrote:
>> 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. Are we going to remove the `relocate` for non-code-cache call at [1] and further improve the `movptr` at [2] making use of `la`? So no need for `call` then as they could be replaced with `rt_call` then? 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
I have not looked at it in detail.
As mnemonic for **call** is _auipc_ + _jalr_, in hotspot `la()` + `jalr()`.
So sites using call() for non-code-cache was changed to rt_call(), which gets us the same result as the old call().
Hence this patch 'tries' to keep the generate assembly the same.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18942#discussion_r1582591937
More information about the hotspot-dev
mailing list