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

Robbin Ehn rehn at openjdk.org
Thu Nov 21 14:01:28 UTC 2024


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

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

Commit messages:
 - Init

Changes: https://git.openjdk.org/jdk/pull/22293/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22293&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8344382
  Stats: 81 lines in 2 files changed: 29 ins; 13 del; 39 mod
  Patch: https://git.openjdk.org/jdk/pull/22293.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22293/head:pull/22293

PR: https://git.openjdk.org/jdk/pull/22293


More information about the hotspot-dev mailing list