RFR: 8372862: AArch64: Fix GetAndSet-acquire costs after JDK-8372188

Aleksey Shipilev shade at openjdk.org
Tue Dec 2 10:51:01 UTC 2025


I just noticed (while looking at [JDK-8372800](https://bugs.openjdk.org/browse/JDK-8372800)) that I made a little error in [JDK-8372188](https://bugs.openjdk.org/browse/JDK-8372188) refactor, which made GetAndSet-acquire instruction cost twice as high. The usual cost for acquire versions are twice as low, likely to be selected instead of non-acquire versions.

This bug happened as I "simplified" stencils at some point by dropping some arguments and renumbering the remaining ones. This is one place where I apparently forgot to renumber one usage. See other checks for `ifelse($3,Acq,...` in that stencil, all of them are `$3` (correct), not `$4` (incorrect). Seen no real bugs because of this mishap, but it would be good to fix it in case we see issues later. I also looked at stencils again, and I think there are no other argument-index problems like this anywhere else.

The real change is in `aarch64_atomic_ad.m4`, `.ad` is re-generated from that stencil.

Additional testing:
 - [ ] Linux AArch64 server fastdebug, `all`
 - [ ] Linux AArch64 server fastdebug, quick jcstress run

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

Commit messages:
 - Fix

Changes: https://git.openjdk.org/jdk/pull/28598/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28598&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8372862
  Stats: 5 lines in 2 files changed: 0 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/28598.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28598/head:pull/28598

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


More information about the hotspot-compiler-dev mailing list