Skip to content

cmd/asm: add ordered CASP variants for arm64#79930

Draft
arthurschreiber wants to merge 1 commit into
golang:masterfrom
arthurschreiber:arm64-casp-ordered-variants
Draft

cmd/asm: add ordered CASP variants for arm64#79930
arthurschreiber wants to merge 1 commit into
golang:masterfrom
arthurschreiber:arm64-casp-ordered-variants

Conversation

@arthurschreiber

@arthurschreiber arthurschreiber commented Jun 10, 2026

Copy link
Copy Markdown

The arm64 assembler supports the LSE compare-and-swap-pair instructions only in their relaxed form (CASPD, CASPW). Add the acquire, release, and acquire-release variants: CASPAD, CASPAW, CASPLD, CASPLW, CASPALD, CASPALW.

The single-register CAS family already supports all four orderings; the pair instructions were the only members limited to the relaxed variant, forcing code that needs an ordered 128-bit compare-and-swap to hand-encode the instruction with WORD directives.

Fixes #79929

The arm64 assembler supports the LSE compare-and-swap-pair
instructions only in their relaxed form (CASPD, CASPW). Add the
acquire, release, and acquire-release variants: CASPAD, CASPAW,
CASPLD, CASPLW, CASPALD, CASPALW.

The single-register CAS family already supports all four orderings;
the pair instructions were the only members limited to the relaxed
variant, forcing code that needs an ordered 128-bit compare-and-swap
to hand-encode the instruction with WORD directives.

Fixes golang#79929
@google-cla

google-cla Bot commented Jun 10, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cmd/asm: add ordered CASP variants (CASPA, CASPL, CASPAL) for arm64

1 participant