Skip to content

x64: add APX NDD lowering for simple integer binary ops - #14930

Merged
fitzgen merged 1 commit into
bytecodealliance:mainfrom
jlb6740:apx-patch-lower-simple-binary-ops
Oct 22, 2026
Merged

fitzgen merged 1 commit into
bytecodealliance:mainfrom
jlb6740:apx-patch-lower-simple-binary-ops

Conversation

@jlb6740

@jlb6740 jlb6740 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

First of a series splitting #14696 into one PR per instruction class. Adds the
APX NDD (new data destination) forms of sub, and, or and xor for 64-bit
register-register ops, following the pattern #13916 established for add: an
RVM encoding promoted into EVEX map 4 with ND = 1, plus a lowering rule
guarded on use_apx. The separate destination means the register allocator no
longer needs a move to preserve a live input. has_apx is off by default, so
nothing changes unless it's enabled. More NDD patches to follow.

@jlb6740
jlb6740 requested a review from a team as a code owner October 22, 2026 00:16
@jlb6740
jlb6740 requested review from fitzgen and removed request for a team October 22, 2026 00:16
@jlb6740
jlb6740 force-pushed the apx-patch-lower-simple-binary-ops branch from 709b053 to 67fea8c Compare October 22, 2026 00:24
@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator cranelift:area:x64 Issues related to x64 codegen labels Oct 22, 2026
@jlb6740

jlb6740 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Note that this patch, and none of the patches to come based on #14969, are gated on the regalloc work bytecodealliance/regalloc2#267 and can go in before.

@fitzgen fitzgen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be interesting to check in instruction encoding whether the first operand and destination are (1) actually different registers or (2) in the new register set, and if neither is true then we should be able to use an old (more compact) encoding, correct? This would require a bit more machinery than currently exists, as I believe that we go immediately from MInst to assembler instruction encoding automatically, but seems like something that we should have a tracking issue for and would probably want to have before enabling APX by default on supported hardware.

@fitzgen
fitzgen added this pull request to the merge queue Oct 22, 2026
Merged via the queue into bytecodealliance:main with commit 9ddb159 Oct 22, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift:area:x64 Issues related to x64 codegen cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants