Skip to content

x64: fix scalar_to_vector with i16x8 types #10949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 6, 2025

Conversation

abrown
Copy link
Member

@abrown abrown commented Jun 6, 2025

This fixes an issue introduced in #9045 where the XMM register used as an i16x8 destination for scalar_to_vector is not properly zeroed prior to moving the i16 there. This means that uninitialized bits from previous instructions are readable in the top lanes of the destination. The fix for this miscompilation is to zero the XMM register prior to moving the i16 to the XMM.

Fixes #10906.

abrown added 2 commits June 5, 2025 18:20
This also includes a compile test; the disassembly makes things more
clear.
@abrown abrown requested a review from a team as a code owner June 6, 2025 02:50
@abrown abrown requested review from fitzgen and removed request for a team June 6, 2025 02:50
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:x64 Issues related to x64 codegen labels Jun 6, 2025
Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

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

Thanks!

@fitzgen fitzgen added this pull request to the merge queue Jun 6, 2025
Merged via the queue into bytecodealliance:main with commit e600137 Jun 6, 2025
71 checks passed
@abrown abrown deleted the fix-10906 branch June 6, 2025 23:28
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.

Cranelift: Inconsistent results from scalar_to_vector
2 participants