On Thu, 27 Nov 2025 14:54:06 GMT, Aleksey Shipilev <[email protected]> wrote:
> Current atomic match rules are all over the place in AArch64: > - CAE and weak CAS rules are generated with the help of `cas.m4`, and then > are supposed to be copy-pasted (?) into `aarch64.ad`. I did it about 20 times > when fixing [JDK-8372154](https://bugs.openjdk.org/browse/JDK-8372154), gets > tedious very quickly. > - Strong CAS and get-and-set rules are still in the same section of > `aarch64.ad`, and are written by hand. Yet, those can be automatically > generated from M4 stencils as well. > > This PR cleans that up by moving all these rules into a separate `.ad` file, > which one can cleanly re-generate by invoking `m4 aarch64_atomic_ad.m4 > > aarch64_atomic.ad`. The meat of the change is `aarch64_atomic.m4`, everything > else is either generated from it, or removed in favor of auto-generated code. > There should be no semantic change, as I attempted to move the rules mostly > verbatim, only changing non-semantic stuff like match rule names and some > formats. > > Testing: > - [x] Eyeballing match rules before/after > - [x] Linux AArch64 server fastdebug, `hotspot_compiler` > - [x] Linux AArch64 server fastdebug, `tier1` > - [x] Linux AArch64 server fastdebug, `all` > - [x] Linux AArch64 server fastdebug, jcstress run This pull request has now been integrated. Changeset: 3481252c Author: Aleksey Shipilev <[email protected]> URL: https://git.openjdk.org/jdk/commit/3481252ced7c06c44154ceccc56b12cfd9a490c3 Stats: 2349 lines in 5 files changed: 1156 ins; 1193 del; 0 mod 8372188: AArch64: Generate atomic match rules from M4 stencils Reviewed-by: aph, haosun ------------- PR: https://git.openjdk.org/jdk/pull/28538
