RFR: 8344382: RISC-V: CASandCAEwithNegExpected fails with Zacas
Fei Yang
fyang at openjdk.org
Fri Nov 22 04:27:22 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 feature code sharing).
> - t1 was set by cmpxchg_narrow_value but not passed.
> - To free up a register, not_mask is now a scratch registers. Hence thus 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 fix! Now I see what's going on here. Thanks for finding it out.
FYI: I also tried the non-zacas code path, seems to work.
-------------
Marked as reviewed by fyang (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/22293#pullrequestreview-2453293026
More information about the hotspot-dev
mailing list