RFR: 8344382: RISC-V: CASandCAEwithNegExpected fails with Zacas

Hamlin Li mli at openjdk.org
Fri Nov 22 15:02:15 UTC 2024


On Thu, 21 Nov 2024 13:56:32 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

> Hi, please consider.
> 
> There are two issues with narrow amocas:
> - weak_cmpxchg_narrow_value don't load from aligned address.
> - cmpxchg_narrow_value compared new to loaded value, not to expected value.
> 
> This addresses these two issues and makes some minor cleanups by:
> - Weak and strong are now identical for easier debugging (and in futre code sharing).
> - t1 was set by cmpxchg_narrow_value_helper but not passed.
> - To free up a register, not_mask is now a scratch register. Hence if amocas fails we need to re-create not mask.
> - Subjective change: a register containing temporary value is best named scratch, as the register it self is not temporary.
> 
> Same as other PR, here be dragons.
> But with a working baseline we can start improving this code.
> 
> Passes test/hotspot/jtreg/compiler/unsafe/ with +/-UseZacas.
> And I'm running tier1 +/-UseZacas (I'll run tests over the weekend).
> 
> Thanks, Robbin

Nice catch and fix! Thanks!

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

Marked as reviewed by mli (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/22293#pullrequestreview-2454667596


More information about the hotspot-dev mailing list