RFR: 8316186: RISC-V: Remove PlatformCmpxchg<4>

Fei Yang fyang at openjdk.org
Mon Sep 18 13:13:40 UTC 2023


On Wed, 13 Sep 2023 12:25:41 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

> Hi, please consider.
> 
> I don't know the history behind the Cmpxhg<4>, but it is not needed anymore.
> Using compiler as in 8 byte case is just fine.
> 
> Passes hotspot-tier (qemu, vf2 still running), some manual extra testing via gtest, looked at compiler: output, e.g. https://godbolt.org/z/a31Gdqn8q
> 
> If you know the history please share, and if you have a reason why we should keep it please speak up!

I agree with your understanding about RISC-V C/C++ ABI calling conversion. I am suspecting that this might be related how narrow oop are loaded for template interpreter, C1 and C2. Normally we use `lwu` to do that which does zero-extension instead of sign-extension for the low 32-bits. An example for C2 is [1]. Sign-extension for 32-bit narrow oop doesn't make much sense to me at first glance. But that's just a guess.

BTW: I am using native GCC-11.4.0 shipped with Ubuntu 22.04.3 LTS on Unmatched board. I can try GCC-12 later. 

[1] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/riscv/riscv.ad#L4684

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

PR Comment: https://git.openjdk.org/jdk/pull/15715#issuecomment-1723375165


More information about the hotspot-runtime-dev mailing list