RFR: 8340241: RISC-V: Returns mispredicted [v15]

Robbin Ehn rehn at openjdk.org
Wed Oct 16 14:12:15 UTC 2024


On Wed, 16 Oct 2024 12:32:56 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Same anwser here actual call do not need to kill CR as RFLAG is SOC.
>
> Note that C2 instruct `partialSubtypeCheckConstSuper` is not a call. So this issue is still there for this case I think. 
> 
> (Also `t0` and `t1` is reserved from C2, so I don't think they will save and restore them. That's why we add clobbering for `t1`/rflags for C2 calling instructs: CallRuntime/CallDynamicJava ... Redundant??? )

Note sure what you mean by "t0 and t1 is reserved from C2".
They are not allocatable by register allocator.
But C2 think there is RFLAG register (still not allocatable), which we have aliased with x6/t1.
This pseudo register will be SOC.
Any live SOC should be pushed before a call.

The clobbering we added for CallRuntime/CallDynamicJava is not needed AFAIK, check e.g. x86 it do not kill CR as RFLAG is also set to SOC on x86 (but here backed with a real register).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21406#discussion_r1803189043


More information about the hotspot-dev mailing list