Skip to content

x64: fix scalar_to_vector with i16x8 types#10949

Merged
fitzgen merged 2 commits into
bytecodealliance:mainfrom
abrown:fix-10906
Jun 6, 2025
Merged

x64: fix scalar_to_vector with i16x8 types#10949
fitzgen merged 2 commits into
bytecodealliance:mainfrom
abrown:fix-10906

Conversation

@abrown
Copy link
Copy Markdown
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
Copy Markdown
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
bongjunj pushed a commit to prosyslab/wasmtime that referenced this pull request Oct 20, 2025
* Add a test for reproducing bytecodealliance#10906

This also includes a compile test; the disassembly makes things more
clear.

* Fix bytecodealliance#10906 by zeroing the XMM register prior to use
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