Skip to content

Conversation

alexcrichton
Copy link
Member

This required definitions for {v,}pshuf{lw,hw,d} as well as reusing existing definitions for vround* instructions. While no other changes were needed in the assembler itself there was one minor ISLE change: the vrounds{s,d} instructions have a register operand that is used to copy to the upper bits of the result and this was not previously modeled in ISLE. Instead during emission the destination had its upper bits preserved, but this has proven to be problematic in the past where the upper bits being carried from previous instructions can cause unintended data dependencies and drastically slowing down tight loops. This commit fills in this operand with xmm_zero which means the upper bits will now be zeroed and any data dependencies from before will be severed.

This required definitions for `{v,}pshuf{lw,hw,d}` as well as reusing
existing definitions for `vround*` instructions. While no other changes
were needed in the assembler itself there was one minor ISLE change: the
`vrounds{s,d}` instructions have a register operand that is used to copy
to the upper bits of the result and this was not previously modeled in
ISLE. Instead during emission the destination had its upper bits
preserved, but this has proven to be problematic in the past where the
upper bits being carried from previous instructions can cause unintended
data dependencies and drastically slowing down tight loops. This commit
fills in this operand with `xmm_zero` which means the upper bits will
now be zeroed and any data dependencies from before will be severed.
@alexcrichton alexcrichton requested a review from a team as a code owner June 9, 2025 20:16
@alexcrichton alexcrichton requested review from cfallin and removed request for a team June 9, 2025 20:16
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:x64 Issues related to x64 codegen winch Winch issues or pull requests labels Jun 9, 2025
Copy link

github-actions bot commented Jun 9, 2025

Subscribe to Label Action

cc @saulecabrera

This issue or pull request has been labeled: "cranelift", "cranelift:area:x64", "winch"

Thus the following users have been cc'd because of the following labels:

  • saulecabrera: winch

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@cfallin cfallin requested review from abrown and removed request for cfallin June 10, 2025 15:23
@cfallin
Copy link
Member

cfallin commented Jun 10, 2025

(Handing off review to @abrown if you don't mind -- I'm traveling this week at a conference)

@abrown abrown added this pull request to the merge queue Jun 10, 2025
Merged via the queue into bytecodealliance:main with commit b96cf0c Jun 10, 2025
53 checks passed
@alexcrichton alexcrichton deleted the x64-migirate-xmm-unary-rmr-imm branch June 10, 2025 19:05
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 winch Winch issues or pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants