RFR: 8320697: RISC-V: Small refactoring for runtime calls

Robbin Ehn rehn at openjdk.org
Tue Nov 28 09:49:08 UTC 2023


On Tue, 28 Nov 2023 08:54:59 GMT, Fei Yang <fyang at openjdk.org> wrote:

> > `Renamed MacroAssembler::la_patchable with MacroAssembler::auipc making it explicit that this will emit pc-relative addressing code.`
> > First, above is not true, as it may emit movptr, it's now an implicit movptr instead. When you thought you were getting auipc. Secondly auipc is not a mnemonic AFAIK, it means just the instruction auipc. Having it as both is confusing. Third the one version is now called "la" while the other one is called "auipc" ?
> > Sorry, but this part is worse now in IMHO.
> 
> Yeah, I see that too :-) I guess the intention is to try to map to the aarch64 counterpart MacroAssembler::adrp [1]. I did some history searching and seems that the else block is there only to handle some corner cases [2]. We might want to find a better name for this function but seems not easy to do :-(
> 
> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp#L4968 [2] https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2015-November/019895.html

I think there is an underlying issue with the whole design with masm/asm.
As there is no clear separation between "I want this to happen" and "I want to emit this instruction".
I think methods which have identical name as an instruction should indicate "I want to emit this instruction".

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

PR Comment: https://git.openjdk.org/jdk/pull/16816#issuecomment-1829454314


More information about the hotspot-compiler-dev mailing list